TL;DR — Quick Summary
sad (Space Age seD) is a CLI search and replace tool. Preview changes as colored diffs before applying — safe batch refactoring across files with regex support.
sad previews changes. Search, replace, see diffs — apply only when ready.
Installation
# macOS
brew install sad
# Cargo
cargo install sad
Usage
# Preview changes (dry run)
sad 'oldName' 'newName'
# Apply changes
sad --commit 'oldName' 'newName'
# Pipe specific files
fd -e rs | sad 'old_fn' 'new_fn'
fd -e js | sad --commit 'var ' 'const '
# Regex replace
sad 'fn\s+(\w+)' 'fn new_$1'
# With fzf preview
fd -e py | sad 'import os' 'from pathlib import Path' | fzf
Summary
- sad previews search/replace as colored diffs
- Regex support for complex patterns
- Pipe file lists from fd, find, or grep
- —commit to apply changes after review
- Written in Rust — fast across large codebases