cli-providers

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->
<!-- 由 src/lib/agentSkills/generator.ts 生成;手动修改将被覆盖 -->

Overview

概览

Manage provider connections from the CLI: list available/configured providers, add, test, test-all, validate, rotate API keys, and view per-provider metrics.
通过 CLI 管理提供商连接:列出可用或已配置的提供商,添加、测试、批量测试、验证、轮换 API keys,以及查看各提供商的指标。

Quick install

快速安装

bash
npm install -g omniroute   # or: npx omniroute
omniroute --version
bash
npm install -g omniroute   # or: npx omniroute
omniroute --version

Subcommands

子命令

provider-cmd provider [subcommand]

provider-cmd provider [subcommand]

Manage provider connections (use
Example:
bash
omniroute provider-cmd provider [subcommand]
管理提供商连接(使用
示例:
bash
omniroute provider-cmd provider [subcommand]

providers

providers

Example:
bash
omniroute providers
示例:
bash
omniroute providers

providers available

providers available

Show available providers in the OmniRoute catalog
Flags:
  • --json
  • --search <query>
  • -q, --q <query>
  • --category <category>
Example:
bash
omniroute providers available
显示 OmniRoute 目录中可用的提供商
参数:
  • --json
  • --search <query>
  • -q, --q <query>
  • --category <category>
示例:
bash
omniroute providers available

providers list

providers list

List configured provider connections
Flags:
  • --json
Example:
bash
omniroute providers list
列出已配置的提供商连接
参数:
  • --json
示例:
bash
omniroute providers list

providers test <idOrName>

providers test <idOrName>

Test a configured provider connection
Flags:
  • --json
Example:
bash
omniroute providers test <idOrName>
测试已配置的提供商连接
参数:
  • --json
示例:
bash
omniroute providers test <idOrName>

providers test-all

providers test-all

Test all active provider connections
Flags:
  • --json
Example:
bash
omniroute providers test-all
测试所有活跃的提供商连接
参数:
  • --json
示例:
bash
omniroute providers test-all

providers validate

providers validate

Validate local provider configuration without calling upstream
Flags:
  • --json
Example:
bash
omniroute providers validate
在不调用上游服务的情况下验证本地提供商配置
参数:
  • --json
示例:
bash
omniroute providers validate

providers rotate <idOrName>

providers rotate <idOrName>

Flags:
  • --new-key <key>
  • --from-env <VAR>
  • --oauth
  • --yes
  • --skip-test
  • --dry-run
Example:
bash
omniroute providers rotate <idOrName>
参数:
  • --new-key <key>
  • --from-env <VAR>
  • --oauth
  • --yes
  • --skip-test
  • --dry-run
示例:
bash
omniroute providers rotate <idOrName>

providers status

providers status

Flags:
  • --provider <name>
  • --json
Example:
bash
omniroute providers status
参数:
  • --provider <name>
  • --json
示例:
bash
omniroute providers status

providers metrics

providers metrics

Flags:
  • --provider <id>
  • --connection-id <id>
  • --period <p>
  • --metric <m>
  • --sort-by <field>
  • --limit <n>
  • --watch
  • --compare <list>
Example:
bash
omniroute providers metrics
参数:
  • --provider <id>
  • --connection-id <id>
  • --period <p>
  • --metric <m>
  • --sort-by <field>
  • --limit <n>
  • --watch
  • --compare <list>
示例:
bash
omniroute providers metrics

providers metric <connectionId> <metric>

providers metric <connectionId> <metric>

Flags:
  • --period <p>
Example:
bash
omniroute providers metric <connectionId> <metric>
参数:
  • --period <p>
示例:
bash
omniroute providers metric <connectionId> <metric>

test-provider test [provider] [model]

test-provider test [provider] [model]

Flags:
  • --all-providers
  • --json
  • --latency
  • --repeat <n>
  • --compare <models>
  • --save <path>
Example:
bash
omniroute test-provider test [provider] [model]
<!-- skill:custom-start --> <!-- Migrated from skills/omniroute-cli-providers/SKILL.md (preserved curated content) -->
参数:
  • --all-providers
  • --json
  • --latency
  • --repeat <n>
  • --compare <models>
  • --save <path>
示例:
bash
omniroute test-provider test [provider] [model]
<!-- skill:custom-start --> <!-- 从 skills/omniroute-cli-providers/SKILL.md 迁移而来(保留了精心整理的内容) -->

OmniRoute — CLI Providers & Keys

OmniRoute — CLI 提供商与 API keys

Requires the
omniroute
CLI. See CLI entry-point skill for install + global flags.
需要
omniroute
CLI。有关安装和全局参数,请参阅 CLI 入口 skill。

Provider catalog (available providers)

提供商目录(可用提供商)

bash
omniroute providers available                        # Full OmniRoute provider catalog
omniroute providers available --search openai        # Filter by id, name, alias
omniroute providers available --category api-key     # Filter by category
omniroute providers available --json                 # Machine-readable JSON
Categories:
api-key
,
oauth
,
free
,
local
,
combo
.
bash
omniroute providers available                        # Full OmniRoute provider catalog
omniroute providers available --search openai        # Filter by id, name, alias
omniroute providers available --category api-key     # Filter by category
omniroute providers available --json                 # Machine-readable JSON
类别:
api-key
、
oauth
、
free
、
local
、
combo
。

Configured provider connections

已配置的提供商连接

bash
omniroute providers list                             # Connections in your DB
omniroute providers list --json
bash
omniroute providers list                             # Connections in your DB
omniroute providers list --json

Testing connections

测试连接

bash
omniroute providers test <id|name>                   # Test one configured connection
omniroute providers test-all                         # Test every active connection (TUI progress)
omniroute providers validate                         # Local-only structural validation (no HTTP)
test-all
opens an interactive TUI that shows live pass/fail per connection. Use
--json
to get a machine-readable result:
bash
omniroute providers test-all --json
bash
omniroute providers test <id|name>                   # Test one configured connection
omniroute providers test-all                         # Test every active connection (TUI progress)
omniroute providers validate                         # Local-only structural validation (no HTTP)
test-all
会打开一个交互式 TUI,实时显示每个连接的通过/失败状态。使用
--json
获取机器可读的结果:
bash
omniroute providers test-all --json

API key management (OmniRoute keys)

API key 管理(OmniRoute keys)

These manage the OmniRoute API keys issued under API Manager — not provider credentials.
bash
omniroute keys list                                  # List all OmniRoute API keys
omniroute keys add <provider> [apiKey]               # Add an API key for a provider
omniroute keys remove <provider>                     # Remove an API key
omniroute keys regenerate <id>                       # Regenerate (rotate) a key
omniroute keys revoke <id>                           # Revoke a key (disables it)
omniroute keys reveal <id>                           # Show the full key value
omniroute keys usage <id>                            # Show usage stats for a key

omniroute keys rotate <id>                           # Rotate + revoke old key atomically
omniroute keys expiration list                       # List key expiration times
这些命令管理由 API Manager 签发的 OmniRoute API keys,而不是提供商凭据。
bash
omniroute keys list                                  # List all OmniRoute API keys
omniroute keys add <provider> [apiKey]               # Add an API key for a provider
omniroute keys remove <provider>                     # Remove an API key
omniroute keys regenerate <id>                       # Regenerate (rotate) a key
omniroute keys revoke <id>                           # Revoke a key (disables it)
omniroute keys reveal <id>                           # Show the full key value
omniroute keys usage <id>                            # Show usage stats for a key

omniroute keys rotate <id>                           # Rotate + revoke old key atomically
omniroute keys expiration list                       # List key expiration times

Key policies

Key 策略

bash
omniroute keys policy show <id>                      # Show rate-limit / permission policy
omniroute keys policy set <id> \
  --rate-limit 100 \
  --rate-window minute \
  --permissions chat,models                          # Set policy on a key
bash
omniroute keys policy show <id>                      # Show rate-limit / permission policy
omniroute keys policy set <id> \
  --rate-limit 100 \
  --rate-window minute \
  --permissions chat,models                          # Set policy on a key

Models

模型

bash
omniroute models                                     # List all models (all providers)
omniroute models openai                              # Filter by provider
omniroute models --search gpt                        # Search by name
omniroute models --json                              # JSON output
bash
omniroute models                                     # List all models (all providers)
omniroute models openai                              # Filter by provider
omniroute models --search gpt                        # Search by name
omniroute models --json                              # JSON output

OAuth providers

OAuth 提供商

bash
omniroute oauth list                                 # List OAuth-configured providers
omniroute oauth login <provider>                     # Start browser-based OAuth flow
omniroute oauth logout <provider>                    # Revoke OAuth token
omniroute oauth status <provider>                    # Show token state + expiry
omniroute oauth refresh <provider>                   # Force token refresh
For OAuth providers (Gemini, Windsurf, Antigravity, etc.) the
login
command opens the OmniRoute dashboard OAuth flow in your browser.
bash
omniroute oauth list                                 # List OAuth-configured providers
omniroute oauth login <provider>                     # Start browser-based OAuth flow
omniroute oauth logout <provider>                    # Revoke OAuth token
omniroute oauth status <provider>                    # Show token state + expiry
omniroute oauth refresh <provider>                   # Force token refresh
对于 OAuth 提供商(Gemini、Windsurf、Antigravity 等),
login
命令会在浏览器中打开 OmniRoute dashboard 的 OAuth 流程。

Provider nodes (multi-account routing)

提供商节点(多账户路由)

Provider nodes let you attach multiple API keys / accounts to one logical provider for round-robin or failover.
bash
omniroute nodes list <provider>                      # List nodes for a provider
omniroute nodes add <provider> --api-key <key>       # Add a node
omniroute nodes remove <provider> <nodeId>           # Remove a node
omniroute nodes test <provider> <nodeId>             # Test one node
提供商节点允许将多个 API keys 或账户附加到一个逻辑提供商,以实现 round-robin 或故障转移。
bash
omniroute nodes list <provider>                      # List nodes for a provider
omniroute nodes add <provider> --api-key <key>       # Add a node
omniroute nodes remove <provider> <nodeId>           # Remove a node
omniroute nodes test <provider> <nodeId>             # Test one node

Routing combos (CLI)

路由组合(CLI)

Create and manage routing combos from the terminal:
bash
omniroute combo list                                 # List all combos
omniroute combo create <name> \
  --strategy priority \
  --targets anthropic/claude-opus-4-7,openai/gpt-4o  # Create combo
omniroute combo switch <name>                        # Activate a combo as default
omniroute combo delete <name>                        # Delete a combo
omniroute combo suggest --task "code review"         # Ask OmniRoute to recommend a combo
For the full REST API for combos see omni-combos-routing skill.
从终端创建和管理路由组合:
bash
omniroute combo list                                 # List all combos
omniroute combo create <name> \
  --strategy priority \
  --targets anthropic/claude-opus-4-7,openai/gpt-4o  # Create combo
omniroute combo switch <name>                        # Activate a combo as default
omniroute combo delete <name>                        # Delete a combo
omniroute combo suggest --task "code review"         # Ask OmniRoute to recommend a combo
有关路由组合的完整 REST API,请参阅 omni-combos-routing skill。

Quota & usage

配额与用量

bash
omniroute quota                                      # Provider quota usage + reset times
omniroute usage                                      # Request + token usage summary
omniroute cost                                       # Cost breakdown (by provider/model)
bash
omniroute quota                                      # Provider quota usage + reset times
omniroute usage                                      # Request + token usage summary
omniroute cost                                       # Cost breakdown (by provider/model)

Compression (CLI)

压缩(CLI)

bash
omniroute compression status                         # Current compression mode + savings stats
omniroute compression set --mode rtk                 # Enable RTK compression
omniroute compression set --mode stacked             # Enable stacked (RTK + Caveman)
omniroute compression set --mode off                 # Disable compression
omniroute compression preview --mode rtk --text "..."  # Preview savings for sample text
bash
omniroute compression status                         # Current compression mode + savings stats
omniroute compression set --mode rtk                 # Enable RTK compression
omniroute compression set --mode stacked             # Enable stacked (RTK + Caveman)
omniroute compression set --mode off                 # Disable compression
omniroute compression preview --mode rtk --text "..."  # Preview savings for sample text

Health

健康状态

bash
omniroute health                                     # Detailed health: circuit breakers, cache, memory
bash
omniroute health                                     # Detailed health: circuit breakers, cache, memory

Errors

错误

  • providers test <id>
    fails with 401 → API key stored for that provider is wrong; use
    keys remove
    +
    keys add
    to reset it
  • oauth login
    opens but doesn't complete → the OAuth token endpoint may be firewalled; use API key auth instead
  • combo create
    fails with
    strategy unknown
    → use one of:
    priority
    ,
    weighted
    ,
    round-robin
    ,
    fill-first
    ,
    least-used
    ,
    cost-optimized
    ,
    auto
    ,
    random
    ,
    strict-random
    ,
    p2c
    ,
    reset-aware
    ,
    lkgp
    ,
    context-optimized
    ,
    context-relay
<!-- skill:custom-end -->
  • providers test <id>
    返回 401 失败 → 为该提供商存储的 API key 不正确;使用
    keys remove
    +
    keys add
    重置
  • oauth login
    已打开但未完成 → OAuth token endpoint 可能被防火墙拦截;改用 API key 认证
  • combo create
    因
    strategy unknown
    失败 → 使用以下策略之一:
    priority
    、
    weighted
    、
    round-robin
    、
    fill-first
    、
    least-used
    、
    cost-optimized
    、
    auto
    、
    random
    、
    strict-random
    、
    p2c
    、
    reset-aware
    、
    lkgp
    、
    context-optimized
    、
    context-relay
<!-- skill:custom-end -->