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

sd

$ sd Community Med Risk
chmln (OSS) · Files & Search · MIT · macos / linux / windows

sd replaces cryptic sed delimiters with modern JS/Rust regex syntax and -F fixed-string mode. While stdin transformations stay read-only, passing file paths edits them in-place by default—making -p (--preview) mandatory before committing changes.

FCRS-1.0 Score
83 /100
Good
Medium Confidence
Zero-Friction Install
brew install sd
CLI vs MCP Decision CLI Preferred vs MCP

Direct sd -p runs locally on files in milliseconds; no MCP wrapper is warranted for text replacement.

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 19 / 25

Clean non-interactive regex/literal interface with -p preview, though it has no --json output.

  • Supports -p/--preview and -F/--fixed-strings
Trust & Safety 19 / 25

Safe on stdin or with -p, but passing file arguments without -p mutates files in-place immediately.

  • In-place write is default for file arguments unless -p is given
Setup & Portability 14 / 15

Single Rust binary available via brew, cargo, and OS package managers.

  • Cross-platform binary across macOS, Linux, and Windows
Utility & Efficiency 14 / 15

Avoids sed -i macOS/GNU portability differences and delimiter-escaping mistakes.

  • Consistent syntax across macOS and Linux unlike sed -i
Maintenance & Lineage 9 / 10

Well-established OSS utility (chmln/sd) with clean Rust dependencies.

  • Maintained MIT-licensed repository
Docs & Verifiability 8 / 10

Concise --help and README with clear regex and -F examples.

  • Straightforward README and --help output

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates purely on local text streams or files.

Side Effects
Read-Only Local Write
Cost & Quotas

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

Copyable Guardrail for CLAUDE.md / AGENTS.md
# sd Agent Rules
- ALWAYS run `sd -p` (`--preview`) on target files before omitting `-p` to modify files in-place.
- Prefer `-F` (`--fixed-strings`) when replacing literal identifiers, dots, or URLs.

Agent-Ready Command Recipes

Safe Read-Only Queries

Preview regex replacement without touching files
sd -p 'http://' 'https://' config.toml

Uses -p (--preview) to print proposed changes to stdout without modifying config.toml.

Controlled Writes & Previews

Apply fixed-string replacement in-place
sd -F 'old_endpoint' 'new_endpoint' src/client.ts

Uses -F literal matching (avoiding regex escaping bugs) to update src/client.ts in-place.

Strengths for Agents

  • + Eliminates GNU vs BSD sed -i syntax incompatibilities across macOS and Linux.
  • + Provides -p dry-run preview and -F literal string matching.

Caveats & Pitfalls

  • ! Passing file paths without -p writes changes in-place immediately without confirmation.
  • ! Does not recurse directories by itself—combine with fd -X carefully after previewing.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI