diffox

Docs / Getting started

Run it on the command line

You run the review on your own machine, between any two refs. You need Python 3.12 or newer, git and an API key (currently Anthropic).

Install it

With uv, as below, or with pip install diffox in a virtual environment.

terminal
uv tool install diffox

Give it your key

diffox reads ANTHROPIC_API_KEY from the environment, or from a .env file in the working directory when the environment has none.

Review a change

Run both commands inside the repository. diffox prepare reads the change between two refs from git and prints it as JSON; diffox review reviews it.

terminal
diffox prepare --base main --head HEAD \  | diffox review --format rdjson

Output formats

--format chooses what the review prints:

martian
the engine's own JSON (the default)
rdjson
reviewdog's format, for posting comments under the lines
rdjsonl
the same, one finding per line
sarif
SARIF 2.1.0, for GitHub code scanning and other dashboards

See what would be sent

--dry-run says what the model would be given and stops: no model call and no key needed.

terminal
diffox prepare --base main --head HEAD \  | diffox review --dry-run

Fail a CI job on a finding

By default no finding fails the command. With --fail-level it exits non-zero when a finding reaches that level.

terminal
diffox prepare --base main --head HEAD \  | diffox review --format rdjson --fail-level warning

Every option: diffox review --help.