-
Notifications
You must be signed in to change notification settings - Fork 1
05 Diff Inputs
nitpik needs a diff to review. Choose the input mode that fits your workflow — each accepts code differently and has distinct use cases.
You must specify exactly one input source per review run.
Diff the current working tree against a branch, tag, or commit:
nitpik review --diff-base main
nitpik review --diff-base origin/develop
nitpik review --diff-base abc1234This is the most common mode. It runs git diff under the hood and captures all changes between the base ref and your current state. Requires git.
Best for: local development, CI pipelines with branch-based reviews.
Review a file or directory directly, without git:
nitpik review --scan src/main.rs
nitpik review --scan src/handlers/Treats the entire content as "new code" — there's no base to diff against, so every line is reviewed. Findings are not filtered to diff hunks.
Best for: reviewing files outside a git repo, auditing specific files, onboarding existing code.
Read a pre-computed unified diff from a file:
nitpik review --diff-file changes.patchUseful when the diff is generated by another tool or saved from a previous step.
Best for: CI pipelines that generate patch files, reviewing diffs from non-git VCS.
Pipe a unified diff from another command:
git diff main | nitpik review --diff-stdin
git diff --cached | nitpik review --diff-stdinBest for: composing nitpik with other tools, reviewing staged changes, custom diff generation.
When a single file's diff is very large, nitpik automatically splits it into smaller chunks. Each chunk is reviewed as a separate LLM call, and the findings are merged afterward. This keeps each prompt focused and within token limits.
You don't need to configure this — it happens automatically.
By default, nitpik operates in the current directory. Override with --path:
nitpik review --diff-base main --path /path/to/repoThis sets the repository root for git operations, file reads, and project doc detection.
- Quick Start — run your first review
- How Reviews Work — how nitpik assembles context from your diff
- Configuration — all CLI flags
Getting Started
Using nitpik
- Diff Inputs
- Reviewer Profiles
- Custom Profiles
- Agentic Mode
- Output Formats
- Editor & Agent Integrations
How It Works
Security & Privacy
Deployment
Reference