| Crates.io | tokencount |
| lib.rs | tokencount |
| version | 0.1.1 |
| created_at | 2025-09-16 16:14:11.1089+00 |
| updated_at | 2025-09-16 16:16:32.557438+00 |
| description | Parallel CLI that counts GPT-style tokens across your codebase |
| homepage | https://github.com/CharlonTank/tokencount |
| repository | https://github.com/CharlonTank/tokencount |
| max_upload_size | |
| id | 1841991 |
| size | 62,468 |
tokencount is a blazing-fast CLI for counting GPT-style tokens across your project. It walks your tree in parallel, respects .gitignore, and reports per-file counts with totals and percentiles so you can plan prompts, costs, and chunking strategies.
ignore crate with .gitignore respected by defaulttiktoken-rscargo install tokencount
Or install from source:
cargo install --path .
# default: scan current directory, include only *.elm
tokencount
# scan a project and include Elm + TypeScript files
tokencount ./frontend --include-ext elm --include-ext ts
# return the top 10 files by token count
tokencount --top 10
# emit JSON summary (great for CI)
tokencount --format json > tokens.json
# stream NDJSON for downstream processing
tokencount --format ndjson
# sort by token count descending
tokencount --sort tokens
Run tokencount --help for the full list of flags, including:
--include-ext / --exclude--max-bytes--encoding cl100k_base|o200k_base--format table|json|ndjson--top N--sort path|tokens--threads N--follow-symlinks--no-respect-gitignore-v/--verbose, -q/--quietcargo fmt
cargo clippy --all-targets --all-features -- -D warnings
cargo test
The project is dual-licensed under MIT or Apache-2.0.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tokencount by you shall be dual licensed as above, without any additional terms or conditions.