Direct answer
Which command-line features does Diff Anything support?
Diff Anything runs from the command line with --cli and two source paths, or with the arguments Git passes to a diff driver: on Windows, the Microsoft Store version's own executable, and on a Mac, the free command-line helper for the Mac App Store version. Single comparisons support auto, text, json, yaml, toml, ini, plist, xml, csv, env, http, api, notebook, sqlite, folder, archive, document, and binary modes (the free CLI runs text, JSON, and notebooks; Pro runs the others); ignore rules for text; summary, terminal, or JSON output; colour, language, and context controls; and an opt-in difference exit code; --fail-on breaking counts only breaking or unclassified API schema changes. Pro batch manifests support YAML or JSON input, a failOn setting per case, and summary, JSON, JUnit, or SARIF output, and Pro adds reports, --apply-patch, the Git merge driver, and the merge tool.

Single comparisons
Every single-comparison option, without implied flags.
Use --mode auto|text|json|yaml|toml|ini|plist|xml|csv|env|http|api|notebook|sqlite|folder|archive|document|binary and --format summary|terminal|json. A terminal defaults to terminal output; redirected stdout defaults to summary.
Use --color auto|always|never, --language LANGUAGE, and --context LINES. Passing --language auto clears the override; context must be non-negative and defaults to three lines.
Text and document comparisons take --ignore-text and --ignore-lines with a regular expression, --ignore-preset for built-in timestamp and ID patterns, --ignore-comments, --ignore-columns, and --align LEFT:RIGHT. --encoding, --left-encoding, and --right-encoding read files in a chosen encoding.
- --exit-code: 0 clean, 1 different, 2 invalid input or comparison failure
- --fail-on breaking: with --mode api, 1 only for breaking or unclassified API schema changes
- Without --exit-code or --fail-on, a valid changed single comparison exits 0
- Use -- before paths when a filename begins with a dash
- --help, --version, and --integration-help are available
PDF layout
Direct PDF layout comparison is desktop; rendered images make it automatable.
CLI document mode compares extracted document content. The rendered-page PDF Visual diff and its per-page match percentage are part of the desktop document workspace, not the direct document CLI result.
For an automated PDF-layout target, render matching reference and candidate pages to images at equal dimensions, compare each pair with Pro --mode binary --format json, and read the image similarity and changed-pixel measurements. A similarity threshold measures the chosen render; it does not prove equal wording, tagging, accessibility, or print behavior.
- Desktop PDF: choose Visual diff for rendered pages
- CLI wording: --mode document compares extracted content
- CLI layout loop: render pages first, then compare each image pair in Pro binary mode
Batch and CI
Batch behavior is explicit and Pro-only.
A batch manifest can be YAML or JSON. Its root can be an object with a comparisons array or a top-level array. Each item accepts name, left, right, an optional supported mode, and failOn: any (the default) or breaking for API schema cases.
Batch output formats are summary, JSON, JUnit, and SARIF, written to stdout or, with --output FILE, to a UTF-8 file. Batch returns 0 when every case passes its failOn check, 1 when a case fails it or could not be compared, and 2 when invocation or manifest loading fails.
- JUnit records failing cases as test failures and lists API findings with their rule codes
- SARIF 2.1.0 reports each API finding as its own result: breaking changes under their rule code as errors
- Desktop profiles and their semantic rules are not batch-manifest options
On a Mac
The Mac App Store version uses the free command-line helper.
The Mac App Store version runs in Apple's App Sandbox, so its own executable cannot read files named on a command line. The free command-line helper is the same command line built as a separate program, signed with a Developer ID and notarized by Apple, and downloaded from this site rather than the Mac App Store. It installs diff-anything in /usr/local/bin, so every command, Git setting, and batch manifest on this page works unchanged, and as a merge tool it opens the merge in a window of the app.
The helper has Pro when Pro was bought or restored in the app on the same Mac, under the same macOS user, and checks the App Store's signed purchase record offline; without Pro it runs the free CLI, with 10 comparisons a day counted on their own. It never uses the network.
- Apple silicon and Intel, macOS 13 or later, Diff Anything 1.7 or later from the Mac App Store
- diff-anything --pro-status says whether Pro was found, and why not
- sudo /usr/local/lib/diff-anything/uninstall removes it
Free and Pro
Desktop previews and CLI modes have different Free boundaries.
Free desktop use can preview every comparison engine for files up to 5 MiB per side and 10 new comparison sessions per local day; collections show the first 100 items and PDFs show the first 3 page previews. The free CLI supports text, JSON, and notebooks only.
The one-time Pro purchase unlocks every other CLI mode, every batch manifest, --report, --apply-patch, the merge driver and merge tool, larger sources within technical limits, report export, profiles and history, three-way merge, folder synchronization, and trusted preprocessors.
Best for
Where this workflow fits.
- Reading syntax-highlighted file differences in a terminal
- Using Diff Anything as a Git difftool or as the diff driver for chosen file types
- Running repeatable Pro comparison manifests in CI
No accounts, cloud comparison service, analytics, or telemetry.
Relevant capabilities
What Diff Anything brings to the job.
Practical workflow
From setup to a reviewed result.
Enter CLI mode
Run the installed desktop executable on Windows, or the command-line helper on a Mac, with --cli, any options, and exactly two readable source paths.
Choose mode and output
Use automatic detection or an explicit supported mode, then select terminal, summary, or JSON output for a person or another program.
Set process behavior
Add --exit-code when any difference should return 1, or --fail-on breaking for an API schema check; invalid input and comparison errors return 2.
Integrate safely
Configure a Git difftool or diff driver without --exit-code, or use a Pro batch manifest for summary, JSON, JUnit, or SARIF CI output.
Useful in practice
Direct answers
Questions about CLI diff tool.
Which command-line features does Diff Anything support?
Diff Anything runs from the command line with --cli and two source paths, or with the arguments Git passes to a diff driver: on Windows, the Microsoft Store version's own executable, and on a Mac, the free command-line helper for the Mac App Store version. Single comparisons support auto, text, json, yaml, toml, ini, plist, xml, csv, env, http, api, notebook, sqlite, folder, archive, document, and binary modes (the free CLI runs text, JSON, and notebooks; Pro runs the others); ignore rules for text; summary, terminal, or JSON output; colour, language, and context controls; and an opt-in difference exit code; --fail-on breaking counts only breaking or unclassified API schema changes. Pro batch manifests support YAML or JSON input, a failOn setting per case, and summary, JSON, JUnit, or SARIF output, and Pro adds reports, --apply-patch, the Git merge driver, and the merge tool.
Does Diff Anything have a separate image CLI mode?
No. The documented CLI mode list has no image mode. Image files can still be inspected through supported automatic or binary handling, while the purpose-built visual image workspace is a desktop feature.
Does CLI document mode visually compare PDF pages?
No. CLI document mode compares extracted content. For automated layout checks, render corresponding PDF pages to equal-size images first and use Pro binary mode with JSON output; for a direct PDF-to-PDF rendered comparison, use the desktop Visual diff.
Should a Git difftool command use --exit-code?
No. Git already invokes a difftool for a changed pair and expects successful processing, so the documented difftool command omits --exit-code. Leave it out of a diff driver too: Git stops git diff at the first changed file when a diff driver exits with a non-zero status.
Can Diff Anything run as the diff driver for git diff?
Yes, on Windows and, through the free command-line helper, on a Mac. Define the driver with git config diff.diff-anything.command and assign it to file types in .gitattributes, for example *.json diff=diff-anything. git diff then uses it for those files; git log -p and git show use it with --ext-diff. On the free plan, a file the plan does not cover is listed as not compared and git diff continues.
Where is the executable installed?
The Microsoft Store version on Windows declares the diff-anything.exe execution alias. On a Mac, the free command-line helper installs itself in /usr/local/lib/diff-anything and links it as /usr/local/bin/diff-anything, because the Mac App Store version's own executable is sandboxed and cannot read files named on a command line. which -a diff-anything shows which diff-anything runs first.
Go deeper
Run repeatable comparisons, read highlighted terminal output, interpret exit codes, integrate with Git, and publish machine-readable CI results.
Read Use Diff Anything from the CLI, Git, and CIFree & Pro: what’s included
Available on the Mac App Store and Microsoft Store. Free desktop use lets you try every comparison engine for files up to 5 MiB per side and 10 new comparison sessions per local day; collection previews show the first 100 items, binary comparisons the first 100 byte differences, and PDF previews the first 3 pages. Plain text, JSON, and Jupyter notebook comparison are complete, and opening files from Finder or File Explorer, diffanything:// links, and AppleScript are free. The free CLI supports text, JSON, and notebooks, and the command-line helper that brings the CLI to the Mac App Store version is a free download that uses the Pro purchase made in the app. A one-time Pro purchase removes the preview and session limits and unlocks larger sources within technical limits, saved profiles and history, saving folder snapshots, report export and printing, JSON Patch export, applying patches, three-way merge and conflict resolution, the Git merge driver and merge tool, folder synchronization, batch manifests, every CLI mode, and, on Windows, trusted preprocessors.