Image optimizer · Playbook
Alt-text generation
--alt generates a draft alt-text attribute per image and writes alt-text.tsv (two columns:
output filename, alt) in the output dir — ready to paste into the WordPress media library’s bulk
editor or a spreadsheet import. It’s opt-in and best-effort: a provider failure fails only
that image’s alt (blank cell, ⚠alt flag), never the conversion.
Providers (chosen once at setup, in ~/.shrinkita/config.json)
opencode (default)
Uses the team’s existing opencode login — no new credential. The tool shells out to:
opencode run -m <model> -f <image> -- "<alt prompt>"
The -- is required: -f is a file-array flag and will otherwise swallow the prompt. Default
model opencode/gemini-3-flash (cheap, vision-capable). Override with --alt-model. Requires a
working opencode login — if the configured provider’s key is invalid you’ll see ⚠alt on every
image; re-auth with opencode providers.
gemini
A direct REST call to generativelanguage.googleapis.com with the image inline (base64). Get a
free key at https://aistudio.google.com/apikey. Stored in the config (chmod 600) or read from
GEMINI_API_KEY. Default model gemini-2.5-flash; override with --alt-model.
none
Skip alt entirely; --alt becomes a no-op. Everything else (conversion, sizes, report) runs.
Override per run
--alt --alt-provider gemini # this run uses gemini regardless of config
--alt --alt-provider opencode --alt-model opencode/claude-haiku-4-5
The prompt
The model is asked for concise (<125 char) descriptive alt describing the main subject and any visible text, output raw with no quotes/prefix. Always review before publishing — generated alt is a strong first draft, not a substitute for human judgment on decorative-vs-informative images or brand-specific terminology.