All Rules
oops includes 177+ correction rules organized by category. All rules are enabled by default.
Disabling Rules
To disable specific rules, add them to exclude_rules in your config or set THEFUCK_EXCLUDE_RULES environment variable.
Git
Comprehensive Git corrections for common mistakes.
| Rule | Description |
git_add | Suggest git add for untracked files |
git_add_force | Add -f flag for ignored files |
git_bisect_usage | Fix git bisect command usage |
git_branch_0flag | Fix branch flag typos |
git_branch_delete | Fix branch deletion syntax |
git_branch_delete_checked_out | Handle deleting current branch |
git_branch_exists | Handle existing branch names |
git_branch_list | Fix git branch list to git branch |
git_checkout | Fix branch name typos in checkout |
git_clone_missing | Suggest cloning missing repositories |
git_commit_add | Stage files before commit |
git_commit_amend | Amend commits properly |
git_commit_message_editor | Fix commit message issues |
git_commit_reset | Reset last commit |
git_diff_staged | Show staged changes with --staged |
git_fix_stash | Fix stash command syntax |
git_flag_after_filename | Move flags before filenames |
git_help_aliased | Handle aliased command help |
git_hook_bypass | Bypass hooks with --no-verify |
git_lfs_mistype | Fix Git LFS typos |
git_main_master | Switch between main/master branches |
git_merge_unrelated | Allow unrelated histories |
git_not_command | Fix git command typos |
git_pull | Fix pull configuration issues |
git_pull_clone | Clone instead of pull for new repos |
git_pull_uncommitted_changes | Stash before pull |
git_push | Set upstream branch |
git_push_different_branch | Push to different branch names |
git_push_force | Force push when needed |
git_push_pull | Pull before push |
git_push_without_commits | Handle empty push |
git_rebase_merge_dir | Continue/abort rebase |
git_rebase_no_resolve | Fix rebase conflicts |
git_remote_delete | Delete remote properly |
git_remote_seturl | Fix remote URL syntax |
git_rm_local_modifications | Force remove modified files |
git_rm_recursive | Remove directories recursively |
git_rm_staged | Remove staged files |
git_stash | Fix stash operations |
git_stash_pop | Pop stash correctly |
git_tag_force | Force create existing tags |
git_tag_list | List tags properly |
git_two_dashes | Fix single-dash options |
Package Managers
| Rule | Description |
apt_get | Fix apt/apt-get commands |
apt_invalid_operation | Fix invalid apt operations |
apt_list_upgradable | Show upgradable packages |
apt_upgrade | Run apt upgrade properly |
brew_cask_dependency | Fix Homebrew cask deps |
brew_install | Fix brew install |
brew_reinstall | Reinstall existing packages |
brew_uninstall | Fix uninstall commands |
brew_unknown_command | Fix brew command typos |
brew_update_formula | Update formulas |
cargo | Fix cargo command typos |
cargo_no_command | Fix unknown cargo commands |
choco_install | Fix Chocolatey install |
composer_not_command | Fix Composer commands |
conda_mistype | Fix conda typos |
cpan_not_installed | Install CPAN modules |
dnf_no_such_command | Fix dnf command typos |
gem_unknown_command | Fix gem commands |
npm | Fix npm commands |
npm_missing_script | Fix npm script names |
npm_run_script | Add run for scripts |
npm_wrong_command | Fix npm command typos |
pacman | Fix pacman commands |
pacman_not_found | Suggest package installs |
pip_install | Fix pip install |
pip_unknown_command | Fix pip commands |
yarn_command_not_found | Fix yarn commands |
yarn_command_replaced | Handle deprecated yarn commands |
Docker & Containers
| Rule | Description |
docker_image_being_used | Handle images in use |
docker_login | Fix docker login |
docker_not_command | Fix docker command typos |
docker_compose_not_command | Fix docker-compose typos |
kubectl_not_command | Fix kubectl typos |
System Commands
| Rule | Description |
sudo | Add sudo for permission errors |
cd_correction | Fix directory name typos |
cd_cs | Fix cs to cd |
cd_mkdir | Create directory then cd |
cd_parent | Fix cd.. to cd .. |
chmod_x | Make scripts executable |
cp_create_destination | Create missing directories |
cp_omitting_directory | Add -r for directories |
dirty_untar | Fix tar extraction |
dry | Remove duplicate commands |
ln_no_hard_link | Fix hard link errors |
ln_s_order | Fix symlink argument order |
ls_lah | Fix ls flag typos |
mkdir_p | Add -p for nested dirs |
mv_force | Force move files |
mv_no_target | Fix missing target |
rm_dir | Remove directories with -r |
rm_root | Prevent accidental root deletion |
switch_lang | Fix keyboard layout issues |
touch | Fix touch command |
unknown_command | Suggest similar commands |
Cloud CLIs
| Rule | Description |
aws_cli | Fix AWS CLI commands |
az_cli | Fix Azure CLI commands |
gcloud_cli | Fix gcloud commands |
heroku_multiple_apps | Specify Heroku app |
heroku_not_command | Fix Heroku command typos |
terraform_init | Run terraform init first |
terraform_not_command | Fix terraform typos |
vagrant_up | Start Vagrant VM first |
| Rule | Description |
go_run | Fix go run commands |
go_not_command | Fix go command typos |
gradle_wrapper | Use gradlew instead |
gradle_no_task | Fix Gradle task names |
java_classpath | Fix Java classpath |
javac | Fix javac commands |
maven_no_project | Run in project directory |
maven_not_command | Fix mvn command typos |
python_command | Fix python command issues |
python_execute | Run python scripts |
python_module_error | Install missing modules |
sl_ls | Fix sl to ls |
systemctl | Fix systemctl commands |
Shell Utilities
| Rule | Description |
grep_arguments | Fix grep argument order |
grep_recursive | Add -r for directories |
history | Fix history commands |
man | Fix man page lookups |
man_no_space | Add space in man command |
sed_unterminated | Fix sed expressions |
ssh_known_hosts | Clear known_hosts entries |
quotation_marks | Fix quote issues |
no_command | Generic command not found |
Frameworks
| Rule | Description |
django_south_ghost | Fix Django migrations |
django_south_merge | Handle migration conflicts |
flask_run | Fix flask run commands |
rails_migrations_pending | Run pending migrations |
react_native_command | Fix React Native commands |
Miscellaneous
| Rule | Description |
adb_unknown_command | Fix ADB commands |
fab_command_not_found | Fix Fabric commands |
fix_file | Fix file operations |
lein_not_task | Fix Leiningen tasks |
open | Fix open command |
prove_recursively | Add -r to prove |
tmux | Fix tmux commands |
tsuru_not_command | Fix tsuru commands |
whois | Fix whois lookups |