← Back to docs
Docs / Reference

Commands & configuration

Every command, setting, CLI flag, and environment variable TokenBeaver understands — across both surfaces (the VS Code extension and the standalone gateway CLI) and the localhost Settings page they share.

Two surfaces, one gateway

The VS Code extension and the CLI (@tokenbeaver/gateway) both drive the exact same local gateway. Its base URL is always http://127.0.0.1:4505/v1 (port 4505 by default). Use whichever surface fits how you work — the settings that matter for optimization live in one shared place.

CLI

Terminal, scripts, CI

npm i -g @tokenbeaver/gateway tokenbeaver-gateway

Same gateway and dashboard as the extension, driven from your shell. See Gateway CLI and environment variables.

VS Code extension

Status bar & Command Palette

Install tokenbeaver.tokenbeaver. See Command Palette and VS Code settings.

Where engine settings live

Optimization settings — provider, port, the compaction/output toggles, tool budgets — are not VS Code settings. They live on the localhost Settings page (open with --settings or TokenBeaver: Settings) and are shared across both surfaces via config.json. See the Settings page section below.

VS Code Command Palette

Open the Command Palette with Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) and type "TokenBeaver" to see all of these.

Command IDPalette title
tokenbeaver.openSettingsTokenBeaver: Settings
tokenbeaver.openAccountTokenBeaver: Account
tokenbeaver.openHelpTokenBeaver: Help & Setup
tokenbeaver.openFeedbackTokenBeaver: Feedback & Support
tokenbeaver.enterLicenseTokenBeaver: Activate or Upgrade to Pro
tokenbeaver.showStatusInfoTokenBeaver: Show Status Info
tokenbeaver.copyShareSnippetTokenBeaver: Copy Shareable Savings
tokenbeaver.openDashboardTokenBeaver: Open Cost Dashboard
tokenbeaver.gateway.startTokenBeaver: Start Gateway
tokenbeaver.gateway.stopTokenBeaver: Stop Gateway
tokenbeaver.gateway.copyBaseUrlTokenBeaver: Copy Gateway Base URL
tokenbeaver.gateway.statusTokenBeaver: Gateway Status
tokenbeaver.gateway.setupTokenBeaver: Agent Setup Instructions
tokenbeaver.claudeCode.repairHooksTokenBeaver: Repair Claude Code Hooks
tokenbeaver.openBillingPortalTokenBeaver: Manage Subscription

The status bar shows one item — ⚡ TokenBeaver — that opens the dashboard on click and displays your plan: Free, Pro, or Dev.

VS Code settings

Only these live in VS Code (search "tokenbeaver" in Settings, or edit settings.json). Everything about optimization lives on the Settings page instead.

SettingDefaultWhat it does
tokenbeaver.workerUrl"" → api.tokenbeaver.aiBackend URL for licensing / billing
tokenbeaver.gateway.autoStarttrueStart or attach the gateway when VS Code opens
tokenbeaver.notifications.planAlertstrueOccasional plan notifications
tokenbeaver.urls.feedbacktokenbeaver.ai/feedbackTarget for the Feedback & Support command
tokenbeaver.legal.termsUrl / .privacyUrl/terms · /privacyLegal links used in the UI
Engine settings moved

Provider, port, the optimization toggles and tool budgets are no longer VS Code settings — they're on the localhost Settings page, shared across the extension and CLI. This keeps one source of truth no matter which surface you started the gateway from.

Gateway CLI

The standalone gateway runs anywhere Node runs — same gateway and dashboard as the extension. Install with npm i -g @tokenbeaver/gateway.

CommandWhat it does
Setup
tokenbeaver-gatewayStart the gateway; the first run asks for Terms consent and your use case
--accept-termsAccept Terms + Privacy non-interactively (enables optimization) — for scripts / CI
--dashboardOpen the savings dashboard (http://127.0.0.1:4505/)
--accountOpen the Account page (/account)
--settingsOpen the Settings page (/settings)
--help-pageOpen the Help & Setup page (/help) with live checks
--statusShow plan, consent, persona, and lifetime savings
--install-claude-hooksWire Claude Code — hooks + the MCP restore tool
--uninstall-claude-hooksRemove TokenBeaver hooks from Claude Code
--autostart <install|remove|status>Manage launch-at-login
Account
--activate <token>Activate Pro with an activation token
--upgradeOpen checkout to upgrade to Pro
--activate-emailRecover Pro on a new machine via your purchase email
Metrics
--reportPrint the lifetime + per-session savings report
--reset-metricsReset all recorded metrics
--helpShow help

Environment variables

Environment variables configure the standalone gateway process. Precedence is env > config.json > default — an env var wins over a Settings-page value.

Env varDefaultWhat it does
TOKENBEAVER_GATEWAY_PORT4505Listen port
TOKENBEAVER_GATEWAY_PORT_STRATEGYauto-detectedstrict (fail if busy) · auto (scan for free port) · reuse (attach to existing gateway)
TOKENBEAVER_PROVIDERopenrouterUpstream provider (openrouter / openai / anthropic / custom / copilot)
TOKENBEAVER_UPSTREAM_BASE_URL—Explicit upstream base URL (required for custom)
TOKENBEAVER_ANTHROPIC_UPSTREAM_BASE_URL—Anthropic upstream for dual-upstream — routes /v1/messages
TOKENBEAVER_TIMEOUT_MS60000Upstream request timeout
TOKENBEAVER_ACCEPT_TERMS—1 accepts the Terms non-interactively
TOKENBEAVER_USECASEasked on first runcost · capacity · both
TOKENBEAVER_READ_DEDUPonoff stops skipping re-sends of unchanged file reads
TOKENBEAVER_STRUCTURAL_COMPACTIONonoff turns off structural slimming of context
TOKENBEAVER_RECOVERABLEonoff turns off on-demand restore of slimmed content
TOKENBEAVER_LEAN_OUTPUToffon slims tool output — nothing lost, restorable on demand
TOKENBEAVER_CODE_COMPACTION_ENABLEDtruefalse sends code-like content untouched
TOKENBEAVER_TOOL_BUDGETSper-tool capsOverride per-tool output caps, e.g. bash:100,grep:50
TOKENBEAVER_TELEMETRY_DISABLED—1 turns off pseudonymous usage telemetry

The localhost Settings page

Open it with tokenbeaver-gateway --settings or TokenBeaver: Settings. It's the shared home for optimization toggles — changes are saved to config.json and apply to both surfaces. Some optimizations are always-on internals and aren't exposed as switches; the "Settings page?" column says which you can toggle there.

FeatureDefaultEnv varOn Settings page?
Read dedupONTOKENBEAVER_READ_DEDUPNo — always-on internal
Structural compactionONTOKENBEAVER_STRUCTURAL_COMPACTIONNo
Recoverable compactionONTOKENBEAVER_RECOVERABLENo — gates the MCP restore tool
Lean outputOFFTOKENBEAVER_LEAN_OUTPUTYes
Code foldingONTOKENBEAVER_CODE_COMPACTION_ENABLEDYes
Tool line budgetsbaked capsTOKENBEAVER_TOOL_BUDGETSYes
Telemetry opt-outopted-INTOKENBEAVER_TELEMETRY_DISABLEDYes
The env: badge

When an environment variable is set for a toggle, the Settings page shows an env: badge on that field and the env value wins — that's the env > config.json > default precedence in action. Unset the variable to edit the value from the page again. Provider changes are restart-required.

Found a bug or have a feature request?

Open a GitHub issue →  ·  Questions? Support

Something missing or unclear?

Email [email protected] or visit the support page — a real developer will get back to you.