Count lines of code quickly - displays statistics about code in a directory.
Tokei is a fast and accurate code statistics tool that analyzes your codebase to provide detailed metrics about lines of code, comments, and blank lines across different programming languages. It displays this information in a clean, organized table format grouped by language, making it easy to understand the composition and size of your projects at a glance.
The tool excels in both speed and accuracy, capable of counting millions of lines of code in seconds while correctly handling complex scenarios like multi-line comments, nested comments, and comments within strings. Tokei supports over 150 programming languages and can output results in multiple formats including JSON, YAML, and CBOR for integration with other tools and workflows.
Tokei is designed for developers, project managers, and teams who need to analyze codebases for metrics, reporting, or project assessment. It respects .gitignore files and offers flexible filtering options, making it suitable for both quick local analysis and integration into CI/CD pipelines. The tool is available as both a standalone CLI application and a library for programmatic use.
# via Homebrew
brew install tokei
# via Cargo
cargo install tokei
# via APT (Ubuntu/Debian)
sudo apt install tokei