Capability overview
How can I use cli, git, and ci in Diff Anything?
The free CLI compares text, JSON, and Jupyter notebooks with terminal, summary, or JSON output, with the app's ignore rules. Pro unlocks every documented mode, including TOML, INI, property lists, and SQLite, reports, applying patches, and YAML/JSON batches that emit summary, JSON, JUnit, or SARIF, and --fail-on breaking fails an API schema check only on breaking or unclassified changes. Both tiers support colour, language, context, opt-in difference exit codes, Git difftool integration, and a Git diff driver assigned to file types in .gitattributes. With Pro, the merge driver merges JSON, YAML, TOML, and INI files by their data, and git mergetool opens each conflicted file in Diff Anything's merge window.
The Microsoft Store version on Windows provides the diff-anything.exe command and is itself the merge tool that Git, Mercurial, Subversion, Perforce, and TFVC start.
The Mac App Store version runs in Apple's App Sandbox, so its own executable cannot read files named on a command line. On a Mac, install the free Diff Anything command-line helper, a notarized download from this site rather than from the Mac App Store: it puts diff-anything in /usr/local/bin, runs the same commands, Git settings, and batch manifests, and opens git mergetool merges in a window of the app. The helper has Pro when Pro was bought or restored in the app on the same Mac; without it, it works as the free CLI.

