Shell Integration
After installing oops, you need to add shell integration to make the oops command available. This sets up an alias that captures your previous command when something goes wrong.
Quick Reference
| Shell | Config File | Command |
|---|---|---|
| Bash | ~/.bashrc |
eval "$(oops --alias)" |
| Zsh | ~/.zshrc |
eval "$(oops --alias)" |
| Fish | ~/.config/fish/config.fish |
oops --alias | source |
| PowerShell | $PROFILE |
Invoke-Expression (oops --alias | Out-String) |
| Tcsh | ~/.tcshrc |
eval `oops --alias` |
Bash
Add the following line to your ~/.bashrc:
eval "$(oops --alias)"
Then reload your configuration:
source ~/.bashrc
Zsh
Add the following line to your ~/.zshrc:
eval "$(oops --alias)"
Then reload your configuration:
source ~/.zshrc
If you use Oh My Zsh, add the line after the source $ZSH/oh-my-zsh.sh line.
Fish
Add the following line to your ~/.config/fish/config.fish:
oops --alias | source
Then reload your configuration:
source ~/.config/fish/config.fish
PowerShell
Add the following line to your PowerShell profile ($PROFILE):
Invoke-Expression (oops --alias | Out-String)
To find your profile location:
echo $PROFILE
Then reload your profile:
. $PROFILE
If your profile doesn't exist, create it with: New-Item -Path $PROFILE -ItemType File -Force
Tcsh
Add the following line to your ~/.tcshrc:
eval `oops --alias`
Then reload your configuration:
source ~/.tcshrc
Custom Alias Name
By default, the alias is named oops. You can use a different name by setting the TF_ALIAS environment variable:
Bash/Zsh
eval "$(TF_ALIAS=fuck oops --alias)"
This creates a fuck command instead of oops.
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`
Using TF_ALIAS=fuck makes oops fully compatible with your muscle memory from thefuck!
Usage
Once set up, simply type oops after a failed command:
$ git psuh
git: 'psuh' is not a git command. Did you mean 'push'?
$ oops
git push [enter/↑/↓/ctrl+c]
Keyboard Shortcuts
- Enter — Execute the selected correction
- ↑/↓ or j/k — Navigate between suggestions
- Ctrl+C — Cancel
Auto-Execute
Use -y to automatically execute the first suggestion:
$ oops -y
Troubleshooting
Command not found
If you see "command not found: oops", ensure the binary is in your PATH:
# Check if oops is accessible
which oops
# If not, add the installation directory to your PATH
export PATH="/usr/local/bin:$PATH"
Shell not detected
If oops doesn't detect your shell correctly, set it explicitly:
export TF_SHELL=zsh
Alias not working
Make sure you've reloaded your shell configuration or opened a new terminal window after adding the integration line.