
June 24, 2026 · 9:22 AM
swpui: the search-and-replace TUI your terminal workflow is missing
swpui (Rust, MIT/Apache-2.0, v0.9.0, 51★) — a case-aware search-and-replace TUI with per-file preview and zero runtime deps.
sed -i 's/foo/bar/g' **/*.rs works until it doesn't. You rename a function across a codebase and three hours later you find FooHandler, fooHandler, and FOO_HANDLER still littering the diff. sed doesn't know about case variants. Your IDE's find-and-replace does — but that assumes you want to open an IDE.swpui (pronounced "swap UI") is a Rust TUI by Valentin Bersier that brings VS Code-style search-and-replace to the terminal, with case-aware replacement, per-match preview, and batch confirmation — and no runtime dependencies. 1
Loading content card…
Install
Four paths, all one-liners: 1
# Cargo (any platform with Rust toolchain)
cargo install swpui
# cargo-binstall (skips compile, downloads pre-built binary)
cargo binstall swpui
# Nix
nix profile install nixpkgs#swpui
# Arch Linux (AUR)
yay -S swpui-binNo Homebrew formula yet. macOS users without Nix will go through Cargo — a single compile, no ongoing dependency. Pre-built binaries for five platforms are available on GitHub Releases if you'd rather download directly. The binary is ~1.2 MB. 1
What it does
The binary is called
swp. Run it in any directory and it opens a split-pane TUI: a search box, a replace box, a scrollable file list with match counts per file, and a preview panel showing the diff in context. 1swpui v0.9.0 — live preview of a
hash → sha256 replacement across 14 files. 1Four search modes are available: literal, regex, case-insensitive regex, and multiline regex. The case-aware mode is the one that makes the tool worth mentioning. When enabled, it detects whether a matched token is in
snake_case, camelCase, PascalCase, UPPER_SNAKE, kebab-case, or Flat — and applies the replacement in the same case. Rename worker to executor and you get executor, Executor, EXECUTOR, and executor_pool without writing six separate sed commands. 2Navigation is keyboard-driven:
j/k move through files, Enter applies all matches in the current file, Space skips the file, f applies the entire file at once, s skips. This per-file review flow is the practical difference from a one-shot sed -i or rg --replace: you can stop mid-operation, inspect a tricky file, and decide not to touch it — without canceling the whole batch.Regex capture groups work:
$0–$9 reference captured groups in the replacement pattern, the same syntax as most editors. 1 The tool respects .gitignore, .ignore, and a .swpignore file if you need to exclude generated files per project.A concrete scenario
You're renaming a Rust type from
FileHash to ContentDigest across a mid-size codebase. The type appears in doc comments, struct names, function names, and variable names — all different cases.cd my-project
swp
# In the TUI:
# Search: FileHash (case-aware mode: on)
# Replace: ContentDigestswpui scans the directory (honoring
.gitignore), shows you 14 files with 80 total matches, and opens a preview for each. You navigate through the list, confirm the source files, skip the auto-generated Cargo.lock entry, and press Enter on each file. The whole operation takes about two minutes and you saw every change before it landed.The author built swpui after finding
serpl — the nearest equivalent — stopped being maintained and required ripgrep and ast-grep as runtime dependencies. "The main feature I wanted to have is immediate feedback for the search query, which is also why I didn't stick with tools like fastmod and repgrep," Bersier wrote on Hacker News. 3How it compares
| Tool | Interactive preview | Case-aware replace | No runtime deps | Notes |
|---|---|---|---|---|
| swpui | ✓ per-file | ✓ 6 case variants | ✓ | v0.9.0, MIT/Apache-2.0 |
sed -i | ✗ | ✗ | ✓ | scriptable, composable, no visual feedback |
fastmod (Facebook) | ✗ | ✗ | ✓ | interactive confirm but no preview panel |
repgrep | partial | ✗ | ✓ | ripgrep-powered, no live diff preview |
serpl | ✓ | ✓ | ✗ | requires ripgrep + ast-grep; maintenance stalled |
Community signal and caveats
Honest answer: it's thin. The Show HN post in May 2026 got 3 points and one comment. 3 Reddit and Lobsters have zero threads. The star count jumped from 40 to 51 (+28%) in 24 hours, likely driven by the author's mention in "Ask HN: What are you working on? (June 2026)."
The one meaningful external signal: Orhun Parmaksız — ratatui co-maintainer and JetBrains Rust Developer Advocate — recommended swpui on X as an example of "ratatui apps as part of development workflow." That's not community consensus, but it's a credible technical signal from someone who reads a lot of ratatui code. 4
Loading content card…
The case-detection algorithm has known limits. Bersier notes it "will certainly have false positives" and covers common cases rather than claiming completeness. 2 For straightforward renames in well-structured codebases this is fine; for tightly coupled identifier systems with non-standard casing conventions, test on a branch first.
crates.io shows 328 total downloads across 14 published versions as of this writing — early adoption territory. 5
Quick-reference specs
All values from GitHub as of 2026-06-24. 1
Loading content card…
| Field | Value |
|---|---|
| Repo | github.com/beeb/swpui |
| Version | v0.9.0 (released 2026-06-13) |
| Language | Rust (99.2%) |
| License | MIT OR Apache-2.0 |
| Stars | 51 ★ (+11 in 24h) |
| Commits | 122 |
| Binary name | swp |
| Install (Rust toolchain) | cargo install swpui |
| Install (no compile) | cargo binstall swpui |
| Platforms | Linux, macOS, Windows (pre-built binaries on Releases) |
| MSRV | Rust 1.94.1 |
Adopt / try / skip
Adopt if you do frequent cross-file renames in terminal-first workflows and find yourself reaching for
sed + a manual review pass anyway. swpui collapses those two steps.Try if you're skeptical —
cargo binstall swpui gets you a binary in under 30 seconds, no compile time. Run it once on a non-critical rename and see if the preview workflow fits.Skip if your IDE's find-and-replace already covers what you need, or if you're on a project where LSP-aware refactoring (symbol rename) is the right tool. swpui is text-based, not AST-aware — it won't know that
hash in a string literal is different from hash as a type name.Cover image: screenshot from beeb/swpui, MIT OR Apache-2.0
Related content

5条科技热门 Day 005 | Zed 1.0 · Warp 爆星 · Linux 提权
5条科技热门内容·Image post·
Auto Import Plus: a Rust daemon that fixes auto-import in your TypeScript/Python/Java monorepo
VS Code / JetBrains Plugin Pick·Article·
Ruby LSP — the VS Code extension that now runs a Rust engine under the hood
VS Code / JetBrains Plugin Pick·Article·

Add more perspectives or context around this Post.