Running the CLI
The installed app is also the command-line tool
Start the Diff Anything executable with --cli followed by two paths, or let Git run it as a diff driver. On Windows, the Microsoft Store package provides a diff-anything.exe command. On a Mac, install the free command-line helper, which puts diff-anything in /usr/local/bin and does not need --cli, though it accepts it. Use --mode to pick one of auto, text, json, yaml, toml, ini, plist, xml, csv, env, http, api, notebook, sqlite, folder, archive, document, or binary, and put -- before file names that start with a dash. --help lists every option and --version prints the installed version.
Output comes in three forms. terminal is a highlighted diff with line numbers, and --color auto, always, or never controls colour. summary is a short line of counts, and json is the full result for scripts. An interactive terminal gets terminal output by default and redirected output gets summary.
With --exit-code, the command returns 1 when differences are found and 0 when there are none. Invalid input returns 2.
On a Mac
The command-line helper for the Mac App Store version
The Mac App Store version runs in Apple's App Sandbox, which lets it read only the files you open in the app, so its own executable cannot read the files a command names: run from Terminal, it says to install the helper and exits with 2. The helper is the same command line built as a separate program that runs outside the sandbox, so every command, Git setting, and batch manifest on this page works with it unchanged. Settings > Command line in the app links to it and shows the Git settings.
It is a free installer from this site, not from the Mac App Store, signed with a Developer ID and notarized by Apple, for Apple silicon and Intel Macs with macOS 13 or later and Diff Anything 1.7 or later from the Mac App Store. As a merge tool, the helper reads the files Git names, opens the merge in a window of the app, starting the app when it is not running, and writes the merged file when you choose Save & Close. diff-anything --compare-paths opens one or two files or folders in the app. The helper never uses the network, and sudo /usr/local/lib/diff-anything/uninstall removes it.
Free and Pro
What runs on the free plan
The free command line compares text, JSON, and Jupyter notebook files up to 5 MB per side, and each run counts toward the 10 new comparison sessions per day. Other modes, including an auto run that resolves to another mode, report that they are included with Pro.
Pro unlocks every mode, batch manifests, and the Git merge tool. The command line uses the Pro unlock recorded by the desktop app for the same user account, so open the app once on that computer to buy or restore Pro.
On a Mac, the command-line helper has Pro when Pro was bought or restored in the app on the same Mac, under the same macOS user: the app keeps the App Store's signed record of the purchase in a folder it shares with the helper, and the helper checks Apple's signature on it offline. After buying or restoring, open the app once before you use Pro from the command line. Without Pro, the helper works as the free command line, with 10 comparisons a day counted on their own, and diff-anything --pro-status says why Pro was not found.
Git
Using it as Git's difftool, merge driver, and mergetool
Run the executable with --cli --integration-help to print ready-made Git settings. For viewing changes, set diff.tool to diff-anything and difftool.diff-anything.cmd to call the app with --cli --format terminal --color auto "$LOCAL" "$REMOTE". git difftool then shows each changed file with highlighting. To have git diff itself use the app for chosen file types, set diff.diff-anything.command and assign the driver in .gitattributes, for example *.json diff=diff-anything; leave --exit-code out of it.
With Pro, the merge driver merges the files you assign to it with merge=diff-anything: JSON, YAML, TOML, and INI files by their data, other text by lines, returning 1 while conflicts remain. Set merge.tool to diff-anything and mergetool.diff-anything.cmd to diff-anything --merge-tool "$BASE" "$LOCAL" "$REMOTE" "$MERGED", and git mergetool opens each conflicted file in Diff Anything's merge window. Save & Close writes the result and tells Git the file is resolved; Cancel leaves it as Git wrote it.
Batch and CI
Running many comparisons in one job (Pro)
A batch manifest is a YAML or JSON file with a comparisons list. Each entry has a left and right path, and optionally a name, a mode, and failOn: breaking for API schema cases, which then fail only on breaking or unclassified changes. Run it with --batch and choose --format summary, json, junit, or sarif. One manifest can mix modes, for example a JSON configuration check, a folder comparison of a build output, and a binary check of an installer. Changed cases and cases that could not be read are counted separately, and the command returns 1 if any case fails its failOn check or could not be compared.
JUnit output reports failing cases as failures and read problems as errors, which most CI systems display as test results; for API cases it lists the breaking changes with their rule codes. SARIF output reports each API finding under its rule code, and each other changed or failed case against its right-hand file. Write either report with --output FILE. Every case uses its mode's default comparison, because rules set in the app are not read by the command line. The same manifest can be opened, edited, and run in the app under Tools, Batch manifest.
In the workflow
How to use it
Find the command
On Windows, use diff-anything.exe. On a Mac, install the free command-line helper and use diff-anything. Check it with --cli --version.
Try one comparison
Compare two files with --format terminal, then add --exit-code for use in a script.
Connect Git
Copy the settings from --integration-help and run git difftool on your next change.
Automate with a manifest
With Pro, list your comparisons in a manifest and run --batch with JUnit or SARIF output.
Useful in practice
When to use it
Related manual
Use Diff Anything from the CLI, Git, and CI
Run repeatable comparisons, read highlighted terminal output, interpret exit codes, integrate with Git, and publish machine-readable CI results.
Read the guideDirect answers
Questions about cli, git, and ci.
Which exit codes does it use?
With --exit-code, 0 means no differences and 1 means differences were found. Invalid input returns 2. A batch run exits with 1 as soon as one of its cases changed or could not be read.
Why does my YAML comparison fail on the free plan?
On the free plan, only the text, json, and notebook modes run from the command line. YAML and every other mode need Pro.
Can I use the command line with the Mac App Store version?
Yes, with the free command-line helper. The app's own executable runs in Apple's App Sandbox and cannot read the files a command names, so it only says to install the helper. The helper installs diff-anything in /usr/local/bin and runs every command, Git setting, and batch manifest written for it, with the Pro purchase made in the app on the same Mac.
Can I use Diff Anything as Git's merge tool on a Mac?
Yes, with Pro and the free command-line helper. The Mac App Store version cannot read the files Git names on its own; the helper reads them, opens the merge in a window of the app, and writes the merged file when you choose Save & Close. Without the helper, open the conflicted file in the app and choose Resolve. On Windows, the Microsoft Store version is the merge tool.
Does the command line use the rules I set in the app?
No. It uses each mode's default comparison. Save the rules in a profile and open it in the app when you need them.
How does the command line know I have Pro?
On Windows, it reads the Pro unlock stored by the desktop app for the same user. On a Mac, the command-line helper checks the App Store's signed record of the purchase that the app keeps for the same macOS user, offline. Buy or restore Pro in the app on that computer first; on a Mac, then open the app once.
Free & 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.