# Command cheat-sheet

Every `occ` command with its canonical one-line description. Run `occ <group>
--help` for the authoritative flag list. Most commands accept `--format
tabular|json`, `-o <file>`, and `--ci`.

## Root

- `occ [directories...]` — Office Cloc and Count: scc-style summary tables for office documents. Flags: `--by-file`, `--structure`, `--quick`, `--include-ext`/`--exclude-ext`/`--exclude-dir`, `--no-gitignore`, `--sort files|name|words|size`, `--token-budget <n>`, `--tokenizer`, `--large-file-limit <mb>`, `--no-code`.
- `occ describe [directories...]` — Quickly classify one or more directories from fast file and manifest signals.

## `occ workspace` — Workspace-level analysis and document context helpers

- `occ workspace describe [rootDir]` — Quickly classify a workspace from fast file and manifest signals.
- `occ workspace analyze [rootDir]` — Analyze workspace code, documents, and structures with a versioned JSON contract. (default JSON)
- `occ workspace documents [rootDir]` — Inspect workspace document summaries and cross-document references. (default JSON)

## `occ doc` — Inspect document structure and content before deep reading

- `occ doc inspect <file>` — Inspect DOCX, PDF, or ODT document metadata, structure, and content preview.
- `occ doc entities <file>` — Extract entities (emails, URLs, dates, phone numbers, mentions) and keywords from a document.
- `occ doc references [directories...]` — Detect cross-references between documents in directories.

## `occ sheet` — Inspect spreadsheet structure and content before deep reading

- `occ sheet inspect <file>` — Inspect XLSX workbook metadata, sheet inventory, schema, and token estimates.

## `occ slide` — Inspect presentation structure and content before deep reading

- `occ slide inspect <file>` — Inspect PPTX or ODP presentation metadata, slides, and content preview.

## `occ table` — Extract and inspect table content from documents

- `occ table inspect <file>` — Extract structured table data from DOCX, XLSX, PPTX, ODT, or ODP documents.

## `occ code` — Explore code structure (type-accurate JS/TS + Vue SFC, tree-sitter for 12 more languages)

- `occ code map` — Token-budgeted, importance-ranked repo map (top symbol signatures per file).
- `occ code pack` — Token-budgeted, importance-ranked pack (file content, optionally compressed).
- `occ code index` — Build the full codebase index (files, symbols, edges, capabilities).
- `occ code source <name>` — Read one symbol body by node id (`--node-id`) or disambiguated name.
- `occ code check <file>` — Check a file's syntax without a language server (exits nonzero only when invalid).
- `occ code find name <name>` — Find code elements by exact name.
- `occ code find pattern <pattern>` — Find code elements by substring pattern.
- `occ code find type <nodeType>` — List all nodes of a given type.
- `occ code find content <text>` — Search code content (full source text).
- `occ code find fused <query>` — Fused search combining name, pattern, and content with rank fusion.
- `occ code analyze calls <fn>` — Show what a function calls (outgoing calls).
- `occ code analyze callers <fn>` — Show what calls a function (incoming calls).
- `occ code analyze chain <fromFn> <toFn>` — Find call paths between two functions.
- `occ code analyze deps <target>` — Show module/file import relationships.
- `occ code analyze coupling <target>` — Show module-level coupling metrics.
- `occ code analyze tree <className>` — Show class/interface inheritance relationships.
- `occ code diff` — Show changed symbols for a git diff range.
- `occ code history <symbol>` — Show git line history for a symbol.

## `occ git` — Inspect git changes, history, and churn

- `occ git changed` — List changed files for the resolved diff range.
- `occ git diff` — Summarize or render the resolved diff (`--patch` for a bounded raw patch).
- `occ git history [file]` — Show commit history for a range or file.
- `occ git churn` — Rank changed files by churn.

## `occ skills` — Install and inspect the Agent Skills bundled with occ

- `occ skills install [--agent claude|codex|all] [--user|--project] [--project-root <dir>] [--force] [--link]` — Install occ Agent Skills into one or more coding agents.
- `occ skills list [--format json]` — List the Agent Skills bundled with occ.
- `occ skills path` — Print the path to occ's bundled Agent Skills.
