CLI
Run AgentRouter from your terminal with the thin SDK-backed CLI
The AgentRouter CLI is the best integration surface when a human operator, support engineer, or developer wants to:
- inspect the live catalog quickly
- reproduce recommendation or execution flows from a terminal
- verify payloads before wiring them into an application
- run smoke checks in scripts or CI
The CLI is intentionally thin. It sits on top of the same TypeScript SDK surface and keeps the same capability-first model:
- inspect domains and capabilities
- inspect contracts and routes
- recommend a route
- execute explicitly
- inspect wallet and usage
The CLI ships inside the same npm package as the SDK: @agentrouter/agentrouter.
Install
Install the package locally when you want repeatable terminal workflows:
Then run:
If you only need a one-off command and do not want to add the package to a project yet:
Set Environment
Optional environment variables:
Recommended CLI Flow
Media Example: Pin fal Image Generation
fal image generation and edit are live on MPP image routes. Video generation is still recommend/context only: media.video.generate.fal.mpp remains gated after upstream paymentauth 524 timeouts reproduced outside AgentRouter.
Geo Example: Pin Abstract Timezone
Abstract Timezone current-time and convert-time routes are live after the May 9, 2026 paid local-production smoke. Inspect route context first so the CLI payload uses location for current time, or fromLocation, toLocation, and optional datetime for conversion.
Commands
Input Conventions
The CLI accepts request bodies in two forms:
Inline JSON:
JSON file:
Use @file.json when the payload is long, reused across runs, or needs review in version control.
Broadcast Example: Quote First, Do Not Auto-Send
The broadcast domain is a good example of why the CLI should stay recommend-first.
As of May 1, 2026, broadcast.message.quote is live, while broadcast.message.send remains intentionally gated because one live execute would create a real public post and the latest observed send challenge was about $40.96.
Translation Example: Pin DeepL Rephrase
DeepL text rephrase is live after the May 5, 2026 paid route-by-route retest. Inspect route context first so the CLI payload uses DeepL Write fields instead of translate-only fields.
Models Example: Pin DeepSeek Chat Completion
DeepSeek model inference is live through models.chat.complete.deepseek.mpp, models.code.complete.deepseek.mpp, and models.list.deepseek.mpp after the May 5, 2026 production-mode smoke. Inspect route context first so the CLI payload uses a supported model id such as deepseek-v4-flash.
Text Analysis Example: Recommend Before Execute
text.analyze.diffbot-nl.mpp is mapped and recommendable through Diffbot NL, but it is not live for execution yet. May 5, 2026 direct wrapper checks returned HTTP 429 before payment, so use CLI recommend and route context only until canExecuteNow is true and paid smoke evidence exists.
Web And Enrichment Example: Pin Diffbot Routes
Diffbot web extraction and Diffbot KG enrichment are live after the May 5, 2026 route-by-route retest. Inspect route context first, then pin the route when the operator wants that concrete Diffbot path.
Travel Example: Pin FlightAPI Airport Operations
Inspect the route context first:
Then execute the live FlightAPI route explicitly:
FlightAPI airport operations passed a May 8, 2026 production smoke after the backend gate was removed. If a future wrapper error appears, treat it as route-test evidence to reconcile against the live catalog rather than as a static docs rule.
When To Use CLI vs Other Surfaces
Use SDK when you are building direct application integrations in code.
Use SKILL.md when another coding agent should read instructions and make HTTP calls itself.
Use MCP when the runtime is MCP-compatible and you want hosted tools instead of shell commands.