macOS
brew install ohcountlocal Homebrew formula metadata
sudo port install ohcountMacPorts ports tree · textproc/ohcount/Portfile · source: api.github.com
brew
Source code line counter. Version 4.0.0 via Homebrew; verified from local package data.
install
brew install ohcountlocal Homebrew formula metadata
sudo port install ohcountMacPorts ports tree · textproc/ohcount/Portfile · source: api.github.com
sudo apt install ohcountDebian stable package indexes · ohcount · source: deb.debian.org
sudo zypper install ohcountopenSUSE Tumbleweed package metadata · ohcount · source: download.opensuse.org
overview
Source code line counter
history
Ohcount is the Ohloh/Open Hub source-code line counter: a C and Ragel based analyzer with a command-line tool and language-detection library for counting code, comment, and blank lines across source trees.
The project traces back to Ohloh, the open-source project directory and analytics site later associated with Black Duck and Open Hub. Its README says it was originally developed at Ohloh and used to generate the reports at www.openhub.net, which makes it part of the early package-statistics infrastructure rather than just a standalone `wc`-style utility.
The original GitHub source repository was created on 2008-06-09, and the Black Duck fork used by package managers was created on 2010-10-27. The Black Duck repository kept the Ohloh identity in its description while moving the maintained packaging-facing project under the Black Duck Software organization.
Ohcount's most important adoption story is Open Hub itself: the tool was used to generate Open Hub's source-code reports, giving it a role in public open-source metrics. It also reached mainstream Unix packaging through Homebrew, Debian, Ubuntu, MacPorts, and openSUSE-style distributions, but Homebrew analytics generated on 2026-07-01 showed a small niche user base: 49 installs over 365 days.
The package stayed interesting to distributors because it is not a single-language counter. The README describes a detector for primary language family, a parser for line-by-line breakdowns, support for multiple languages in one file, whole-directory counting, language-family file discovery, detailed source annotations, and Ruby bindings.
Developers and auditors use `ohcount` to count individual files or entire directory trees, identify source files by language family, and produce detailed annotations of a file's lines. Its ability to split mixed files, such as HTML with CSS and JavaScript regions, made it more sophisticated than plain line counters.
Package builders care about its implementation details because the Homebrew formula depends on `libmagic`, `pcre2`, and `ragel`, and applies Debian patches for modern build and PCRE2 support. The README also documents Ruby 2.x test expectations, SWIG bindings, and an unsupported Python wrapper.
Ohcount is a package-nerd artifact because it helped produce package metadata about other projects. It sits in the same historical lane as SLOC counters and open-source forges: the tool is small, but the data it helped generate shaped how people compared projects by language mix and code size.
Its formula tells the story of aging infrastructure kept buildable through distro patches. The combination of Ragel-generated scanners, Ruby bindings, PCRE migration, and GPL-2.0-only licensing gives maintainers plenty of packaging surface area for a deceptively simple CLI.
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 |
|---|---|---|---|
ohcount | 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.
https://github.com/blackducksoftware/ohcount
install metadata
| Package key | brew:ohcount |
|---|---|
| Version | 4.0.0 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/ohcount |
| Homepage | https://github.com/blackducksoftware/ohcount |
| Repository | https://github.com/blackducksoftware/ohcount |
| Upstream docs | https://github.com/blackducksoftware/ohcount#readme |
| License | GPL-2.0-only |
| Source archive | https://github.com/blackducksoftware/ohcount/archive/refs/tags/4.0.0.tar.gz |
| Dependencies | libmagic, pcre2, ragel |
| Build dependencies | gperf |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | ohcount |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
ohcount 4.0.0-5
Source code line counter
https://github.com/blackducksoftware/ohcount
sudo apt install ohcountohcount-doc 4.0.0-5
Source code line counter - Documentation
https://github.com/blackducksoftware/ohcount
sudo apt install ohcount-docohcount 4.0.0-4build2
Source code line counter
https://github.com/blackducksoftware/ohcount
sudo apt install ohcountohcount-doc 4.0.0-4build2
Source code line counter - Documentation
https://github.com/blackducksoftware/ohcount
sudo apt install ohcount-docohcount 4.0.0-3.3
The Ohloh source code line counter
https://www.openhub.net/p/ohcount
sudo zypper install ohcountohcount
sudo port install ohcountsource 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.