tokenolo
v0.1.0
Published
tokenolo — authenticated CLI for the tokenolo token-optimization API. Rewrites prompts to be token-cheaper while preserving intent and every constraint.
Maintainers
Readme
tokenolo
The tokenolo CLI for the tokenolo token-optimization service: send a prompt, get
back a shorter, token-cheaper version that preserves intent and every
constraint.
tokenolo paraphrase "Could you please, if it's not too much trouble, summarize this for me?"
# STDOUT: Summarize this.
# STDERR: saved 9 tokens, -60% (15 → 6, mode: balanced)This is the client.
tokenolotalks to a tokenolo backend (the server holds the upstream LLM key and does the rewrite). Point it at your server withTOKENOLO_API_URL(defaulthttp://localhost:8787). Running the backend is covered in the repo.
Install
npm i -g tokenolo # installs the `tokenolo` (and `tk`) commandRequires Node ≥ 20.
Commands
# Authenticate. Run bare to be prompted (hidden), or pipe the key via stdin
# (keeps it out of argv / shell history). The key is stored 0600 and never printed.
tokenolo login
echo "$TOKENOLO_KEY" | tokenolo login
# Who am I + remaining daily quota.
tokenolo whoami
# Paraphrase. Optimized prompt → stdout, savings summary → stderr (pipes cleanly).
tokenolo paraphrase "…"
echo "…" | tokenolo paraphrase # read prompt from stdin
tokenolo paraphrase --mode aggressive "…" # aggressive | balanced (default) | safe
tokenolo paraphrase --json "…" # full JSON response on stdout
# Forget the stored credential.
tokenolo logout--url <url> overrides the backend for any command; otherwise the URL resolves
as --url → TOKENOLO_API_URL → the URL stored at login → http://localhost:8787.
(tk still works as a short alias for every command.)
Security
The CLI only ever holds your scoped tk_live_… key (stored 0600 at
~/.config/tokenolo/credentials.json). The upstream LLM key lives only on the server
and is never shipped to the client. Keys are hashed at rest, rate-limited,
daily-token-capped, and instantly revocable.
Links
- Source & backend: https://github.com/merkhanov/tokenolo
- Issues: https://github.com/merkhanov/tokenolo/issues
License
MIT
