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 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 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
- Integration:
docs/INTEGRATION-ROUTE-CLI.md - API reference: tokensaver.fr/sdk-api
Tests
cd packages/cli && pip install -e ".[dev]" && pytest -q
Publishing
See docs/PYPI-CLI-RELEASE.md. Tag: cli-vX.Y.Z.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tokensaver_cli-0.3.1.tar.gz.
File metadata
- Download URL: tokensaver_cli-0.3.1.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69fb038f3ca30db2045431ae0747dd9119e871e764188b8294373494bcf373d4
|
|
| MD5 |
97f5034ab9ad54dd936ee1f248f0392a
|
|
| BLAKE2b-256 |
42f9635e57edf2636af2c90766d29df669e8edb6441bacb4ea2b8de1185bdc71
|
File details
Details for the file tokensaver_cli-0.3.1-py3-none-any.whl.
File metadata
- Download URL: tokensaver_cli-0.3.1-py3-none-any.whl
- Upload date:
- Size: 37.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0029c9cffd748cbafe17119fd25c08cb4399a660a647a653c35092a40e9397cd
|
|
| MD5 |
5e0c25cc86ab1e9e81ed4dac94c50653
|
|
| BLAKE2b-256 |
39c1cbcd4363da91857fcec0a12a39f41b1342142490b25e6619b7b75e571be9
|