CommandCross-platform

Scribe's Tally

Count Lines of Code by Language

Analyzes a codebase and reports line counts broken down by programming language, excluding blank lines and comments. Useful for project metrics and documentation.

cloc --exclude-dir=node_modules,vendor,dist,.git .

Usage Notes

  • Automatically detects languages by file extension
  • --by-file shows counts for each individual file
  • --json or --yaml for machine-readable output
  • --diff compares two codebases or commits
  • Alternative: tokei is faster for large repositories
  • Install: brew install cloc or apt install cloc

Warnings

None

Related Scroll Ideas

  • • Compare line counts between git branches
  • • Generate code statistics report as JSON
  • • Exclude test files from count