Cette page est affichée en anglais. Une traduction française est en cours.
CLI ToolsMay 14, 2026·2 min de lecture

tokenu — du-like Token Counter for Repos

tokenu is a du-like CLI to measure token usage per file/dir for LLM context planning; verified 59★ with `npx tokenu .` and JSON output for agents.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 94/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Cli
Installation
Bundle
Confiance
Confiance : Established
Point d'entrée
npx tokenu .
Commande CLI universelle
npx tokrepo install 8c6f3a86-deb7-5e6a-9548-5cbb7d131834
Introduction

tokenu is a du-like CLI to measure token usage per file/dir for LLM context planning; verified 59★ with npx tokenu . and JSON output for agents.

Best for: Agent builders who need to budget context windows and avoid accidentally loading 40K-token folders

Works with: Node.js + npx/npm, agent pipelines that can read JSON output, hook-based pre-read guards

Setup time: 2-6 minutes

Key facts (verified)

  • GitHub: 59 stars · 1 forks · pushed 2026-05-13.
  • License: Apache-2.0 · owner avatar + repo URL verified via GitHub API.
  • README-backed entrypoint: npx tokenu ..

Main

  • Use it before feeding a repo into an agent: token counts show which folders (like dist/) will blow up your context budget.

  • Prefer --json for agent pipelines so the agent can plan what to read within a fixed token limit.

  • If token counts vary between models, use --model / --encoding to compare costs across tokenizers.

Source-backed notes

  • README shows a no-install quick start: npx tokenu ..
  • README documents JSON output for agent consumption: tokenu --json.
  • README lists encodings (o200k_base, cl100k_base, etc.) and flags like --max-depth and --exclude.

FAQ

  • Does tokenu reduce token usage automatically?: No — README says it measures token cost so you can decide what to exclude or summarize.
  • Can an agent use tokenu programmatically?: Yes — use tokenu --json so the agent can parse per-dir token counts.
  • Is it an estimate or real tokenization?: README says it uses actual tokenization via a tokenizer library, not heuristics.
🙏

Source et remerciements

Source: https://github.com/lirantal/tokenu > License: Apache-2.0 > GitHub stars: 59 · forks: 1

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires