CLI
Run Pith locally with your own Anthropic API key.
Installation
Install globally:
npm install -g pithOr as a dev dependency:
npm install -D pithRequires Node.js 20+ and a git repository.
Commands
| Command | Description |
|---|---|
pith init | Scaffold .pith.yml config and install git hooks (post-commit, post-merge) |
pith update | Read recent git changes and update documentation |
pith preview | Dry run - shows what would change without writing files |
pith ci <provider> | Generate CI/CD config (github, gitlab) |
pith update flags
| Flag | Description |
|---|---|
--repo <path> | Path to repo root (default: current directory) |
--since <ref> | Update based on changes since a git ref (e.g. HEAD~5) |
--range <range> | Update based on a git ref range (e.g. abc123..def456) |
--trigger <type> | Trigger type: commit or merge (used by git hooks) |
--dry-run | Preview changes without writing files |
Output modes
Configured via output.mode in .pith.yml:
| Mode | Behavior |
|---|---|
file-only | Write files to disk. You stage and commit manually. |
commit | Auto-commit doc changes after generation. |
pr | Create a local branch with doc changes. |
.pith.yml
Running pith init creates this default config:
.pith.yml
version: 1
ai:
model: claude-sonnet-4-6
# apiKey: ${ANTHROPIC_API_KEY}
docs:
readme:
enabled: true
template: default
output: README.md
api:
enabled: true
template: default
output: docs/API.md
include:
- "src/**/*.ts"
- "src/**/*.js"
architecture:
enabled: true
template: default
output: docs/ARCHITECTURE.md
changelog:
enabled: true
template: default
output: CHANGELOG.md
format: keepachangelog
output:
mode: file-only
commitMessage: "docs: auto-update documentation"
prBranch: docs/auto-update
exclude:
- "node_modules/**"
- "dist/**"
- "**/*.test.ts"
- "**/*.spec.ts"Config reference
| Key | Description |
|---|---|
ai.model | Which Claude model to use (default: claude-sonnet-4-6) |
ai.apiKey | API key via env var reference ${ANTHROPIC_API_KEY}, or set the env var directly |
docs.* | Enable/disable each doc type, set output paths, choose templates |
docs.api.include | Glob patterns for source files (use ['auto'] to auto-detect) |
docs.changelog.format | keepachangelog or conventional |
output.mode | file-only, commit, or pr |
exclude | Glob patterns to skip |
The CLI calls the Anthropic API directly using your API key. It does not connect to the Pith server, use your Pith account, or count against your SaaS quota.
Ready to stop writing docs by hand?
Connect your first repository and Pith will handle the rest.