riff
$ riff Community Low Riskriff (crate riffdiff) reads unified diffs from stdin or compares two files/directories directly, highlighting exact changed tokens within modified lines. With --no-pager and --color=off it exits cleanly in pipes, though its core value is visual highlighting for human readers.
brew install riff Stream diff filtering belongs in Unix pipes (git diff | riff); agents should usually read plain git diff instead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --no-pager and --color=off for clean non-TTY piping, but lacks --json and defaults to spawning a pager with ANSI color highlights.
- Explicit
--no-pagerand--color=offflags - No structured JSON output
Strictly read-only diff filter with zero write operations or network access.
- Pure read-only stdin/file diff filter
Rust binary available via Homebrew, cargo install riffdiff, and GitHub releases across macOS, Linux, and Windows.
- Single static Rust binary on major platforms
Greatly improves human diff scanning inside git pagers, while offering limited extra value to LLMs over git diff.
- Intra-line word/character diff refinement
Actively maintained MIT-licensed Rust project (walles/riff).
- Consistent GitHub releases under MIT license
Concise GitHub README and --help output documenting git pager config and RIFF env var.
- Clear CLI options and git integration examples
Security, Auth & Guardrails
None required; reads stdin or local files read-only.
100% free, offline, and open-source (MIT).
# riff Agent Rules - Always pass `--no-pager` (and `--color=off` when parsing) to prevent `riff` from spawning an interactive pager. - Prefer plain `git diff` or `difft --display json` when an agent needs token-lean diff input.
Agent-Ready Command Recipes
Safe Read-Only Queries
riff --no-pager --color=off old.txt new.txt
Prints unified diff output cleanly to stdout using --no-pager and --color=off without ANSI escape codes.
git diff HEAD~1 | riff --no-pager
Applies word-level diff refinement over git diff directly to stdout.
Strengths for Agents
- + Strictly read-only with
--no-pagerand--color=offflags. - + Fast Rust binary that refines diffs down to exact changed character spans.
Caveats & Pitfalls
- ! Spawns an interactive pager by default unless
--no-pageris passed or stdout is redirected. - ! No
--jsonoutput; designed primarily for human visual diff reading.