Skip to content

CLI reference

Every command takes -h, --help, -v, --version and --license. zyndiff --help lists all commands, and zyndiff <command> --help prints that command’s options. A command run with a flag it doesn’t accept exits 1 before doing anything.

command does
zyndiff [ref] review a diff in the browser (the default command)
zyndiff show [rev] review one commit against its first parent
zyndiff mcp serve run the local stdio MCP server (agents launch this)
zyndiff mcp list list running MCP servers
zyndiff mcp restart stop running MCP servers so agents relaunch them on reconnect
zyndiff setup wire zyndiff into your coding agents (plugin or MCP config)
zyndiff doctor check agent plugin installs, leftover migrations and the release channel
zyndiff update download and install the latest release
zyndiff lsp show which language server each language gets, and override it
zyndiff sessions list running review sessions
zyndiff cleanup stop stale sessions and finished reviews
zyndiff completion print a tab-completion script for your shell
zyndiff hook stop experimental agent stop hook that opens a review of the working tree

Errors and exit codes shared by every command

Section titled “Errors and exit codes shared by every command”
exit when stderr
0 the command finished
1 bad arguments, or the command failed [zyndiff] <message>

Argument errors, verbatim from the parser:

input message
zyndiff --bogus unknown option: --bogus (try --help)
zyndiff cleanup extra unexpected argument: extra (cleanup accepts options only)
zyndiff show a b unexpected argument: b (only one ref spec, try --help)
zyndiff --port 0 --port needs a number between 1 and 65535 (got 0)
zyndiff --json --json needs --wait
zyndiff --review-id --review-id needs an id
zyndiff mcp mcp requires one of: serve, list, restart
zyndiff hook hook requires the stop command

Commands that ask Proceed? [y/N] (setup, doctor --fix, mcp restart, cleanup) print pass --yes to proceed and exit 1 when stdin is not a terminal.

Review a diff in the browser. It prints a http://127.0.0.1:<port> URL and opens it. The server only binds to 127.0.0.1.

Usage
zyndiff [ref] [options]
zyndiff --wait [ref] [--json]
ref compares
(none) working tree vs HEAD, untracked files included
staged staged changes only
<branch> current branch vs <branch> (PR-style three-dot)
<ref1>..<ref2> commit range
browse [path] the whole codebase, optionally scoped to a path (no diff, no scorecard)
flag value effect
-p, --port <n>, 1 to 65535 serve on a fixed port (default: any free port)
--no-open don’t open the browser automatically
--wait block until feedback is returned, then print the prompt on stdout
--json with --wait, print the review record as JSON instead of the prompt
--no-lsp start no language servers
--lsp <lang>=<command>, repeatable use this server for one language this run; an empty command disables it
--review-id <id> open an existing durable Review Record (its stored repo and comparison win over a ref argument)
$ zyndiff HEAD~1 --no-open --no-lsp
[zyndiff] v0.32.1 — reviewing feat/rate-limit → HEAD~1 (3 files changed)
http://127.0.0.1:16289/?review=072b10fc-4a59-4c39-85eb-5b91967aba6d (ctrl+c to stop)

Startup also prints one-line notices when they apply: a newer release (ZYNDIFF_NO_UPDATE_CHECK=1 silences it), a stale legacy plugin (run zyndiff doctor), or stale sessions (run zyndiff cleanup).

error cause
not a git repository (run zyndiff inside one) the cwd is not inside a git repo
unknown ref: <ref> git can’t resolve the ref
review record not found --review-id names a record that doesn’t exist
port <n> is already in use --port is taken
--lsp needs <lang>=<command> (an empty command disables the language) --lsp without =
unknown language "<lang>" (one of: typescript, csharp, python, go, rust, vue, svelte) --lsp names an unknown language

--wait blocks until the reviewer returns feedback, approves or cancels. Status lines go to stderr, the result goes to stdout. With --json, stdout is the get_review JSON for feedback, approved and cancelled.

