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.

RuleDescription
git_addSuggest git add for untracked files
git_add_forceAdd -f flag for ignored files
git_bisect_usageFix git bisect command usage
git_branch_0flagFix branch flag typos
git_branch_deleteFix branch deletion syntax
git_branch_delete_checked_outHandle deleting current branch
git_branch_existsHandle existing branch names
git_branch_listFix git branch list to git branch
git_checkoutFix branch name typos in checkout
git_clone_missingSuggest cloning missing repositories
git_commit_addStage files before commit
git_commit_amendAmend commits properly
git_commit_message_editorFix commit message issues
git_commit_resetReset last commit
git_diff_stagedShow staged changes with --staged
git_fix_stashFix stash command syntax
git_flag_after_filenameMove flags before filenames
git_help_aliasedHandle aliased command help
git_hook_bypassBypass hooks with --no-verify
git_lfs_mistypeFix Git LFS typos
git_main_masterSwitch between main/master branches
git_merge_unrelatedAllow unrelated histories
git_not_commandFix git command typos
git_pullFix pull configuration issues
git_pull_cloneClone instead of pull for new repos
git_pull_uncommitted_changesStash before pull
git_pushSet upstream branch
git_push_different_branchPush to different branch names
git_push_forceForce push when needed
git_push_pullPull before push
git_push_without_commitsHandle empty push
git_rebase_merge_dirContinue/abort rebase
git_rebase_no_resolveFix rebase conflicts
git_remote_deleteDelete remote properly
git_remote_seturlFix remote URL syntax
git_rm_local_modificationsForce remove modified files
git_rm_recursiveRemove directories recursively
git_rm_stagedRemove staged files
git_stashFix stash operations
git_stash_popPop stash correctly
git_tag_forceForce create existing tags
git_tag_listList tags properly
git_two_dashesFix single-dash options

Package Managers

RuleDescription
apt_getFix apt/apt-get commands
apt_invalid_operationFix invalid apt operations
apt_list_upgradableShow upgradable packages
apt_upgradeRun apt upgrade properly
brew_cask_dependencyFix Homebrew cask deps
brew_installFix brew install
brew_reinstallReinstall existing packages
brew_uninstallFix uninstall commands
brew_unknown_commandFix brew command typos
brew_update_formulaUpdate formulas
cargoFix cargo command typos
cargo_no_commandFix unknown cargo commands
choco_installFix Chocolatey install
composer_not_commandFix Composer commands
conda_mistypeFix conda typos
cpan_not_installedInstall CPAN modules
dnf_no_such_commandFix dnf command typos
gem_unknown_commandFix gem commands
npmFix npm commands
npm_missing_scriptFix npm script names
npm_run_scriptAdd run for scripts
npm_wrong_commandFix npm command typos
pacmanFix pacman commands
pacman_not_foundSuggest package installs
pip_installFix pip install
pip_unknown_commandFix pip commands
yarn_command_not_foundFix yarn commands
yarn_command_replacedHandle deprecated yarn commands

Docker & Containers

RuleDescription
docker_image_being_usedHandle images in use
docker_loginFix docker login
docker_not_commandFix docker command typos
docker_compose_not_commandFix docker-compose typos
kubectl_not_commandFix kubectl typos

System Commands

RuleDescription
sudoAdd sudo for permission errors
cd_correctionFix directory name typos
cd_csFix cs to cd
cd_mkdirCreate directory then cd
cd_parentFix cd.. to cd ..
chmod_xMake scripts executable
cp_create_destinationCreate missing directories
cp_omitting_directoryAdd -r for directories
dirty_untarFix tar extraction
dryRemove duplicate commands
ln_no_hard_linkFix hard link errors
ln_s_orderFix symlink argument order
ls_lahFix ls flag typos
mkdir_pAdd -p for nested dirs
mv_forceForce move files
mv_no_targetFix missing target
rm_dirRemove directories with -r
rm_rootPrevent accidental root deletion
switch_langFix keyboard layout issues
touchFix touch command
unknown_commandSuggest similar commands

Cloud CLIs

RuleDescription
aws_cliFix AWS CLI commands
az_cliFix Azure CLI commands
gcloud_cliFix gcloud commands
heroku_multiple_appsSpecify Heroku app
heroku_not_commandFix Heroku command typos
terraform_initRun terraform init first
terraform_not_commandFix terraform typos
vagrant_upStart Vagrant VM first

Development Tools

RuleDescription
go_runFix go run commands
go_not_commandFix go command typos
gradle_wrapperUse gradlew instead
gradle_no_taskFix Gradle task names
java_classpathFix Java classpath
javacFix javac commands
maven_no_projectRun in project directory
maven_not_commandFix mvn command typos
python_commandFix python command issues
python_executeRun python scripts
python_module_errorInstall missing modules
sl_lsFix sl to ls
systemctlFix systemctl commands

Shell Utilities

RuleDescription
grep_argumentsFix grep argument order
grep_recursiveAdd -r for directories
historyFix history commands
manFix man page lookups
man_no_spaceAdd space in man command
sed_unterminatedFix sed expressions
ssh_known_hostsClear known_hosts entries
quotation_marksFix quote issues
no_commandGeneric command not found

Frameworks

RuleDescription
django_south_ghostFix Django migrations
django_south_mergeHandle migration conflicts
flask_runFix flask run commands
rails_migrations_pendingRun pending migrations
react_native_commandFix React Native commands

Miscellaneous

RuleDescription
adb_unknown_commandFix ADB commands
fab_command_not_foundFix Fabric commands
fix_fileFix file operations
lein_not_taskFix Leiningen tasks
openFix open command
prove_recursivelyAdd -r to prove
tmuxFix tmux commands
tsuru_not_commandFix tsuru commands
whoisFix whois lookups
Want to add a rule?

See the Creating Rules guide to contribute new corrections!