TokenSaver CLI — route AI agents (Claude Code, Cursor, Codex) through the SaaS control plane
Project description
TokenSaver CLI (tokensaver-cli)
Console command tokensaver to route AI agents through the TokenSaver SaaS control plane (api.tokensaver.fr) — 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 servers.
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
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 (~/.claude/settings.json + .mcp.json) |
tokensaver route claude --launch |
Configure + start claude |
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 |
Check API key and SaaS endpoint reachability |
SaaS defaults (no local server)
| 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 |
Override with TOKENSAVER_API_URL, TOKENSAVER_MCP_URL, etc. if you use a private deployment.
Environment
export TOKENSAVER_API_KEY=ts_… # required
# optional scope for MCP gateway headers:
export X-Organisation-ID=…
export X-Workspace-ID=…
Related packages
| PyPI package | Role |
|---|---|
tokensaver-cli |
This package — tokensaver route / doctor |
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
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.1.2.tar.gz.
File metadata
- Download URL: tokensaver_cli-0.1.2.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac794c0e74641c1a2d0d0b945fd8357d7aca1fd4d803faf33550bc902ed33406
|
|
| MD5 |
7d0963e0cfc9a7c08ff616d7e529a794
|
|
| BLAKE2b-256 |
76250e9d5c1e0820314a6fda50088085475a36e6421fc92679e77eb5bbf00a8b
|
File details
Details for the file tokensaver_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tokensaver_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea7861be5dd86a136d3e3d428134d0ae1e836f575d145bccc71854c11cea2b55
|
|
| MD5 |
21a44376b6c8b40376b4e1b01252f39c
|
|
| BLAKE2b-256 |
a825efeb8ef2c222fabb3042d29010aa38946c1f309962de634f7b230eebe034
|