Sloc is a command-line tool for counting source lines of code. It reads files one at a time and separates code lines from comment lines and blank lines, then totals the results for each programming language. It suits developers who want a quick size measure of a codebase from a terminal.
It is built on .NET and installed as a global dotnet tool. The source code is public under the MIT License, so it can be read, modified and reused. Based on the listing data, it runs on Windows.
Alternatives to Sloc
Products that do a similar job in Developer Tools.
tokei
command-line tool that counts lines of code by language
scc
command-line code counter with complexity and COCOMO estimates
fzf
Command-line fuzzy finder for lists of files, history and any text
lazygit
Terminal UI for running git commands with keyboard shortcuts
ripgrep
command-line search tool that finds regex matches across directory trees
Alacritty
GPU-accelerated terminal emulator for Linux, macOS, Windows and BSD
bat
command-line file viewer with syntax highlighting and git integration
GitHub CLI
Command line tool for working with GitHub from the terminal