macOS
brew install cloclocal Homebrew formula metadata
sudo port install clocMacPorts ports tree · textproc/cloc/Portfile · 来源: api.github.com
安装
brew install cloclocal Homebrew formula metadata
sudo port install clocMacPorts ports tree · textproc/cloc/Portfile · 来源: api.github.com
sudo apk add clocAlpine Linux edge package indexes · cloc · 来源: dl-cdn.alpinelinux.org
sudo dnf install clocFedora Rawhide package metadata · cloc · 来源: dl.fedoraproject.org
nix profile install nixpkgs#clocnixpkgs package indexes · pkgs/by-name/cl/cloc/package.nix · 来源: api.github.com
sudo pacman -S clocArch Linux sync databases · cloc · 来源: geo.mirror.pkgbuild.com
choco install CLOCChocolatey community package catalog · CLOC · 来源: community.chocolatey.org
scoop install main/clocScoop official bucket manifest trees · bucket/cloc.json · 来源: api.github.com
winget install --id AlDanial.Cloc -eWindows Package Manager source index · AlDanial.Cloc · 来源: cdn.winget.microsoft.com
概览
Statistics utility to count lines of code
历史
cloc counts blank lines, comment lines, and physical source lines across many programming languages, with support for files, directories, archives, repositories, and diffs.
cloc was created by Al Danial and dates to 2006, when the project was hosted on SourceForge. The official README states that cloc moved to GitHub in September 2015 after SourceForge hosting that began in August 2006.
The tool is written in Perl, is designed to be portable with few external requirements, and incorporates ideas or code from SLOCCount, Regexp::Common, Win32::Autoglob, and Algorithm::Diff. Release notes show steady additions of language recognizers, output formats, archive support, VCS/diff features, and Windows packaging improvements.
cloc became a staple packaging target because it is useful in almost any source tree and easy to ship as a command-line utility. The official README documents installation through npm, apt, yum, dnf, pacman, emerge, apk, pkg, pkg_add, MacPorts, Homebrew, winget, Chocolatey, Scoop, Docker, and GitHub releases.
The batch input independently records coverage across Alpine, Homebrew, Chocolatey, Debian, Fedora, MacPorts, Nix, Arch, Scoop, Ubuntu, and Winget, matching cloc's broad cross-platform adoption.
Users run `cloc` on a file, directory, archive, git commit, or repository to get language-level blank/comment/code counts. It can also compare versions, read archives such as tar, zip, wheels, RPMs, and Debian packages, and emit reports in multiple formats.
Because the source version runs on Perl and the Windows executable bundles what it needs, cloc is practical for CI jobs, release audits, quick repository comparisons, and language-mix summaries.
cloc is package-nerd significant because it is one of the standard tiny tools people install everywhere to inspect source distributions. It also tests package metadata assumptions: source archives, generated Windows binaries, shell wrappers, Perl availability, Docker images, CPAN/npm wrappers, and OS-native packages all coexist.
Its README explicitly credits maintainers for Debian, CPAN, and npm packaging, showing that cloc's distribution story is not incidental but part of its ecosystem.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
cloc | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/AlDanial/cloc
安装元数据
| 软件包键 | brew:cloc |
|---|---|
| 版本 | 2.10 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/cloc |
| 主页 | https://github.com/AlDanial/cloc/ |
| 仓库 | https://github.com/AlDanial/cloc |
| 上游文档 | https://github.com/AlDanial/cloc#readme |
| 许可证 | GPL-2.0-or-later |
| 源码归档 | https://github.com/AlDanial/cloc/archive/refs/tags/v2.10.tar.gz |
| 最后更新 | 2026-07-04T23:36:10Z |
| Pulse | updated |
| macOS 提供的库 | perl |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | cloc |
| 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 |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
cloc 2.04-1
statistics utility to count lines of code
https://github.com/AlDanial/cloc
sudo apt install cloccloc
nix profile install nixpkgs#cloccloc 1.98-1
statistics utility to count lines of code
https://github.com/AlDanial/cloc
sudo apt install cloccloc 2.08-r0
Count lines of code
https://github.com/AlDanial/cloc
sudo apk add cloccloc-doc 2.08-r0
Count lines of code (documentation)
https://github.com/AlDanial/cloc
sudo apk add cloc-doccloc 2.08-1.fc45
Count lines of code
https://github.com/AlDanial/cloc
sudo dnf install cloccloc 2.08-1
Count lines of code
https://github.com/AlDanial/cloc
sudo pacman -S cloccloc
sudo port install clocCLOC
choco install CLOCmain/cloc
scoop install main/clocAlDanial.Cloc
winget install --id AlDanial.Cloc -e来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.