Automic VaultAutomic Vault

brew

Install loc with Homebrew

Count lines of code quickly. Version 0.4.1 via Homebrew; verified from local package data.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install loc

local Homebrew formula metadata

overview

Package summary

Count lines of code quickly

Commands and aliases

  • loc

history

Project history and usage

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.

Project history

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.

Adoption history

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.

How it is used

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.

Why package nerds care

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.

Timeline

  • 2016: The cgag/loc repository is created.
  • 2018: README note points users to tokei as a smarter and more accurate related Rust counter.
  • 2020s: loc remains available through Homebrew and source/release installation paths.

Related projects

  • cloc is the older Perl tool that loc explicitly reimplements for speed.
  • tokei is the related Rust code-counting tool that loc compares against and recommends checking for accuracy-sensitive work.

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 13 platform targets.
  • Build metadata lists 1 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
loccliglobal executable

freshness

Version and 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.

page generated2026-07-08
manager version0.4.1
manager updated
local dataok
upstreamcurrent
latest detectedv0.4.1

https://github.com/cgag/loc

  • infoNo package-manager update timestamp was available.low confidence

install metadata

Package metadata

Package keybrew:loc
Version0.4.1
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/loc
Homepagehttps://github.com/cgag/loc
Repositoryhttps://github.com/cgag/loc
Upstream docshttps://github.com/cgag/loc#readme
LicenseMIT
Source archivehttps://github.com/cgag/loc/archive/refs/tags/v0.4.1.tar.gz
Build dependenciesrust
Bottleavailable (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-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Nameloc
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • package relationship graph
  • package version freshness
  • package-page enrichment