Counting Lines of Code with cloc

cloc counts source lines of code across a project, separating code lines from comment lines and blank lines. For most reporting purposes - cost estimation, change tracking, and audits - only the code line count matters. Install it with Homebrew on macOS, APT on Debian/Ubuntu, or Chocolatey on Windows: brew install cloc # macOS sudo apt install cloc # Debian / Ubuntu choco install cloc # Windows Run it from the project root and exclude dependency and generated directories. Without exclusions, vendored libraries and build artifacts inflate the count. The directories to exclude depend on the ecosystem. ...

June 30, 2026