tokei analyzes source code and reports file counts, lines of code, comments, and blank lines by language.
It is useful for obtaining a quick quantitative overview of a repository.
The tool is installed through Homebrew and declared in the project Brewfile.
It is part of the curated Homebrew environment; see Homebrew setup to install everything at once.
Install tokei directly:
brew install tokeiVerify the installation:
tokei --version
brew list --formula | grep -x tokeiAnalyze the current directory:
tokei .Analyze a specific project:
tokei ~/Documents/Projects/my-projectDisplay the files included in the analysis:
tokei --files .Generated files and dependencies can distort the result.
Exclude common project directories:
tokei \
--exclude '.git' \
--exclude 'vendor' \
--exclude 'node_modules' \
--exclude 'var' \
.For a Symfony project, excluding vendor and var is especially important.
Display the result as JSON:
tokei --output json .Display the result as YAML:
tokei --output yaml .Structured output can be used in scripts, reports, or automated checks.
tokei is useful for:
- tracking project growth over time;
- comparing branches or project versions;
- detecting unexpectedly large generated directories.
Line counts measure size, not quality — treat them as a rough indicator.
tokei is read-only.
It scans files and reports statistics without modifying the repository.
Be careful when exporting or sharing results from private projects because language distribution and file structure can reveal implementation details.
Display all options:
tokei --helpConfirm the executable path:
command -v tokeiIf the result includes unwanted generated files, add explicit exclusions:
tokei --exclude 'path-to-ignore' .Remove tokei with Homebrew:
brew uninstall tokeiThen remove its entry from profiles/full/Brewfile.
