tokei Plugin
Count your code quickly. Fast code statistics for 150+ languages.
Commands
Count
tokei count run— Count code statisticstokei count files— Count with individual file statstokei count json— Output as JSON
Usage Examples
- "Count lines of code in this directory"
- "Get code statistics as JSON"
- "Show per-file statistics"
Installation
cargo install tokei
# or
brew install tokei
Examples
# Basic count
tokei .
# Count specific path
tokei ./src
# With file details
tokei --files ./src
# JSON output
tokei --output json ./src
# Sort by code lines
tokei --sort code ./src
# Exclude patterns
tokei ./src --exclude *.test.*
Output Columns
- Files — number of files
- Lines — total lines
- Code — lines of code
- Comments — lines of comments
- Blanks — blank lines
Key Features
- Supports 150+ languages
- Respects .gitignore
- Multiple output formats (text, JSON, YAML, CBOR)
- Very fast (millions of lines in seconds)
- Accurate multi-line comment handling