Thanks for the kind words!
Good news: you don’t need to pass anything. The WP-CLI command (available since v2.8.0) runs through exactly the same service the Media Library uses, so it reads the AI provider, model, API key and prompt straight from Auto Alt Text options.
There are no flags for credentials at all, just configure the plugin in wp-admin once, and the CLI will
use those settings.
Basic usage (run it from your WordPress root over SSH):
wp auto-alt-text generate --all --limit=50
–limit is the batch size the command works through, so with 2000 images you can just leave it running. WP-CLI has no HTTP timeout, which is exactly why it solves the problem you hit in the browser.
Other options:
–ids=123,456,789 – process specific attachments instead of everything
–dry-run – see what would happen without writing any alt text (good for a first test)
–force – overwrite existing alt text even if “Keep existing alt text” is enabled in the settings
A couple of practical tips for a 2000-image run:
- Start with a small test: wp auto-alt-text generate –ids= –dry-run, then without –dry-run.
- By default, if “Keep existing alt text” is enabled, images that already have alt text are skipped, so you only pay for what’s missing.
- At the end the command prints a summary (Processed / Updated / Skipped / Failed). Any API failure is logged in Auto Alt Text → Error log with the reason, and never blocks the run.
- Keep an eye on your provider’s rate limits/billing. 2000 vision calls is a real cost.
And yes, you’re right that the docs are too thin on this, I’ll add a proper FAQ section on WP-CLI in the next release.
Thank you so much for your rapid and comprehensive response! I’m happy to let you know that I’ve successfully run the operation per your instructions without a hitch. Everything came out great! Thanks again for your fantastic product!