TokenLens – A CLI tool to check token usage for Cursor and other AI providers.

This is a submission for the DEV Weekend Challenge: Community

The Community

If you’re like me, you don’t use just one AI tool.

One day it’s Cursor. Then you hop into Codex. Then you try Gemini Code Assist. Each one has its own idea of:

“usage”

“limits”

“reset time”

“where the dashboard even is”

And the worst part, you usually notice you’re out of quota only when you’re already in the middle of building something.

TokenLens is for devs who bounce between multiple AI providers and just want one quick answer: “How much do I have left, and when does it reset?”

No dashboards. No clicking around. Just one terminal command.

What I Built

TokenLens is a CLI that shows usage and limits for Cursor, Codex, and Gemini in one terminal view.

Run:

  • tlens status

…and you’ll see usage, limits, and reset dates for:

  • Cursor — Pro/Fast request usage + reset date (pulled from browser cookies)
  • Codex — session (5h), weekly usage, credits (from ~/.codex/auth.json + usage endpoint)
  • Gemini Code Assist — Pro + Flash usage + reset dates (via CLI OAuth + Code Assist APIs)

It also supports an optional config setup (like storing a Copilot token), and you can install it via:

  • Homebrew: brew tap ctzeero/tap && brew install tokenlens
  • build from source
  • standalone binary (so you don’t need Node installed)

Demo

Terminal screenshot showing TokenLens v0.1.0 checking providers and displaying usage for Cursor Free, Codex Plus, and Gemini Code Assist (Pro/Flash) with percent used and reset dates

Code

Repo: https://github.com/ctzeero/tokenlens

Why I Built It (the real reason)

I kept hitting the same cycle:

  1. Use Cursor
  2. Switch to another tool for a specific task
  3. Suddenly get rate-limited or hit a cap
  4. Spend time hunting through dashboards and settings pages
  5. Realize the reset was “tomorrow” and I could’ve planned better 😅

TokenLens is my attempt to make “usage awareness” effortless, its basically git status for your AI limits.

  • TypeScript + Node.js for the CLI
  • Commander for subcommands (status, config, providers)
  • pkg to ship standalone binaries (Node bundled, so users don’t need a Node install)
  • Interactive setup: inquirer
  • Terminal UI: chalk + a tiny ASCII banner

Reading usage sources

How it works under the hood

  • Cursor usage: reads browser cookie DBs (Chrome/Arc/Edge/Safari/Firefox) via sql.js.
  • Codex + Gemini: reads auth files + uses OAuth auto-refresh.
  • Config storage: Local settings + optional saved tokens (e.g., Copilot) stored via conf in `~/.config/tokenlens.

What’s Next

A few ideas I want to explore next:

  • add more providers (Claude, OpenAI Platform usage, etc.)
  • exporting JSON so usage data can be fed into dashboards or custom scripts

Thanks for reading!

Thanks for checking out TokenLens If this tool makes your dev life easier, feel free to drop by the repo, share feedback, or suggest your favorite AI tool you’d like to see supported next!

Leave a Reply