Features
200+ Languages
Tokei recognizes TypeScript, Python, Rust, Go, Java, C++, Ruby, Swift, Kotlin, SQL, Markdown, YAML, and 190+ more.
Output Formats
tokei --output json # JSON for CI/dashboards
tokei --output yaml # YAML
tokei --output cbor # Binary formatSorting & Filtering
tokei --sort code # Sort by lines of code
tokei --sort comments # Sort by comments
tokei -e node_modules -e dist # Exclude directories
tokei -t TypeScript,Python # Only specific languagesPer-File Breakdown
tokei --files
# Shows line counts per individual fileGit Integration
# Count only files tracked by git
tokei $(git ls-files)
# Compare branches
diff <(git stash && tokei --output json) <(git stash pop && tokei --output json)Performance
Written in Rust — counts millions of lines in seconds:
Linux kernel (28M lines): 1.2 seconds
Chromium (35M lines): 1.8 seconds
Small project (10K lines): 0.01 secondsAI Context Use Case
# Feed codebase stats to your AI agent
tokei --output json | claude "Analyze this codebase breakdown and suggest where to focus refactoring"Key Stats
- 12,000+ GitHub stars
- 200+ languages supported
- Written in Rust (instant results)
- JSON/YAML output for CI
- Respects .gitignore
FAQ
Q: What is Tokei? A: Tokei is a Rust-powered tool that instantly counts lines of code, comments, and blanks across 200+ programming languages.
Q: Is Tokei free? A: Yes, open-source under MIT/Apache 2.0 license.
Q: How does Tokei compare to cloc? A: Tokei is 5-10x faster than cloc and handles modern languages better. Both produce similar output.