Description:
Bug Report
Summary
On running cli.php with any provider (e.g. --providerId=google) always fails with:
[ERROR] Invalid arguments while trying to set up prompt builder: Provider not registered: google
Cause
This happens even when the correct API key is set in .env and the provider packages (wordpress/google-ai-provider, wordpress/openai-ai-provider, wordpress/anthropic-ai-provider) are installed as dev dependencies.
cli.php is missing two bootstrapping steps that the integration test suite handles in tests/integration/bootstrap.php:
- Loading
.env API keys in .env are never read into the environment, so getenv() calls inside providers return nothing.
- Registering providers — Provider classes (e.g.
GoogleProvider) are never registered with the ProviderRegistry, so the registry has no providers to resolve by ID.
Description:
Bug Report
Summary
On running
cli.phpwith any provider (e.g.--providerId=google) always fails with:Cause
This happens even when the correct API key is set in
.envand the provider packages (wordpress/google-ai-provider,wordpress/openai-ai-provider,wordpress/anthropic-ai-provider) are installed as dev dependencies.cli.phpis missing two bootstrapping steps that the integration test suite handles intests/integration/bootstrap.php:.envAPI keys in.envare never read into the environment, sogetenv()calls inside providers return nothing.GoogleProvider) are never registered with theProviderRegistry, so the registry has no providers to resolve by ID.