Gemini CLI

Cut Your Gemini CLI Token Costs by 40–70%

Terse auto-detects Google's terminal coding agent, compresses every prompt before it reaches Gemini, and tracks per-turn cost at Gemini 2.5 Pro and Flash rates. So a 1M-token context window doesn't quietly drain your API budget. All on-device.

40–70%prompt compression
AutoGemini CLI detection
1Mcontext, watched per turn
0data leaves device

How Terse Works with Gemini CLI

Gemini CLI reads your repo, edits files, and runs commands agentically — and its context grows with every turn. With a 1M-token window, it's easy to send a quarter-million tokens without noticing. Terse compresses what you type and flags when the same files are being re-sent, so the accumulated context stays lean.

Terminal — Gemini CLI Session
Terse Active
$ gemini
Gemini CLI · model: gemini-2.5-pro · API key (AI Studio) · 1M context
● Terse detected Gemini CLI — monitoring (2.5 Pro · $1.25/M input · $10/M output)
> could you please go ahead and take a look at the whole repo and then refactor the paymnet handler to use the newer async retry pattern that we talked about, and also add some proper logging
Terse: 38 tokens → 15 tokens · "refactor payment handler to async retry pattern, add logging" · 60% reduction
Gemini reading: src/ (24 files) → context now 412,000 tokens
⚠ Terse: 412K tokens in context this turn ≈ $0.52 input — payment/handler.ts re-sent 3× unchanged
412Kturn context
$0.52input cost
60%prompt compressed
$0.58this turn

Auto Gemini CLI Detection

Terse scans running processes every 5 seconds. When Gemini CLI launches in your terminal, a floating monitor bar appears automatically — no setup, no config, no wrapper script. It picks up the model you're running, Pro or Flash.

Automatic
🗜️

Prompt Compression

Every instruction you type at the Gemini CLI prompt runs through Terse's 7-stage pipeline: typo correction, filler removal, hedge stripping, and phrase shortening. Code blocks and file paths pass through untouched.

7-Stage Pipeline
🪟

Large-Context & Redundant-Read Flagging

The 1M window means Gemini CLI can quietly re-send your whole repo each turn. Terse tracks the running context size and warns when a file is re-sent unchanged, so you can trim context before the per-turn input cost compounds.

Context Watchdog
💰

Model-Aware Cost Tracking

Terse knows whether Gemini CLI is on 2.5 Pro or 2.5 Flash and prices every turn at the correct input/output rate. On a paid API key, you see exactly what each turn of accumulated context is costing — in real time.

Per-Turn Visibility
📊

Session Cost Summary

At the end of each Gemini CLI session, Terse shows total tokens, total cost, and a breakdown of where they went — your prompts, file reads, and repeated context. Know exactly what drove the day's spend.

Session Analytics
🔒

100% On-Device

Terse reads your terminal input via OS Accessibility APIs and compresses locally with a Rust engine. No prompt text, no code, and no file contents are ever sent to Terse's servers — or to Google beyond what Gemini CLI already sends.

Zero Cloud

Supported Gemini CLI Models

Gemini CLI runs on Google's Gemini models by default, but Terse tracks token cost across every backend you might reach for. Pricing shown is per million tokens.

Gemini 2.5 Pro
$1.25/M input · $10/M output
Gemini 2.5 Flash
$0.075/M input · $0.30/M output
Claude Sonnet 4.5
$3/M input · $15/M output
Claude Opus 4
$15/M input · $75/M output
GPT-4o
$2.50/M input · $10/M output
Claude Haiku 4.5
$0.80/M input · $4/M output
Local (Ollama)
Token count monitoring · no cost tracking

Frequently Asked Questions

Everything about using Terse with Google's Gemini CLI.

Does Terse work with Gemini CLI automatically?
Yes. Terse scans running processes every 5 seconds. When Gemini CLI launches in your terminal, Terse detects it and activates a floating monitor bar. No configuration required — detection is automatic, and Terse picks up whether you're on Gemini 2.5 Pro or Flash.
Isn't a 1M-token context window a reason NOT to worry about tokens?
It's the opposite. Because Gemini CLI can hold your whole repo in context, it's easy to send hundreds of thousands of tokens every turn — and you pay for the full context on each call, not once. At $1.25/M input, a 400K context is $0.50 per turn before Gemini writes anything. Big windows make token discipline more important. Terse compresses prompts and flags when context is re-sent unchanged.
Gemini CLI has a free tier — do I actually pay per token?
On a personal Google sign-in, Gemini CLI's free tier is generous. But anyone on a Gemini API key via AI Studio or Vertex AI pays standard per-token rates. Terse is built for that group: once you're on a paid key, every accumulated turn of context is billable, and Terse shows the running cost so nothing surprises you at month end.
Does Terse send my Gemini CLI prompts to any server?
No. Terse is 100% on-device. It reads your terminal input via OS Accessibility APIs, compresses locally using a Rust engine, and writes the compressed text back to the input. Your prompts and code never leave your machine — Terse adds no cloud hop of its own.

Also Works With

Terse reduces token costs across every major AI coding tool.

Claude Code ⌨️ Cursor — AI Code Editor 🤖 GitHub Copilot — VS Code 🧩 Aider — Terminal Pair Programmer

Stop Burning Tokens on Verbose Prompts

30-day free trial. No credit card required until your trial ends. Tracks Gemini 2.5 Pro, Flash, Claude, GPT-4o, and local models.

Start Free Trial — macOS & Windows Calculate Your Savings