Skip to main content

TokenSaver CLI — route AI agents (Claude Code, Cursor, Codex) through the control plane

Project description

TokenSaver CLI (tokensaver-cli)

Console command tokensaver to route AI agents through the TokenSaver control plane — cache, compression, PII, MCP gateway, observability.

Companion package to tokensaver-sdk.

Quick start (no dashboard required)

pip install -U tokensaver-cli
tokensaver login                 # signup or sign-in → saves credentials + ts_… key
tokensaver route claude --launch
tokensaver doctor --claude

Credentials live in ~/.config/tokensaver/credentials.json (mode 0600).
TOKENSAVER_API_KEY still overrides the file when set.

Installation

pip install tokensaver-cli

Monorepo:

cd packages/cli
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"

Requirements: Python ≥ 3.10, stdlib only.

Auth & keys

Command Purpose
tokensaver login Interactive signup/sign-in (Free plan + API key)
tokensaver login --email you@acme.com --signup -y Non-interactive signup
tokensaver login --key ts_… Import an existing key (no JWT)
tokensaver logout Remove local credentials
tokensaver whoami Email, plan, key prefix, Flux IA link
tokensaver approve [model] Approve model in Agent Registry (zero-trust)
tokensaver models List profiles + catalogue models
tokensaver use <profile|model> Set Claude model (sticky) + approve
tokensaver flows [--open] Flux IA URL + recent runs
tokensaver catalog … List / approve Agent Registry
tokensaver keys list List API keys
tokensaver keys create --name CLI --use Create key and set as default
tokensaver keys revoke <id> Delete a key

Routing

Command Purpose
tokensaver route claude [--launch] Configure Claude Code + plugin
tokensaver route claude --scope project --profile cheap --with-fs Project scope, cheap model, FS gateway
tokensaver route cursor / codex / proxy / mcp Other agents
tokensaver unroute <target> Restore backups
tokensaver doctor [--claude] [--local] Health checks
tokensaver status [--line|--hook] Route status + Flux IA
tokensaver profiles cheap / default / strong (plan-aware)
Claude plugin slash /tokensaver-router:models|use|flows|quota|cache|catalog|…

Claude Code options

Flag Effect
--scope user|project|local Settings file scope
--model / --profile Catalogue model or profile
--with-fs Trust Gateway + filesystem for cwd
--no-plugin Skip ~/.claude/skills/tokensaver-router
--local Self-host URL defaults

On Free, default profile uses openrouter/z-ai/glm-4.7-flash (allowlist). Paid keeps Sonnet/Opus. Plan is stored at login (plan_slug); refresh with tokensaver whoami.

Environment

export TOKENSAVER_API_KEY=ts_…   # optional if logged in
export TOKENSAVER_MODE=local     # or --local
export TOKENSAVER_PLAN=free      # optional override for Free defaults
export TOKENSAVER_CONSOLE_URL=

Docs

Tests

cd packages/cli && pip install -e ".[dev]" && pytest -q

Publishing

See docs/PYPI-CLI-RELEASE.md. Tag: cli-vX.Y.Z.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tokensaver_cli-0.3.4.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tokensaver_cli-0.3.4-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file tokensaver_cli-0.3.4.tar.gz.

File metadata

  • Download URL: tokensaver_cli-0.3.4.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tokensaver_cli-0.3.4.tar.gz
Algorithm Hash digest
SHA256 16dc093cac9f4771cb9fba2802265d1c8e92f59ac97fa3b5f560f3acd75c18a1
MD5 10f7192b723c7f2b72e33513e463436c
BLAKE2b-256 9cb78402b490e28b8421c66d08a1ce526c1e24e315ab98b98a67d5a75c8fdc27

See more details on using hashes here.

File details

Details for the file tokensaver_cli-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: tokensaver_cli-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 53.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tokensaver_cli-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cacc4f4e780a55811baab7f0bdd685b04bb1c4e02ce2d828a09e339a41770bc5
MD5 e87c7b15ccad8a7459a6d507e9b253a5
BLAKE2b-256 72263a4a50dab3761d80ff2640c582fef835c1bc17020d226840a4d9b120e14c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page