# Cloc CLI

> Use this skill when the user wants to count lines of code.

- Skill: `javimosch/cloc-cli` (Agent Skill)
- Install (CLI): `npx skillmds@latest add javimosch/cloc-cli`
- Raw SKILL.md: https://api.skillmd.com/api/skills/javimosch/cloc-cli/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: javimosch (https://skillmd.com/u/javimosch)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/javimosch/cloc-cli

---


# CLOC-CLI Plugin

Count lines of code in directories.

## Commands

### Code Counting
- `cloc-cli directory count` — Count lines of code in directory

## Usage Examples
- "cloc-cli directory count --directory src/"
- "cloc-cli directory count --directory src/ --json"

## Installation

```bash
npm install -g cloc
```

## Examples

```bash
# Count current directory
cloc

# Count specific directory
cloc src/

# Output as JSON
cloc --json src/

# Exclude directories
cloc --exclude-dir node_modules,vendor

# Count by language
cloc --by-lang src/

# Count files only
cloc --by-file src/

# Count multiple directories
cloc src/ lib/
```

## Key Features
- Lines of code counting
- 200+ programming languages
- JSON output
- Directory exclusion
- File filtering
- Detailed statistics