exit outcome stdout without --json stdout with --json
0 feedback returned the compiled prompt get_review JSON
0 review approved empty get_review JSON
2 review cancelled empty get_review JSON
3 last tab closed without returning feedback (after a grace of about 5 s) empty empty
4 session stopped from outside, for example by zyndiff cleanup; the review stays open empty empty
130 interrupted (ctrl+c) while waiting; the review stays open empty empty
1 error empty empty

On 3, 4 and 130, stderr carries the resume line: review <id> is still open. resume with: zyndiff --review-id <id> (or get_review over MCP).

Terminal window
zyndiff --wait > feedback.md; echo "exit $?"

Review one commit. With no rev it reviews HEAD. It is the same diff as zyndiff <rev>^!, with the commit’s short hash, subject, body, author and date above the files. A root commit is compared with the empty tree, a merge commit with its first parent. The review is pinned to the full hash, so reopening it shows the same diff after HEAD moves, as long as the commit still exists (a rebase plus gc removes it).

Usage
zyndiff show [rev] [options]
flag value effect
-p, --port <n> serve on a fixed port
--no-open don’t open the browser automatically
--no-lsp start no language servers
--lsp <lang>=<command>, repeatable one-run language server override

show does not take --wait, --json or --review-id.

Terminal window
zyndiff show HEAD~2
error cause
unknown commit: <rev> git can’t resolve the rev
show takes one commit, not a range or revision set: <rev> a range such as a..b
invalid commit: <rev> (a commit can't start with "-") rev starts with -
<hash> is at the edge of a shallow clone, so its parent isn't here. fetch it with: git fetch --deepen=1 shallow clone

Run the local stdio MCP server named zyndiff. Agents launch it from their MCP config, so you rarely run it by hand. A start_review call may only target a cwd inside ZYNDIFF_ROOT, or inside the directory the server was started from when that is unset. Tools: MCP tools.

flag effect
none
Terminal window
zyndiff mcp serve

List running zyndiff MCP servers.

flag effect
none
$ zyndiff mcp list
no zyndiff MCP servers running

With servers running it prints a PID PATH table.

Stop every running zyndiff MCP server so agents relaunch it, for example on a new binary. Agents don’t respawn a stopped server by themselves: reconnect in Claude Code with /mcp, or start a new session.

flag effect
--yes skip the confirmation prompt
Terminal window
zyndiff mcp restart --yes
exit when output
0 servers stopped, or none running stopped 2 MCP servers — agents start the new server on reconnect (Claude Code: /mcp → reconnect, or a new session)
1 a review session is live 1 live review session — finish or stop them first (zyndiff sessions / cleanup --all)
1 a server could not be stopped failed to stop: then each pid

Wire zyndiff into your coding agents. It detects installed agents (binary on PATH or config directory present), shows a checklist with detected agents first and pre-checked (↑↓ move, space select, a all, enter confirm), prints every command and file it will touch, then asks Proceed? [y/N]. Re-running reports unchanged. --remove pre-checks the agents zyndiff is set up in, tagged (set up).

Usage
zyndiff setup [--remove] [--agents <ids>] [--yes]
flag value effect
--agents comma-separated ids act on these agents and skip the checklist
--remove unwire zyndiff instead
--yes skip the confirmation prompt

Agent ids: claude, codex, cursor, gemini, vscode, windsurf, opencode, zed, copilot.

Terminal window
zyndiff setup --agents claude,cursor --yes
exit when
0 done, or nothing selected
1 a step failed
1 no terminal and no --agents: no terminal to prompt in — pass --agents <ids> (detected: ...)
1 an unknown id: unknown agent: nope (valid: claude, codex, cursor, gemini, vscode, windsurf, opencode, zed, copilot)
1 --remove left a set-up agent in place (unchecked, or its CLI is missing)
130 the checklist or the confirmation was cancelled
130 --remove with nothing checked while agents are still set up

The uninstaller relies on a non-zero exit to keep the binary when a teardown is unfinished.

Report what’s wrong with the agent plugin installs and what to run to fix it. It checks the Claude Code plugin and marketplace for stale diffle-review or loupe-review leftovers, the other agents’ retired plugins and MCP configs, a data migration that hasn’t finished, old review records parked under migration-conflicts/, whether zyndiff is on PATH, and whether a newer release is published (skipped with ZYNDIFF_NO_UPDATE_CHECK).

Usage
zyndiff doctor [--fix] [--yes]
flag effect
--fix run the repair commands (Claude Code repairs go through the claude CLI)
--yes skip the confirmation prompt; also passes --yes to claude plugin install
$ zyndiff doctor
zyndiff doctor — agent plugin health (/home/me/.claude)
OK legacy plugins no diffle-review / loupe-review plugin installed
OK legacy plugin enabled none enabled
OK legacy marketplace none registered
OK marketplace source not registered
OK legacy MCP server no `diffle` server wired
WARN zyndiff-review not installed
OK release v0.32.1 is the latest
To repair, run:
claude plugin marketplace add praneethilluru/zyndiff
claude plugin install zyndiff-review@zyndiff-local --scope user
or let zyndiff run them: zyndiff doctor --fix
exit when
0 healthy, or --fix finished every repair
1 something is unhealthy (without --fix), or a repair is incomplete (repairs incomplete: lists which)

Download the latest release from GitHub Releases, verify its SHA-256 against checksums.txt, and swap the binary. Then it stops idle MCP servers still on the old binary (not while a review session is live) and prints the next steps that apply. On Windows the running exe is renamed aside as .zyndiff.exe.old* and removed by a later update.

Usage
zyndiff update [--check]
flag effect
--check only report whether a newer release exists; never downloads, and works in a source checkout
$ zyndiff update --check
[zyndiff] v0.32.1 is the latest release (source checkout — use git pull)

An installed binary prints v0.32.1 is the latest release, or v0.33.0 available (installed v0.32.1) — run zyndiff update.

output when exit
already on the latest release (v0.32.1). up to date 0
installed via <manager> — update with: <command> a package manager owns the install 0
'update' applies to an installed zyndiff binary; in a source checkout, use git pull. run from source 0
could not reach GitHub to check for releases --check offline 0
checksum mismatch for <asset> the download doesn’t match checksums.txt 1
download failed (<status>) for <url> the download failed 1

An installed binary also announces a newer release in one line when a review launches, checking GitHub at most once every 24 hours. ZYNDIFF_NO_UPDATE_CHECK=1 or CI turns that off.

Print the language server each language gets, or store an override in ~/.zyndiff/state.json. Commands run directly, never through a shell. When VIRTUAL_ENV is set, its bin (Scripts on Windows) is searched first for Python. Details: Configuration.

Usage
zyndiff lsp
zyndiff lsp set <lang> <command>
zyndiff lsp unset <lang>
subcommand effect
(none) one line per language: the server that will run, or what was tried and how to install it; stored overrides follow the table
set <lang> <command> always use <command> for <lang>; quote a command with arguments; "" disables the language
unset <lang> drop the stored override

Languages: typescript, csharp, python, go, rust, vue, svelte.

$ zyndiff lsp
typescript not on PATH (tried typescript-language-server) npm install -g typescript-language-server typescript
csharp not on PATH (tried roslyn-language-server, csharp-ls) dotnet tool install -g roslyn-language-server --prerelease (or: dotnet tool install -g csharp-ls)
python not on PATH (tried pyrefly, basedpyright-langserver) pip install pyrefly (or: pip install basedpyright)
go /home/me/go/bin/gopls
rust not on PATH (tried rust-analyzer) rustup component add rust-analyzer
vue not on PATH (tried vue-language-server) npm install -g @vue/language-server
svelte not on PATH (tried svelteserver) npm install -g svelte-language-server
$ zyndiff lsp set python "basedpyright-langserver --stdio"
[zyndiff] python: set to basedpyright-langserver --stdio
error cause
lsp set needs a language and a command, e.g. lsp set python "pyrefly lsp" ("" disables it) set without a command
unexpected argument: <word> (quote a command that has arguments) an unquoted command with arguments
unknown language "<lang>" (one of: typescript, csharp, python, go, rust, vue, svelte) unknown language
unterminated " in command: <command> unbalanced quote

List review sessions from the session registry.

flag effect
none
$ zyndiff sessions
REVIEW STATUS HOST PORT AGE STATE
41462557-210f-46c4-b33d-6fb1fb7e0e38 awaiting_human cli 13806 13h stale
f760979b-deb4-4ce2-8626-59e5894fc334 cancelled mcp 21473 12d stale
column values
STATUS the Review Record status (awaiting_human, feedback_ready, approved, cancelled), or missing
HOST what launched it: cli, mcp or hook
AGE just now, <n>m, <n>h, <n>d
STATE live (server answering) or stale (process gone)

With nothing registered it prints no zyndiff sessions.

Delete stale registry entries, stop live sessions whose review is approved, cancelled or missing, and remove leftover language server worktrees for the current repository. It prints the plan, then asks.

Usage
zyndiff cleanup [--yes] [--all]
flag effect
--yes skip the confirmation prompt
--all also stop active (not just finished or stale) sessions
Terminal window
zyndiff cleanup --all --yes
exit when
0 done, nothing to do (no zyndiff sessions), or you answered no
1 a session could not be stopped (failed to stop: lists it)

Run it from inside the repository to catch its leftover worktrees.

Print a tab-completion script on stdout. It completes commands, subcommands (mcp serve|list|restart, hook stop, lsp set|unset), flags, enumerable flag values (--shell, --agent, --agents), and branch, remote and tag names for the review and show commands. Refs are read from git when you press tab. zyndiff never edits your shell profile; the installer can offer to.

Usage
zyndiff completion --shell <bash|zsh|fish|powershell>
flag value effect
--shell bash, zsh, fish, powershell shell to generate for (required)
shell add to your profile
bash (~/.bashrc) eval "$(zyndiff completion --shell bash)"
zsh (~/.zshrc, after compinit) source <(zyndiff completion --shell zsh)
zsh (on demand) zyndiff completion --shell zsh > ~/.zfunc/_zyndiff with ~/.zfunc on $fpath before compinit
fish (~/.config/fish/config.fish) zyndiff completion --shell fish | source, or save the output as ~/.config/fish/completions/zyndiff.fish
PowerShell ($PROFILE) zyndiff completion --shell powershell | Out-String | Invoke-Expression
error cause
completion needs --shell bash|zsh|fish|powershell no --shell
--shell must be one of: bash, zsh, fish, powershell unknown shell

Experimental. A stop-hook command for Claude Code or Codex. No integration calls it, and zyndiff setup doesn’t wire it, so it only runs if you add it to your agent’s hook config yourself. It reads the hook JSON (cwd, session_id, task_id, last_assistant_message) from stdin. If that agent session already has an active review, it says so. Otherwise, when the working tree has changes, it creates a Review Record with policy required, spawns zyndiff --review-id <id> in the background and returns right away. It doesn’t wait for the review. It prints one JSON line with a systemMessage, except when there are no changes, where it prints nothing. It never fails the hook. A stop hook fires after every turn, so once you approve or cancel a review, the next turn that ends with changes in the working tree opens a new one.

Usage
zyndiff hook stop --agent <codex|claude-code>
flag value effect
--agent codex or claude-code the agent calling the hook (required)
Terminal window
echo '{"cwd":"/home/me/app","session_id":"s1"}' | zyndiff hook stop --agent claude-code
{"systemMessage":"ZynDiff Review 3f2c9a1e-... opened. Resume after reviewing, or explicitly continue without waiting."}
systemMessage when
ZynDiff Review <id> is still active. that agent session already has an open review
ZynDiff Review <id> opened. Resume after reviewing, or explicitly continue without waiting. a new review was created
(no output) the repo has no changes
ZynDiff Review was not opened: <message> anything failed
env effect
ZYNDIFF_NO_OPEN=1 the spawned review doesn’t open a browser
ZYNDIFF_HOOK_NO_SPAWN=1 create the record but spawn no review process

Missing --agent exits 1 with hook stop requires --agent codex or claude-code.

There is no diffle or loupe alias. The binary is zyndiff, and the first run moves an older install over. See Migrating from diffle.