Ask one model, compare multiple providers, hand work from one AI to another, and run reusable workflows — using your own API keys.
AIbridge CLI is not yet published as a public npm package. Until then, run it directly from the source checkout — the commands below always reflect what actually works today.
// The public npm installation command will be added when the package is published.
AIbridge doesn't provide or require a universal API key of its own. You use your own key for each provider you want to talk to — the CLI calls that provider directly, with your key.
Four ways to use one or more AI providers from the same CLI, all built on the same request/response layer AIbridge's web app uses.
Every command AIbridge CLI supports today. Nothing here is aspirational — this mirrors docs/cli.md and each command's own --help output.
Interactive walkthrough that explains, before asking anything, where each API key will (or won't) be stored. Never requires an AIbridge account.
aibridge setup [--non-interactive]
0 successaibridge setup
Shows which of the five supported providers are configured (an API key is resolvable) and where the key came from — never the key itself.
aibridge providers [--format human|json]
0 successaibridge providers --json
Shows each provider's default model, and any override set via config set models.<id>.
aibridge models [--format human|json]
0 successaibridge models
Sends a single prompt to one provider. Prompt can come from an argument, piped stdin, or --file.
aibridge ask "prompt" --provider <id> [--model <name>] [--max-tokens <n>] [--retries <n>] [--no-retry] [--retry-base-ms <n>] [--session <id>] [--no-save] [--format human|json]
--provider claude|gpt|gemini|grok|deepseek--max-tokens integer, 1–8192 (default 1024)--retries 0–5 (default 2), --no-retry, --retry-base-ms 100–10000 (default 500)--file, --session, --no-save0 success2 invalid arguments3 provider not configured4 authentication error5 rate limited6 network/timeoutaibridge ask "Explain this error" --provider gpt cat server.js | aibridge ask "Review this code" --provider claude
Runs the same prompt against several providers concurrently. One provider failing never blocks the others.
aibridge compare "prompt" --providers <id1,id2,...> [--concurrency <n>] [--timeout <ms>] [--max-tokens <n>] [--retries <n>] [--no-retry] [--format human|json]
0 at least one provider succeeded1 all providers failed2 invalid argumentsEach provider retries independently — one provider's backoff never delays another.
aibridge compare "Review this architecture" --providers claude,gpt,gemini
Provider A answers first; provider B then receives your instruction plus provider A's (handoff-stripped) response as context.
aibridge handoff "prompt" --from <id> --to <id> [--instruction "..."] [--max-tokens <n>] [--retries <n>] [--no-retry] [--format human|json]
0 success2 invalid arguments3/4/5/6 provider errorsThe two stages retry independently — if the first provider succeeds and the second fails temporarily, only the second is retried; the first is never called again.
aibridge handoff "Design this feature" --from claude --to gpt --instruction "Check security and edge cases"
Validates a JSON workflow file, then runs its steps in order. success:true only if every step actually succeeded.
aibridge workflow run <file.json> ["input"] [--file <path>] [--max-tokens <n>] [--retries <n>] [--no-retry] [--format human|json]
0 every step succeeded2 invalid arguments / missing required input7 invalid workflow file3/4/5/6/1 depending on which step failed (see docs/cli-workflows.md)Each step retries independently; a step that already succeeded is never re-run because a later step needed a retry.
aibridge workflow run workflows/examples/design-and-review.json "Design a multi-tenant SaaS database"
aibridge sessions list [--format human|json]
0 successaibridge sessions list
aibridge sessions show <id>
0 success2 unknown idaibridge sessions show 3f1c2a90
aibridge sessions delete <id>
0 success (even if the id didn't exist)2 missing id argumentaibridge sessions delete 3f1c2a90
aibridge sessions clear
0 successaibridge sessions clear
aibridge config show
0 successaibridge config show
Refuses any key that looks like a secret (matching /key|secret|token|password|credential/i) — API keys never go through this command.
aibridge config set <key> <value>
0 success2 missing arguments or secret-looking keyaibridge config set defaultProvider gpt
aibridge config reset
0 successaibridge config reset
Checks Node version, config/session directory permissions, config file health, keychain availability, and which providers are configured — never a network call unless --network is passed.
aibridge doctor [--format human|json]
0 all checks passed1 a check failedaibridge doctor
Adds a bare, unauthenticated HTTPS reachability check per configured provider. Never a paid or authenticated completion call — with or without this flag.
aibridge doctor --network
0 all checks passed1 a check failedaibridge doctor --network
Precedence: --file > argument + piped stdin (argument becomes the instruction, stdin the content) > stdin alone > argument alone. No input in any form → a readable error, never an empty prompt sent to a provider.
~/.aibridge/sessions/--session <id>--no-saveaibridge sessionsA workflow is a small, versioned JSON document. Each step can reference the workflow's input, or the output of a step that already ran.
// same shape as workflows/examples/design-and-review.json, shown here with simplified prompt text
{{input}} — the input you passed to the workflow (argument, stdin, or --file){{steps.<id>.output}} — the output of a step that already ranThe response includes success, provider, model, response, usage, finishReason, truncated, attempts, retried and durationMs. For workflow run, it also includes summary.total, summary.succeeded, summary.failed and summary.skipped — counting steps, not retry attempts.
success: true means the request (or every step, for a workflow) completed successfully.truncated: true, the content can be incomplete — even when success: true.aibridge setup--max-tokensfinishReason and truncated are always available in JSON outputRetry-After header when present, still capped for safety--retries <0-5> and --retry-base-ms, or disable entirely with --no-retry--no-retry if that risk matters to youExit code 3. Set the relevant environment variable, or run aibridge setup. Check current status with aibridge providers.
Exit code 4. The provider rejected the key — check for a typo, an expired key, or a key issued for a different account/project.
Exit code 6. Check your connection, or increase the limit with --timeout <ms>.
Look for the ⚠ warning, or check truncated: true in JSON output. Raise the limit with --max-tokens (1–8192).
Exit code 2. If any step references {{input}}, pass one as an argument, via stdin, or with --file.
Exit code 7. The error message names the exact problem (bad schema, forward reference, unknown provider) — no step ever runs for an invalid file.
Re-run npm link from the source checkout, then confirm it's on your PATH:
npm link
which aibridge
Use AIbridge from the web or bring the same multi-provider workflow into your terminal.