A blazingly fast command-line typo corrector written in Rust.
$ git psuh
git: 'psuh' is not a git command. Did you mean 'push'?
$ oops
git push [enter/up/down/ctrl+c]- 175+ correction rules for common CLI mistakes
- Sub-50ms startup time - 10x faster than Python alternatives
- Single binary - no runtime dependencies
- Cross-platform - Linux, macOS, Windows
- Shell integration - Bash, Zsh, Fish, PowerShell, Tcsh
Download the appropriate binary for your system from GitHub Releases:
| Platform | Architecture | Binary |
|---|---|---|
| Linux | x86_64 | oops-linux-x86_64 |
| Linux | x86_64 (static) | oops-linux-x86_64-musl |
| Linux | ARM64 | oops-linux-aarch64 |
| macOS | Intel | oops-darwin-x86_64 |
| macOS | Apple Silicon | oops-darwin-aarch64 |
| Windows | x86_64 | oops-windows-x86_64.exe |
# Download (example for Linux x86_64)
curl -LO https://github.com/animeshkundu/oops/releases/latest/download/oops-linux-x86_64
# Make executable
chmod +x oops-linux-x86_64
# Move to PATH
sudo mv oops-linux-x86_64 /usr/local/bin/oops
# Verify installation
oops --version# Download using PowerShell
Invoke-WebRequest -Uri "https://github.com/animeshkundu/oops/releases/latest/download/oops-windows-x86_64.exe" -OutFile "oops.exe"
# Move to a directory in your PATH, or add to PATH
mkdir -Force "$env:USERPROFILE\bin"
Move-Item oops.exe "$env:USERPROFILE\bin\oops.exe"
# Add to PATH (run once)
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\bin", "User")cargo install --git https://github.com/animeshkundu/oops# Homebrew (macOS/Linux)
brew install animeshkundu/tap/oops
# Cargo (from crates.io when published)
cargo install oops
# Arch Linux (AUR)
yay -S oops
# Windows (Scoop)
scoop bucket add extras
scoop install oopsAfter installing oops, add the shell integration to your config file:
Add to ~/.bashrc:
eval "$(oops --alias)"Reload: source ~/.bashrc
Add to ~/.zshrc:
eval "$(oops --alias)"Reload: source ~/.zshrc
Add to ~/.config/fish/config.fish:
oops --alias | sourceReload: source ~/.config/fish/config.fish
Add to your PowerShell profile ($PROFILE):
Invoke-Expression (oops --alias | Out-String)To find your profile location: echo $PROFILE
Reload: . $PROFILE
Add to ~/.tcshrc:
eval `oops --alias`Reload: source ~/.tcshrc
To use a different alias (e.g., fuck for thefuck compatibility):
# Bash/Zsh
eval "$(TF_ALIAS=fuck oops --alias)"
# Fish
TF_ALIAS=fuck oops --alias | source
# PowerShell
$env:TF_ALIAS="fuck"; Invoke-Expression (oops --alias | Out-String)
# Tcsh
setenv TF_ALIAS fuck && eval `oops --alias`| Shell | Config File | Integration Command | Reload Command |
|---|---|---|---|
| Bash | ~/.bashrc |
eval "$(oops --alias)" |
source ~/.bashrc |
| Zsh | ~/.zshrc |
eval "$(oops --alias)" |
source ~/.zshrc |
| Fish | ~/.config/fish/config.fish |
oops --alias | source |
source ~/.config/fish/config.fish |
| PowerShell | $PROFILE |
Invoke-Expression (oops --alias | Out-String) |
. $PROFILE |
| Tcsh | ~/.tcshrc |
eval `oops --alias` |
source ~/.tcshrc |
Just type oops after a failed command:
$ git statis
git: 'statis' is not a git command. Did you mean 'status'?
$ oops
git status [enter/up/down/ctrl+c]Use -y to automatically execute the first suggestion:
$ oops -yWhen multiple corrections are available:
- Up/Down arrows or j/k - Navigate options
- Enter - Execute selected command
- Ctrl+C - Cancel
Create ~/.config/oops/config.toml:
# Enable/disable rules
rules = ["ALL"]
exclude_rules = []
# Require confirmation before execution
require_confirmation = true
# Command timeout in seconds
wait_command = 3
wait_slow_command = 15
# Disable colors
no_colors = false
# Number of suggestions to show
num_close_matches = 3
# Commands that take longer to run
slow_commands = ["lein", "react-native", "gradle", "vagrant"]All settings can be overridden via environment variables:
| Variable | Description |
|---|---|
THEFUCK_RULES |
Colon-separated list of enabled rules |
THEFUCK_EXCLUDE_RULES |
Rules to disable |
THEFUCK_REQUIRE_CONFIRMATION |
true or false |
THEFUCK_WAIT_COMMAND |
Timeout in seconds |
THEFUCK_DEBUG |
Enable debug output |
Oops requires Rust 1.88 or newer to build.
oops includes 175+ rules for common mistakes:
git_push- Set upstream branchgit_checkout- Fix branch name typosgit_add- Add untracked filesgit_commit_amend- Amend commits- ... and 45+ more git rules
- APT, Brew, Cargo, npm, pip, Pacman, dnf, yum, conda, gem, choco
sudo- Add sudo for permission errorscd_mkdir- Create directory before cdchmod_x- Make scripts executablemkdir_p- Add -p flag to mkdir
- Go, Java, Maven, Gradle, Terraform, Docker, Kubernetes
- Shell utilities, cloud CLIs (AWS, Azure), frameworks (Rails, React Native)
See the full rules list for details.
If you're coming from the Python thefuck:
- Shell alias: Change
fucktooopsin your shell config (or useTF_ALIAS=fuck) - Config format: Use TOML instead of Python (
config.tomlinstead ofsettings.py) - Environment variables: Same names, fully compatible
See the migration guide for details.
| Metric | oops (Rust) | thefuck (Python) |
|---|---|---|
| Startup time | ~30ms | ~300ms |
| Binary size | ~5MB | N/A (requires Python) |
| Memory usage | ~10MB | ~50MB |
Contributions are welcome! See CONTRIBUTING.md for guidelines.
- Create a new struct implementing the
Ruletrait - Add it to the appropriate module in
src/rules/ - Register it in
src/rules/mod.rs - Add tests
MIT License - see LICENSE for details.
oops is inspired by thefuck by Vladimir Iakovlev. Configuration environment variables are backward compatible for easy migration.