Skip to content

Repository files navigation

preflight

npm

After your coding agent finishes, run one command.

Local ship gate for agent-built software.

npx @khosla/preflight

That’s the whole start. Browser opens with what changed + findings.
Exit 0 = approved · 2 = fix findings · 1 = error.

preflight

Get value in seconds

  1. Have a dirty git repo (or a branch range)
  2. Have an agent CLI on PATH: pi, claude, codex, amp, opencode, or gemini
    (optional: ANTHROPIC_API_KEY)
  3. Run
    npx @khosla/preflight

Agent / CI mode:

npx @khosla/preflight --json --auto

Check setup:

npx @khosla/preflight doctor --json

Optional global install

npm i -g @khosla/preflight
preflight

What it does

  1. Captures staged, unstaged, and untracked changes (or reads a diff from stdin)
  2. Discovers and runs repository-native checks: typecheck, lint, test, build, Cargo, Go, or pytest
  3. Packs local context: intent, symbols, related tests, file windows, prior findings, and optional memory
  4. Judges with your agent CLI (multi-judge when 2+ CLIs are available)
  5. Grounds findings against real files, hunks, and lines
  6. Opens a review UI or prints structured JSON for agents
  7. Tracks findings as new, persisting, or resolved on the next run
  8. Returns approve / changes-requested

Repository check failures are authoritative: a model or UI approval cannot override them.

Agent snippet

Copy SKILL.md into your agent skills dir, or paste:

After a non-trivial change, run:
  npx @khosla/preflight --json --auto
- exit 0 → continue
- exit 2 → fix each open finding by id, re-run
- exit 1 → npx @khosla/preflight doctor --json

Common flags

Flag Meaning
--json --auto Headless agent mode
doctor --json Readiness report agents can branch on (ok)
--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.

Links

Develop

bun install && bun test && bun run build

Credits

Diff snippets in the review UI are rendered with @pierre/diffs.

License

MIT © Geet Khosla

About

Local ship gate for agent-built software — multi-judge findings, grounded diffs, executable verdicts

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages