TL;DR — Quick Summary
amber is a code search and replace tool. Find and replace across files with regex, preview changes, and apply them — like sed but with previews and safety.
amber finds and replaces across files. Preview before applying — safe refactoring.
Installation
# Cargo
cargo install amber
Usage
# Search for pattern
ambs 'old_function'
# Search and replace (preview)
ambs 'old_function' 'new_function'
# Filter by extension
ambs 'TODO' 'DONE' --include '*.rs'
# Exclude directories
ambs 'old' 'new' --exclude 'target,node_modules'
# Case insensitive
ambs -i 'pattern' 'replacement'
# Regex with capture groups
ambs 'fn (\w+)\(' 'fn ${1}_v2('
# Specific directory
ambs 'pattern' 'replacement' src/
Summary
- amber searches and replaces across files with preview
- Regex with capture groups for powerful refactoring
- Safe by default — preview before applying
- Include/exclude file filters
- Written in Rust — fast recursive search