Scripting and AI Assistants

Everything Diffoniq shows on screen it can also deliver headless. Two commands cover the two halves of unattended work: /report answers “what is different?” as a file, /sync acts on the answer. Both print nothing and report through an exit code, an output file and a log file — which is exactly what batch files, CI jobs, the Windows Task Scheduler and AI assistants can work with.

CommandWhat it doesFull page
/report Compare two files, folders or archives and write the result as HTML, text or JSON. Read-only. Comparison Reports
/sync Synchronize two folders — dry run by default, applied with --execute. Folder Synchronization

The compare switches of a normal start work with both — the same engine runs underneath, including the hash cache and rename detection. Spell the command switch as /report or /sync, as shown on their pages.

The contract: exit code and JSON

Both commands follow the same scheme — a script can branch on the exit code alone:

ExitMeaning
0No differences
1Differences — report written · sync planned or applied
2Trouble with the outcome — report file not writable · sync finished with errors
3Invalid arguments, or the run failed before doing anything

When something has to act on the differences rather than glance at the count, ask for --format json. The document lists every compared item with a status, both sides with real numbers and ISO timestamps, and a summary block — JSON for scripts describes each key. Two rules matter for any consumer: a side that does not exist is null, and unverified is its own state — never treat it as identical (add --content when the decision must be final).

Working with an AI assistant

An AI coding assistant that can run commands — in a terminal, an IDE or a CI pipeline — needs no plugin to use Diffoniq: the two commands above are its interface. The reliable pattern is always the same: have the assistant write a JSON report, read the file, then act on it. For example:

Run
  Diffoniq /report "D:\releases\v1" "D:\releases\v2" --out r.json --format json --content -s
then read r.json and summarize what changed. Treat "unverified"
entries as unresolved, not as identical.

The assistant gets the summary counts to decide whether anything happened, the entries to name it, and the exit code to branch on — instead of guessing from screenshots or parsing text layouts. A file comparison works the same way and yields a lines array. The pages linked above spell out every key and exit code; hand them to the assistant when it needs the details.

Make the shell wait

Diffoniq is a windowed program. Some shells therefore hand the process off and continue immediately — the exit code arrives as 0 before the report exists. Tell the shell to wait:

The output file is the safety net: the report and the log are written to a temporary name and renamed on completion — if the file named by --out or --log exists, it is complete. A consumer can never pick up a half-written report, and “wait until the file exists” is a correct pattern when the exit code is out of reach.

ShellRecipe
cmd, batch files start "" /wait "C:\Program Files\Diffoniq\Diffoniq.exe" /report … — then %errorlevel% is real.
PowerShell $p = Start-Process Diffoniq.exe -ArgumentList '/report','…' -Wait -PassThru; $p.ExitCode
Git Bash / MSYS Two traps at once: the shell rewrites /report into a path, and it does not wait. Write the switch as //report and force the wait through a pipe: Diffoniq.exe //report … | cat — the exit code is then ${PIPESTATUS[0]}.

The Task Scheduler and CI runners wait on their own — the nightly sync and nightly report examples show complete schtasks lines.