Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

arcli

Point your AI coding tools at AgentRouter — one command, no hand-editing config files.

Supports Claude Code CLI (Anthropic protocol), Codex CLI (OpenAI protocol), and Claude Desktop (Cowork). The model list is fetched live from the gateway, so you always pick from models your key can actually reach — the menu is filtered per app by the gateway's own supported_endpoint_types.

Install

npm install -g @0xtrail/arcli

Requires Node.js 22 or newer. The package is scoped, but the command you type is just arcli.

Use

arcli

You will be asked for your API key once — grab one at https://agentrouter.org/console/token and paste it in. The key is verified against the gateway before anything is stored, so a typo fails fast with nothing written. Then a menu opens:

 █████╗ ██████╗
██╔══██╗██╔══██╗
███████║██████╔╝
██╔══██║██╔══██╗
██║  ██║██║  ██║
╚═╝  ╚═╝╚═╝  ╚═╝
point your AI coding tools at AgentRouter

API key ····kt5y
────────────────────────────────────────────

What would you like to do?

❯ Install to apps
  Restore originals
  View status
  Log out
  Quit

↑↓ navigate · enter confirm · esc cancel
  • Install to apps — pick an app, pick from your live model list, done. If the model list can't be reached (offline, gateway hiccup), you type the model name instead — setup never strands you.
  • Restore originals — restores your original configs, byte for byte (checksum-verified backups, including deleting files that didn't exist before).
  • View status — which apps are currently using AgentRouter.
  • Log out — deletes the stored API key. Your apps keep pointing at AgentRouter until you choose Restore originals.

What setup writes

Claude Code (~/.claude/settings.json, env block) — bare origin on purpose, because the Anthropic SDK appends /v1/messages itself:

ANTHROPIC_BASE_URL=https://agentrouter.org
ANTHROPIC_AUTH_TOKEN=<your key>
API_TIMEOUT_MS=600000
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
ANTHROPIC_DEFAULT_OPUS_MODEL=<your pick>
ANTHROPIC_DEFAULT_SONNET_MODEL=<your pick>
ANTHROPIC_DEFAULT_HAIKU_MODEL=<your pick>

Codex (~/.codex/config.toml + ~/.codex/auth.json) — full /v1 prefix on purpose, because Codex appends only /responses:

model = "gpt-5.6-sol"
model_provider = "agentrouter"

[model_providers.agentrouter]
name = "AgentRouter"
base_url = "https://agentrouter.org/v1"
wire_api = "responses"

Your configs are safe

Before writing anything, arcli backs up every file it will touch and verifies the backup with a checksum. Restore originals puts your original files back exactly as they were — including deleting files that didn't exist before.

If a write fails halfway, the old config is automatically restored before the command exits. A rejected or revoked API key is never written anywhere.

What's stored on your machine

~/.arcli/ holds:

  • config.json — your API key and gateway address (mode 0600, readable only by you)
  • backups/ — per-app config backups

Log out deletes the stored credentials. Your apps keep pointing at AgentRouter until you choose Restore originals.

Options

arcli --panel <url>    Use a gateway other than https://agentrouter.org
arcli --help           Show help

Piped or redirected output is automatically plain — no color, no screen control — so it's safe in scripts. NO_COLOR is also respected.

License

MIT

About

Point Claude Code, Codex, and Claude Desktop at AgentRouter — one command, live model list, byte-exact config backups

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors