TL;DR — Quick Summary

amber is a code search and replace tool. Find regex patterns across files and replace them — with preview, confirmation, and git-safe workflow. sed for the modern age.

amber makes codebase-wide search and replace safe. Regex, preview, confirm — refactoring without fear.

Installation

# Cargo
cargo install amber

# Binary (GitHub releases)
# https://github.com/dalance/amber/releases

Usage

# Search for pattern in current directory
amber 'old_function'

# Search and replace (with preview)
amber 'old_function' 'new_function'

# Regex patterns
amber 'fn (\w+)_old' 'fn $1_new'

# Specific file types
amber 'TODO' --include '*.rs'
amber 'console\.log' --include '*.js,*.ts'

# Exclude directories
amber 'pattern' --exclude 'node_modules,target,.git'

# Case insensitive
amber 'pattern' 'replacement' --ignore-case

# Recursive (default)
amber 'pattern' 'replacement' path/to/dir

# Dry run (show changes without applying)
amber 'old' 'new' --no-interactive

Summary

  • amber searches and replaces across multiple files with regex support
  • Interactive preview shows every change before applying
  • Filter by file type, exclude directories
  • Capture groups in regex replacements
  • Written in Rust — fast, safe, designed for refactoring