tokei
CLICount lines of code across projects, by language.
Count lines of code by language with statistics
Recipes
Curated from documentation and usage. Percentages are estimates, not measurements.
Count lines of code in current directory
tokei .Count excluding specific paths
tokei . --exclude node_modules --exclude distCommon failures (1)
- --exclude appears to have no effecttokei takes one glob per --exclude; repeat the flag instead of passing a comma-separated list
Output as JSON
tokei . -o jsonInstall
Homebrew
brew install tokeiCargo
cargo install tokeiAgent notes
- When to use
- Analyzing codebase size and language composition
- Quick examples
tokeitokei src/ --exclude '*.json'
Use from an agent
curl -s https://clihub.com/api/tools/tokei | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug tokei on the MCP server at https://clihub.com/mcp.