Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Commands

whogitit provides a comprehensive CLI for viewing and managing AI attribution data.

Command Overview

Core Attribution Commands

CommandDescription
blameShow AI attribution for each line of a file
showView attribution summary for a commit
promptView the prompt that generated specific lines
summaryGenerate summary for a commit range (PRs)
statusCheck pending attribution changes

Developer Integration Commands

CommandDescription
annotationsGenerate GitHub Checks API annotations
pagerAnnotate git diff output with AI markers

Data Management Commands

CommandDescription
exportExport attribution data as JSON/CSV
retentionManage data retention policies
auditView the audit log
clearDiscard pending changes without committing

Setup Commands

CommandDescription
setupConfigure Claude Code integration (one-time)
doctorVerify whogitit configuration
initInitialize whogitit in a repository
copy-notesCopy attribution between commits

Privacy Commands

CommandDescription
redact-testTest redaction patterns against text/files

Quick Reference

Viewing Attribution

# See AI attribution for a file
whogitit blame src/main.rs

# Show only AI-generated lines
whogitit blame src/main.rs --ai-only

# View commit summary
whogitit show HEAD

# Find prompt that generated a line
whogitit prompt src/main.rs:42

# Summarize a PR
whogitit summary --base main --format markdown

Developer Integration

# Generate GitHub Checks annotations for CI
whogitit annotations --base main --head HEAD

# Use as git pager for AI-annotated diffs
git config --global core.pager "whogitit pager"
git diff | whogitit pager

# Create git aliases
git config --global alias.ai-diff '!git diff | whogitit pager --no-pager'

Managing Data

# Check pending changes
whogitit status

# Clear pending without committing
whogitit clear

# Export all attribution data
whogitit export -o attribution.json

# Preview retention policy
whogitit retention preview

Setup Commands

# One-time global setup (configures Claude Code)
whogitit setup

# Verify all configuration
whogitit doctor

# Initialize repository hooks
whogitit init

# Initialize even if global setup incomplete
whogitit init --force

# Copy attribution (after cherry-pick or manual rebase recovery)
whogitit copy-notes <old-sha> <new-sha>
whogitit copy-notes <old-sha> <new-sha> --dry-run

Privacy Testing

# Test redaction patterns
whogitit redact-test --text "api_key=secret123"

# List available patterns
whogitit redact-test --list-patterns

# Show what would be redacted
whogitit redact-test --file .env --matches-only

Global Options

All commands support these options:

OptionDescription
--helpShow help for any command
--versionShow version information

Output Formats

Many commands support multiple output formats:

FormatFlagUse Case
Pretty(default)Human-readable terminal output
JSON--format jsonMachine parsing, scripts
Markdown--format markdownDocumentation, PR comments
CSV--format csvSpreadsheets, data analysis

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments

Next Steps

Explore each command in detail:

Core Commands

Developer Integration

Data & Privacy

Setup

  • setup - Global configuration
  • doctor - Configuration check
  • init - Repository setup
  • copy-notes - Copy attribution between commits