Multi-Provider Agent CLI
The CLI provides commands for running agents with different LLM providers, testing connectivity, and managing provider configurations.Available Commands
| Command | Description |
|---|---|
llm providers | List available AI SDK providers |
llm test <provider> | Test connectivity to a provider |
llm validate <provider> | Validate provider configuration |
llm run "<prompt>" | Run a prompt with a model |
llm models | List common models by provider |
llm config | Show resolved configuration |
llm trace | Demo attribution headers |
llm tools | Show tool calling documentation |
llm json | Show structured output documentation |
List Providers
List all supported AI SDK providers and their status:JSON Output
Test Provider
Test connectivity to a specific provider:With Custom Model
JSON Output
Validate Configuration
Validate provider setup including API keys and packages:JSON Output
Run Prompts
Execute prompts with any supported model:Basic Usage
With Model Selection
Streaming
JSON Output
With Timeout
Verbose Mode
List Models
Show common models for each provider:Show Configuration
Display resolved configuration with redacted secrets:JSON Output
Attribution Trace Demo
Demonstrate multi-agent attribution headers:JSON Output
Tool Calling Documentation
Show how to use tool calling with AI SDK:Structured Output Documentation
Show how to generate structured JSON output:generateObject with Zod schemas.
Global Options
All commands support these options:| Option | Description |
|---|---|
--json | Output in JSON format |
--verbose | Show detailed output |
--model <provider/model> | Specify model |
--timeout <ms> | Request timeout in milliseconds |
Environment Variables
Configure providers via environment variables:Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Authentication error |
| 4 | Provider not found |
| 5 | Network error |
| 6 | Timeout |
Examples
Test All Configured Providers
Compare Models
Streaming with Different Providers
Troubleshooting
Provider Not Found
Authentication Error
Ensure your API key is set:Timeout Issues
Increase timeout for slow requests:Next Steps
- AI SDK Backend - Code-based usage guide
- Provider Registry - Managing providers
- Streaming - Advanced streaming

