agentsclimarketplace

Cloc

Skill onfire7777/universal-ai-skills-library/skills/cloc

Count lines of code, analyze codebase size and composition, compare code between versions. Use when the user asks about lines of code, codebase size, language breakdown, or code statistics.From its SKILL.md

Install
npx -y skills add onfire7777/universal-ai-skills-library --skill cloc

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as Unspecified. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.2 KB, 583 tokens by cl100k_base, as published. Nobody here has run it

Prerequisites

Before running cloc, check if it is installed:

which cloc

If not found, install it:

  • macOS: brew install cloc
  • npm: npm install -g cloc
  • Debian/Ubuntu: sudo apt install cloc
  • Red Hat/Fedora: sudo yum install cloc

About cloc

cloc counts blank lines, comment lines, and physical lines of source code in 200+ programming languages. It can analyze files, directories, archives (tar, zip, .whl, .ipynb), and git commits/branches.

Common Usage

Count a directory (default: current project):

cloc .

Count using git file list (respects .gitignore):

cloc --vcs=git

Count a specific path:

cloc $ARGUMENTS

Count by file (detailed breakdown):

cloc --by-file --vcs=git

Diff between two git refs:

cloc --git --diff <ref1> <ref2>

Exclude directories:

cloc --exclude-dir=node_modules,vendor,.git .

Output Formats

Use these flags for machine-readable output:

  • --json — JSON
  • --yaml — YAML
  • --csv — CSV
  • --md — Markdown table
  • --xml — XML

Useful Flags

FlagPurpose
--by-filePer-file breakdown instead of per-language
--vcs=gitUse git to get file list (respects .gitignore)
--gitTreat arguments as git targets (commits, branches)
--diff <a> <b>Show added/removed/modified lines between two sources
--exclude-dir=<d1,d2>Skip directories
--exclude-lang=<l1,l2>Skip languages
--include-lang=<l1,l2>Only count these languages
--force-lang=<lang>,<ext>Map file extension to a language
--processes=NParallel processing (N cores)
--quietSuppress progress output

Guidelines

  • Prefer --vcs=git over bare . to avoid counting generated/vendored files
  • Use --json when the user needs to process the output programmatically
  • When comparing versions, use --git --diff <ref1> <ref2>
  • For large repos, consider --processes=N to speed things up

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.