Skip to content
ProductAugust 4, 2026

Bring your CommandCode credential to AnyRouter

The CLI now reads your local CommandCode auth file and uploads it as a BYOK key — one command, no copy-paste.

One more provider, one more credential

CommandCode is a coding agent that stores its auth locally in ~/.commandcode/auth.json. You can now add that credential to AnyRouter as a BYOK key — the same Bring Your Own Key model that already covers 60+ providers here — and route your own CommandCode-backed traffic through the same OpenAI-compatible endpoint you use for everything else.

The CLI reads the file directly, shows you exactly what it found, and uploads it only when you confirm. No copy-paste, no clipboard dance, no manual JSON parsing.

Find it, review it

On the machine where CommandCode is installed:

anyr byok locate commandcode

That scans the standard CommandCode auth location (~/.commandcode/auth.json), prints a masked (last-4) preview, and makes zero network calls. If the file is missing or unreadable, it tells you exactly where it looked so you can troubleshoot.

Add it — nothing happens without --yes

To actually upload it as a BYOK key:

anyr byok add commandcode --yes

Run it without --yes first and it's a dry run: same file, same masked preview, a plain description of exactly what will happen (the value gets encrypted and stored under a CommandCode key, your own future requests route through it, billed to your own CommandCode account) — and nothing is sent anywhere. Add --yes once you've read that and you're sure.

It behaves like any other BYOK key from there: encrypted at rest, routes your own requests through your own credential, and AnyRouter never charges credits for BYOK traffic.

Auto-skip if already synced

If you've already uploaded your CommandCode credential, the CLI detects it and skips the upload silently:

A CommandCode BYOK key already exists (id: byok_abc123). Skipping upload.

No duplicate keys, no error, no manual cleanup. Re-run without --yes for a dry run, or use the dashboard to manage your existing key.

Pool donation

Adding a key never donates it. Donating it to the shared pool takes two explicit flags together:

anyr byok add commandcode --yes --donate --donate-yes

--donate alone shows you the donor consent text and stops there — you have to also pass --donate-yes to actually confirm it and donate. The same toggle is available from the dashboard at any time, with the same consent screen, and you can withdraw a donated key whenever you want.

One honest caveat

CommandCode's auth file contains a long-lived API key (not a short-lived OAuth token), so your uploaded copy won't expire on its own. But if you re-authenticate with cmd login, the new key won't sync to AnyRouter automatically — you'll need to re-run the add command to pick up the fresh credential.

We'd rather tell you that up front than have it surprise you mid-session.

Route your first request in 2 minutes

Start free with your own keys, or top up and pay per token. Get $4/mo in credits and free models on Go — $2/mo, or free when you donate a provider key.

Start free