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 (Python API client). The CLI configures your local machine; the pipeline runs on TokenSaver (SaaS or local self-host).

Get started: sign up at platform.tokensaver.fr, create a ts_… API key, then:

pip install tokensaver-cli
export TOKENSAVER_API_KEY=ts_your_key
tokensaver route claude --launch
tokensaver doctor --claude

Installation

pip install tokensaver-cli

Development inside the monorepo:

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

Requirements: Python ≥ 3.10, no extra runtime dependencies (stdlib only).

Commands

Command Purpose
tokensaver route claude Configure Claude Code (settings + .mcp.json + plugin)
tokensaver route claude --launch Configure + start claude
tokensaver route claude --scope project --profile cheap --with-fs Project scope, cheap model, FS via Trust Gateway
tokensaver route cursor Write .cursor/mcp.json + print Override URL steps
tokensaver route codex Print OpenAI-compat env vars for Codex
tokensaver route proxy Show base URLs for LangChain / OpenAI SDK / your code
tokensaver unroute <target> Restore backed-up config
tokensaver doctor [--claude] [--local] Check endpoints (+ Claude end-to-end probes)
tokensaver status [--line|--hook] Route status + Flux IA console link
tokensaver profiles List cheap / default / strong model profiles

Claude Code options

Flag Effect
--scope user|project|local Settings file: ~/.claude/settings.json, .claude/settings.json, or .claude/settings.local.json
--model PROVIDER/ID Catalogue model id (sets ANTHROPIC_MODEL)
--profile cheap|default|strong Built-in (or custom) profile from ~/.config/tokensaver/route/profiles.json
--with-fs Stdio MCP: tokensaver-mcp-gateway + filesystem for cwd
--no-plugin Skip installing ~/.claude/skills/tokensaver-router
--local Force local self-host URL defaults

Slash commands after plugin install: /tokensaver-router:setup, :status, :pipeline, :model, :unroute.

SaaS defaults

Surface URL
API https://api.tokensaver.fr
OpenAI-compat https://api.tokensaver.fr/openai/v1
Anthropic-compat https://api.tokensaver.fr/anthropic
MCP tools https://mcp.tokensaver.fr/mcp
MCP gateway https://gateway.tokensaver.fr/mcp
Console / Flux IA https://platform.tokensaver.fr/dashboard?tab=flows

Local self-host

tokensaver route claude --local --with-fs --launch
# or: TOKENSAVER_MODE=local tokensaver route claude --launch
tokensaver doctor --claude --local

Defaults: API :8000, MCP :8787, gateway :8788, console :3000, optional HTTPS_PROXY egress :8888.

Environment

export TOKENSAVER_API_KEY=ts_…   # required
export TOKENSAVER_CONSOLE_URL=  # optional
export X-Organisation-ID=export X-Workspace-ID=

Related packages

PyPI package Role
tokensaver-cli This package — tokensaver route / doctor / status
tokensaver-sdk Python API client — TokenSaver(api_key=…).ask(…)

API reference (public): tokensaver.fr/sdk-api

Tests

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

Publishing to PyPI

Maintainers: see docs/PYPI-CLI-RELEASE.md.

Tag format: cli-vX.Y.Z (version in src/tokensaver_cli/__init__.py).

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.2.0.tar.gz (27.3 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.2.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tokensaver_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 27.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 de8278cc8cf9cfc6e91cacf5b3d9ab56291621c50a9f077ee3004d65c339184f
MD5 83f35a8f7dfe581cb07d165865b32be7
BLAKE2b-256 f59e1413e3126b25e6820f18bb6be21048a564034123509f7f52261b1e579752

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tokensaver_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdf3433b3e469cb61d11d1db614f57ac32b1e98e7785166cb6534d29ee066756
MD5 c5af4e9ed8bcf5dead58bc1fa533ad12
BLAKE2b-256 2b964c8365936e961055e32748849384a4ba0ed81dede7a646841a32bfb00f0c

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