macOS
brew install loclocal Homebrew formula metadata
brew
Count lines of code quickly. Version 0.4.1 via Homebrew; verified from local package data.
install
brew install loclocal Homebrew formula metadata
overview
Count lines of code quickly
history
loc is a Rust command-line tool for quickly counting lines of code. Its README describes it as a Rust implementation of cloc focused on speed, reporting file, line, blank, comment, and code counts by language.
The cgag/loc GitHub repository was created in July 2016. The README positions loc directly against cloc and tokei, with old benchmark examples showing loc as much faster on large source trees, while also warning readers that tokei may be smarter or more accurate for some cases.
loc's adoption is concentrated among developers who want a fast one-shot codebase counter and are comfortable with Rust-built CLI tools. Official evidence points to GitHub interest, release binaries, cargo install, and a Homebrew package rather than a large ecosystem of integrations.
By default, loc counts the current directory or a target path and prints a language table with files, total lines, blank lines, comments, and code. It is used for quick repository sizing, comparing implementation-language mix, and sanity-checking source tree growth.
loc is significant in the package-manager catalog as part of the Rust rewrite wave of classic Unix developer tools: a narrow utility, fast startup, static-ish binaries, and simple install paths through cargo or Homebrew. Its README also records the healthy package-nerd humility of pointing users at tokei when accuracy matters more than raw speed.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
loc | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
install metadata
| Package key | brew:loc |
|---|---|
| Version | 0.4.1 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/loc |
| Homepage | https://github.com/cgag/loc |
| Repository | https://github.com/cgag/loc |
| Upstream docs | https://github.com/cgag/loc#readme |
| License | MIT |
| Source archive | https://github.com/cgag/loc/archive/refs/tags/v0.4.1.tar.gz |
| Build dependencies | rust |
| Bottle | available (on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | loc |
| Version Scheme | 0 |
| Revision | 0 |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.