CLI Reference¶
Synopsis¶
If no directories are specified, OCC scans the current working directory.
Flags¶
| Flag | Description | Default |
|---|---|---|
--by-file / -f |
Show a row per file instead of grouped by type | grouped by type |
--format <type> |
Output format: tabular or json |
tabular |
--include-ext <exts> |
Comma-separated extensions to include | all supported |
--exclude-ext <exts> |
Comma-separated extensions to skip | none |
--exclude-dir <dirs> |
Directories to skip (comma-separated) | node_modules,.git |
--no-gitignore |
Disable .gitignore respect | enabled |
--sort <col> |
Sort by: files, name, words, size |
files |
--output <file> / -o |
Write output to file instead of stdout | stdout |
--ci |
ASCII-only output, no colors | off |
--large-file-limit <mb> |
Skip files over this size in MB | 50 |
--structure |
Extract and display document heading hierarchy | off |
--no-code |
Skip scc code analysis | off |
--version / -V |
Print version and exit | |
--help / -h |
Print help and exit |
Flag Details¶
--by-file / -f¶
Show one row per file instead of grouping by document type:
--format <type>¶
Choose between tabular (default terminal tables) or json (machine-readable):
--include-ext <exts>¶
Only scan specific file extensions:
--exclude-ext <exts>¶
Skip specific file extensions:
--exclude-dir <dirs>¶
Skip entire directories (comma-separated):
--no-gitignore¶
By default, OCC respects .gitignore rules. Use this flag to scan all files regardless:
--sort <col>¶
Sort output rows by a column. Available values: files, name, words, size:
--output <file> / -o¶
Write output to a file instead of stdout:
--ci¶
ASCII-only output with no ANSI color codes, suitable for CI pipelines:
--large-file-limit <mb>¶
Skip files exceeding the specified size in megabytes:
--structure¶
Extract and display document heading hierarchy. Works with DOCX, PDF, PPTX, ODT, and ODP. Spreadsheets (XLSX, ODS) are skipped since they have no heading hierarchy.
# Tree view of headings per document
occ --structure docs/
# Structure as JSON (includes nodes with character offsets and page mappings)
occ --structure --format json docs/
# Combine with other flags
occ --structure --by-file --no-code docs/
The structure output runs alongside existing metrics — the metrics pipeline is untouched.
--no-code¶
Skip the scc code analysis section entirely:
Exit Codes¶
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Error (invalid arguments, scc not found, etc.) |
Environment Variables¶
| Variable | Description |
|---|---|
SCC_SKIP_DOWNLOAD |
Set to 1 to skip automatic scc binary download during npm install |