Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

sad

$ sad Community Med Risk
ms-jpq · Files & Search · MIT · macos / linux / windows

sad (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.

FCRS-1.0 Score
73 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install sad
CLI vs MCP Decision CLI Only

Local stdin-driven batch diffing and replacement; direct shell piping with fd is simpler than any MCP layer.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

Interactive fzf UI by default blocks headless shells unless --fzf never or -k is passed; lacks --json output.

  • Requires --fzf never --pager never for safe non-TTY preview
  • No --json output mode
Trust & Safety 19 / 25

--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)
Setup & Portability 13 / 15

Available via brew install sad, Cargo git install, and releases; expects fd/find for file discovery.

  • Packaged on Homebrew and GitHub Releases
Utility & Efficiency 11 / 15

Composes nicely with fd / rg -l stdin pipelines and supports -e exact mode and -0 null delimiters.

  • Supports -0 (--read0), -e (--exact), and -u context hunks
Maintenance & Lineage 7 / 10

Community Rust tool (ms-jpq/sad) under MIT with infrequent releases.

  • Community repo with sporadic release cadence
Docs & Verifiability 7 / 10

Clear README flag table covering -k, --fzf, --pager, -e, and -0.

  • Flags documented in GitHub README

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates purely on local file paths read from stdin.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free, offline, and open-source (MIT).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Preview batch replacement diff without TUI or disk writes
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

Commit batch replacement non-interactively
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 never produces clean unified diff previews without touching files.
  • + Reads stdin path lists (-0 supported) so scope is strictly controlled by fd or rg -l.

Caveats & Pitfalls

  • ! Default invocation attempts to launch an interactive fzf TUI and fails/blocks in non-TTY agent shells.
  • ! Lacks --json output and relies on sad remaining in sync with fzf/pager expectations.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI