Feature guide macOSWindows

Use the same private comparison model from Git and CI

The free CLI compares text and JSON with terminal, summary, or JSON output. Pro unlocks every documented mode 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.

Capability overview

How can I use cli, git, and ci in Diff Anything?

The free CLI compares text and JSON with terminal, summary, or JSON output. Pro unlocks every documented mode 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.

The Microsoft Store version on Windows provides the diff-anything.exe command. The Mac App Store version runs in Apple's App Sandbox, which limits it to files and folders you choose in the app, so command-line, Git, and CI use is described for Windows.

Diff Anything welcome screen with private local comparison sources
Start with files, folders, or pasted content; the comparison stays on the device. View full size

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. Use --mode to pick one of auto, text, json, yaml, xml, csv, env, http, api, 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.

Free and Pro

What runs on the free plan

The free command line compares text and JSON 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.

Git

Using it as Git's difftool 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.

The same help text includes a mergetool command for Pro. It runs --merge with Git's base, local, and remote files, writes the merged file, and returns 1 when conflicts remain so Git knows the merge still needs attention.

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

  1. Find the command

    On Windows, use diff-anything.exe. Check it with --cli --version.

  2. Try one comparison

    Compare two files with --format terminal, then add --exit-code for use in a script.

  3. Connect Git

    Copy the settings from --integration-help and run git difftool on your next change.

  4. 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 guide

Direct 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 and json modes run from the command line. YAML and every other mode need Pro.

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?

It reads the Pro unlock stored by the desktop app for the same user. Buy or restore Pro in the app on that computer first.

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 and PDF previews show the first 3 pages. The free CLI supports text and JSON. A one-time Pro purchase removes the preview and session limits and unlocks larger sources within technical limits, saved profiles and history, report export, three-way merge, folder synchronization, batch manifests, trusted preprocessors, and every CLI mode.

Next

See all Diff Anything capabilities.

Back to capabilities