sad
$ sad Community Med Risksad (Space Age seD) reads file paths from stdin (such as fd or find) and computes unified diffs for regex or exact (-e) replacements. By default it opens an interactive fzf TUI preview, so headless agents must pass --fzf never --pager never for read-only previews or -k (--commit) to write.
brew install sad Local stdin-driven batch diffing and replacement; direct shell piping with fd is simpler than any MCP layer.
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
Interactive fzf UI by default blocks headless shells unless --fzf never or -k is passed; lacks --json output.
- Requires
--fzf never --pager neverfor safe non-TTY preview - No
--jsonoutput mode
--fzf never prints read-only unified diffs safely; -k (--commit) writes changes in-place across all piped file paths.
- Separates preview (
--fzf never) from commit (-k)
Available via brew install sad, Cargo git install, and releases; expects fd/find for file discovery.
- Packaged on Homebrew and GitHub Releases
Composes nicely with fd / rg -l stdin pipelines and supports -e exact mode and -0 null delimiters.
- Supports
-0(--read0),-e(--exact), and-ucontext hunks
Community Rust tool (ms-jpq/sad) under MIT with infrequent releases.
- Community repo with sporadic release cadence
Clear README flag table covering -k, --fzf, --pager, -e, and -0.
- Flags documented in GitHub README
Security, Auth & Guardrails
None required; operates purely on local file paths read from stdin.
100% free, offline, and open-source (MIT).
# sad Agent Rules - ALWAYS pass `--fzf never --pager never` to preview diffs safely; bare `sad` launches an interactive `fzf` TUI that blocks agents. - Only pass `-k` (`--commit`) after verifying the `--fzf never` diff output.
Agent-Ready Command Recipes
Safe Read-Only Queries
fd -e ts . src/ | sad --fzf never --pager never 'oldMethod' 'newMethod'
Disables the fzf TUI and pager to emit plain unified diff previews to stdout without modifying files.
Controlled Writes & Previews
fd -e ts . src/ | sad -k --pager never 'oldMethod' 'newMethod'
Applies the replacement across all piped files in-place (-k / --commit) after previewing.
Strengths for Agents
- +
--fzf never --pager neverproduces clean unified diff previews without touching files. - + Reads stdin path lists (
-0supported) so scope is strictly controlled byfdorrg -l.
Caveats & Pitfalls
- ! Default invocation attempts to launch an interactive
fzfTUI and fails/blocks in non-TTY agent shells. - ! Lacks
--jsonoutput and relies onsadremaining in sync withfzf/pager expectations.