Side-by-side colored diff CLI for comparing files and directories with clearer terminal review output.
$python3 -m pip install icdiff
AI Analysis
icdiff is a text diff CLI that renders side-by-side, colorized comparisons for files and directory trees. It is mainly for review workflows where plain diff or default VCS output makes small line-level changes hard to read.
What It Enables
- Compare two text files with inline change highlighting, custom labels, line numbers, whitespace controls, and whole-file or contextual views.
- Compare directory trees, recurse into subdirectories, exclude path patterns, and optionally flag permission differences or identical files.
- Use it as a Git, Subversion, or Mercurial difftool when reviewing working-tree changes from the terminal.
Agent Fit
- Direct two-path invocation, script-friendly exit codes, and non-interactive flags make it easy to drop into inspect or verify steps.
- Output is ANSI-colored plain text only, so agents cannot rely on structured parsing the way they could with JSON-emitting CLIs.
- Best fit is human-in-the-loop review after an agent edits files, especially when a clearer side-by-side diff is more useful than raw patch output.
Caveats
- It is text-oriented: invalid encodings and binary-like inputs surface errors instead of a rich comparison view.
- Display quality depends on terminal width and ANSI color support;
--colsand wrapping or truncation options may need tuning in automation.