cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
$ brew install cloc$ sudo apt install cloc$ sudo dnf install cloc$ sudo pacman -S cloc$ winget install AlDanial.Cloc$ scoop install cloc
cloc ("Count Lines of Code") is a command-line utility written in Perl that counts blank lines, comment lines, and physical lines of source code across hundreds of programming languages.
Key features include:
Broad Support: It recognizes and parses code stats for a vast array of languages, handling differences in single-line and multi-line comment styles automatically.
Flexible Inputs: It can analyze individual source files, entire directories, specific git commits/repositories, and compressed archive formats (like .zip, .tar.gz, .deb, .rpm, or .whl files).
Code Differences: It can compare two versions of a codebase to compute the delta in blank lines, comments, and actual code.
Portability: Written in pure Perl with minimal external dependencies, it runs across Linux, macOS, BSD variants, and Windows (where standalone compiled .exe binaries are also available).
Maintain cloc? Add this badge to your README: listings that link back are marked verified and ranked first in the directory. It's checked once a day.
[](https://cli.masoko.net/tools/cloc/)<a href="https://cli.masoko.net/tools/cloc/"><img src="https://cli.masoko.net/badge/cloc.svg" alt="cloc on The Terminal Index"></a>to comment.
Count your code, quickly.
Run your GitHub Actions locally 🚀
dev tools, env vars, task runner
A command-line benchmarking tool
Fast and simple Node.js version manager, built in Rust
a structural diff that understands syntax 🟥🟩