After your coding agent finishes, run one command.
Local ship gate for agent-built software.
npx @khosla/preflightThat’s the whole start. Browser opens with what changed + findings.
Exit 0 = approved · 2 = fix findings · 1 = error.
- Have a dirty git repo (or a branch range)
- Have an agent CLI on PATH:
pi,claude,codex,amp,opencode, orgemini
(optional:ANTHROPIC_API_KEY) - Run
npx @khosla/preflight
Agent / CI mode:
npx @khosla/preflight --json --autoCheck setup:
npx @khosla/preflight doctornpm i -g @khosla/preflight
preflight- Captures staged, unstaged, and untracked changes (or reads a diff from stdin)
- Discovers and runs repository-native checks: typecheck, lint, test, build, Cargo, Go, or pytest
- Packs local context: intent, symbols, related tests, file windows, prior findings, and optional memory
- Judges with your agent CLI (multi-judge when 2+ CLIs are available)
- Grounds findings against real files, hunks, and lines
- Opens a review UI or prints structured JSON for agents
- Tracks findings as
new,persisting, orresolvedon the next run - Returns approve / changes-requested
Repository check failures are authoritative: a model or UI approval cannot override them.
After a non-trivial change, run:
npx @khosla/preflight --json --auto
- exit 0 → continue
- exit 2 → fix each open finding by id, re-run
| Flag | Meaning |
|---|---|
--json --auto |
Headless agent mode |
--strict / --no-strict |
Force / disable multi-judge |
--with pi,codex |
Choose backends |
--no-verify |
Skip repository-native checks |
--no-delta |
Ignore prior review state |
Verification commands time out after 90 seconds by default. Override with PREFLIGHT_VERIFY_TIMEOUT_MS.
- Site: https://gvkhosla.github.io/preflight/
- UI mock: https://gvkhosla.github.io/preflight/demo-ui.html
- GitHub: https://github.com/gvkhosla/preflight
- npm: https://www.npmjs.com/package/@khosla/preflight
bun install && bun test && bun run buildDiff snippets in the review UI are rendered with @pierre/diffs.
MIT © Geet Khosla
