BHARATROUTER CODE
Code with a governed agent on GLM — in one command.
brcode is a Codex-/Claude-Code-style coding agent that runs on GLMthrough BharatRouter. One br- key; the GLM provider key stays BYOK on the platform. Bundles the open-source OpenCode engine. Full reference: the brcode guide — commands, shortcuts, sandbox, identity & budgets. Switching tools? Migrate from Codex · from Claude Code.
Install
Homebrew (macOS / Linux):
brew install bharatrouter/tap/brcodeOr one line (no Homebrew):
curl -fsSL https://bharatrouter.com/install/brcode.sh | bashGet coding
brcode login # sign in — zero-paste browser login
brcode init # engine + your org profile (model, MCP connectors, rules)
brcode # start the agentA teammate is coding in two commands — brcode login && brcode init — and inherits your org's default model, MCP connectors, and rules. Repo-local AGENTS.mdstill travels with git clone, exactly like Codex.
Already have a favourite CLI?
One line each — zero-paste browser sign-in, pick any model your account can route (Kimi, GLM, Llama, Qwen, …), start coding. Preselect with BR_MODEL=<id>.
Claude Code (via the brcode launcher):
curl -fsSL https://bharatrouter.com/install/claude.sh | bashClaude Code, native — no launcher: the gateway lives in~/.claude/settings.json, with /br-models + /br-usageslash commands and the BharatRouter MCP server registered in-session; switch models with Claude Code's own /model <id>:
curl -fsSL https://bharatrouter.com/install/claude-native.sh | bashCodex CLI (OpenAI's open-source CLI, served by the gateway's Responses API):
curl -fsSL https://bharatrouter.com/install/codex.sh | bashKimi preset: install/claude-kimi.sh. Kimi & other BYOK-only models need your provider key saved once on thedashboard — it never lands on your machine.
What you get
- One-command handover — model + MCP connectors + rules served per-org (
/v1/me/profile), pulled oninit. - Zero-paste login — browser loopback OAuth; the key wires into your shell.
- Six harnesses, one key —
brcode(OpenCode),brcode claude,brcode aider,brcode goose,brcode crush,brcode qwen— all through the same gateway. Pick your default model withbrcode model; share repo context across all of them withbrcode memory. - Hooks (Claude-Code-style) —
PreToolUserules can block a tool;PostToolUseruns after (audit, auto-format). Edit~/.config/opencode/hooks.json. - In-agent commands —
/login,/doctor,/brprofile. - Org spend & audit —
brcode usageshows requests/tokens/₹ spend; every call is metered, budgeted, and audited on your key. - Agent identity & budgets —
brcode identity ongives each machine its own revocable identity with per-agent ₹ attribution;brcode identity budget 500caps what it can spend a month. - Sandbox —
brcode sandbox onscopes the agent to your project (outside paths ask,sudo/rm -rf ~denied);strictadds a macOS OS-level write-jail — the engine physically cannot write outside the project and its own caches. - Governed & India-routed — one key, spend caps, data residency — around the coding agent.
Not affiliated with OpenAI ("Codex") or Anthropic ("Claude Code" / "Claude"). Built on OpenCode (MIT). Aider, Goose, Crush and Qwen Code are independent open-source projects — brcode launches your installed copy, routed through BharatRouter. See the API reference.