← Back to tools
View AGENTS.md for tokei
tokei
Count your code quickly and accurately by language
Description
tokei is a fast code statistics tool that counts lines of code, comments, and blanks grouped by language. It supports over 150 languages and is significantly faster than alternatives like cloc.
Install
homebrew
brew install tokeicargo
cargo install tokeipacman
sudo pacman -S tokeiAI Summary
A fast code statistics tool. Counts lines of code, comments, and blanks grouped by programming language with support for 150+ languages.
Capabilities
- + Counts code, comments, and blank lines by language
- + Supports 150+ programming languages
- + Very fast, even on large codebases
- + Output in multiple formats (JSON, YAML, CBOR)
Use When
- → Getting an overview of a codebase's language composition
- → Tracking code size metrics over time
- → Need a fast alternative to cloc
Avoid When
- x Need detailed per-function or per-class metrics
Usage Patterns
Count lines in current project
tokei Shows a table of languages, files, lines, code, comments, and blanks
Output as JSON
tokei -o json Machine-readable JSON output for further processing
Input / Output
stdout: Table or structured output of code statistics
Exit codes:
0 Success