feat(cli): add zeroclaw providers command to list supported providers

- Add `zeroclaw providers` CLI command that lists all 28 supported AI providers
- Each entry shows: config ID, display name, local/cloud tag, active marker, and aliases
- Also shows `custom:<URL>` and `anthropic-custom:<URL>` escape hatches at the bottom

Previously users had no way to discover available providers without reading source code. The
unknown-provider error message suggests `run zeroclaw onboard --interactive` but doesn't list
options. This command gives immediate visibility.
This commit is contained in:
reidliu41 2026-02-17 21:14:10 +08:00 committed by Chummy
parent cba7d1a14b
commit feaa4aba60
2 changed files with 75 additions and 0 deletions

View file

@ -192,6 +192,9 @@ enum Commands {
model_command: ModelCommands,
},
/// List supported AI providers
Providers,
/// Manage channels (telegram, discord, slack)
Channel {
#[command(subcommand)]
@ -551,6 +554,27 @@ async fn main() -> Result<()> {
}
},
Commands::Providers => {
let providers = providers::list_providers();
let current = config.default_provider.as_deref().unwrap_or("openrouter");
println!("Supported providers ({} total):\n", providers.len());
println!(" {:<19} {}", "ID (use in config)", "DESCRIPTION");
println!(" {:<19} {}", "───────────────────", "───────────");
for p in &providers {
let marker = if p.name == current { " (active)" } else { "" };
let local_tag = if p.local { " [local]" } else { "" };
let aliases = if p.aliases.is_empty() {
String::new()
} else {
format!(" (aliases: {})", p.aliases.join(", "))
};
println!(" {:<19} {}{}{}{}", p.name, p.display_name, local_tag, marker, aliases);
}
println!("\n custom:<URL> Any OpenAI-compatible endpoint");
println!(" anthropic-custom:<URL> Any Anthropic-compatible endpoint");
Ok(())
}
Commands::Service { service_command } => service::handle_command(&service_command, &config),
Commands::Doctor => doctor::run(&config),