CLI

Run Pith locally with your own Anthropic API key.

Installation

Install globally:

npm install -g pith

Or as a dev dependency:

npm install -D pith
Requires Node.js 20+ and a git repository.

Commands

CommandDescription
pith initScaffold .pith.yml config and install git hooks (post-commit, post-merge)
pith updateRead recent git changes and update documentation
pith previewDry run - shows what would change without writing files
pith ci <provider>Generate CI/CD config (github, gitlab)

pith update flags

FlagDescription
--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-runPreview changes without writing files

Output modes

Configured via output.mode in .pith.yml:

ModeBehavior
file-onlyWrite files to disk. You stage and commit manually.
commitAuto-commit doc changes after generation.
prCreate 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

KeyDescription
ai.modelWhich Claude model to use (default: claude-sonnet-4-6)
ai.apiKeyAPI 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.includeGlob patterns for source files (use ['auto'] to auto-detect)
docs.changelog.formatkeepachangelog or conventional
output.modefile-only, commit, or pr
excludeGlob 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.