· license
MIT · community preservation fork
A community revival of nvbn/thefuck — where the community's fixes finally merge.
The name Zhifei (知非) comes from the ancient Chinese sage Qu Boyu: "at fifty, I knew the wrongs of my forty-nine years." To know one's errors and correct them — that is exactly what this tool does, one command at a time.
TheFuck corrects your previous console command when you mistype it. It was one of the most beloved CLI tools ever made (98k+ stars) — and then it stopped installing: the last PyPI release shipped in January 2022, and current Python (3.12+) can no longer run it. Meanwhile the community kept filing fixes: 156 open pull requests, the oldest since 2017, 24 of them in the last six months alone. This fork exists to land them.
| What's stuck upstream | What we do here |
|---|---|
The tool doesn't install on Python 3.12+ (distutils/imp/pkg_resources removed) — 19 PRs fix this same breakage |
Fix first — a tool you can't install helps no one |
Safety gaps (rm /, cwd escapes in dirty_unzip) |
Land early — destructive-command safety is not optional |
| 28 real bug fixes unmerged | Absorb with full attribution |
| 39 new correction rules (apt 3.0, nushell, nix-shell, terraform, …) | One best implementation per rule, all authors credited |
| 27 near-duplicate dependency bumps | One modernized dependency set, author credited |
| 533 contributors unacknowledged | Full credit roll in ACKNOWLEDGMENTS.md |
- Triage matrix v1.0: all 156 open PRs dispositioned — docs/TRIAGE-MATRIX.md
- Absorption ledger: every absorbed PR mapped to its source — docs/ABSORPTION-LEDGER.md
- Original README preserved unchanged — docs/README-upstream.md
- MIT License preserved (Copyright (c) 2015-2022 Vladimir Iakovlev). This fork is not affiliated with or endorsed by the upstream author.
If you had a PR or issue upstream: your fixes have a place where they can actually merge. Open an issue or PR here referencing your upstream number (e.g. upstream #1639) and we will prioritize it — installation breakage and safety fixes land first.
When adding a new rule, write unit tests for it under tests/rules/ and add the rule name to the list below — the test suite enforces that every bundled rule appears in this README. (Absorbs #1294, author nkakonas.)
WSL tip: if fuck feels slow under Windows Subsystem for Linux, add excluded_search_path_prefixes = ['/mnt/'] to your settings.py — scanning Windows-mounted paths is a major slowdown. (Absorbs #1517, author stuartleeks.)
Same as upstream — see docs/README-upstream.md for the full manual:
➜ apt-get install vim
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
➜ fuck
sudo apt-get install vim [enter/↑/↓/ctrl+c]The bundled fix rules (community revival of thefuck's rule set):
adb_unknown_commandag_literalapt_getapt_get_searchapt_invalid_operationapt_list_upgradableapt_unable_to_locateapt_upgradeaws_cliaz_clibrew_cask_dependencybrew_installbrew_linkbrew_reinstallbrew_uninstallbrew_unknown_commandbrew_update_formulacargocargo_no_commandcat_dircd_correctioncd_cscd_mkdircd_parentcd_quoteschdirchatgptchmod_xchoco_installcomposer_not_commandcomposer_not_packageconda_mistypecp_create_destinationcp_omitting_directorycpp11dirty_untardirty_unzipdjango_south_ghostdjango_south_mergednf_no_such_commandeslintdocker_daemon_not_runningdocker_image_being_used_by_containerdocker_logindocker_not_commanddryedit_filenamefab_command_not_foundfix_alt_spacefix_filegcloud_cligem_unknown_commandgit-checkout-master-no-gitgit-commit-no-gitgit-status-no-gitgit_addgit_add_-a_-Agit_add_forcegit_add_forgot_gitgit_add_no_gitgit_bisect_usagegit_branch_0flaggit_branch_deletegit_branch_delete_checked_outgit_branch_existsgit_branch_listgit_checkoutgit_clone_git_clonegit_clone_missinggit_commit_addgit_commit_amendgit_commit_resetgit_direct_commitgit_diff_no_indexgit_diff_stagedgit_fix_stashgit_flag_after_filenamegit_help_aliasedgit_hook_bypassgit_init_no_gitgit_lfs_mistypegit_loggit_main_mastergit_mergegit_merge_originmain_mistakegit_merge_unrelatedgit_not_commandgit_pullgit_pull_clonegit_pull_uncommitted_changesgit_pushgit_push_different_branch_namesgit_push_forcegit_push_origin_slash_main_mistakegit_push_pullgit_push_without_commitsgit_rebase_merge_dirgit_rebase_no_changesgit_remote_deletegit_remote_seturl_addgit_rm_local_modificationsgit_rm_recursivegit_rm_stagedgit_stashgit_stash_popgit_tag_forcegit_two_dashesgo_rungo_unknown_commandgradle_no_taskgradle_wrappergrep_arguments_ordergrep_recursivegrunt_task_not_foundgulp_not_taskhas_exists_scriptheroku_multiple_appsheroku_not_commandhistoryhostscliifconfig_device_not_foundinstall_packagesjavajavackedro_no_such_commandlein_not_taskln_no_hard_linkln_s_orderlong_form_helpls_allls_lahmakefilemanman_no_spacemdtmercurialmissing_space_before_subcommandmkdir_pmvn_no_commandmvn_unknown_lifecycle_phaseninjanix_shellnixos_cmd_not_foundno_commandno_such_filenpm_missing_scriptnpm_run_scriptnpm_wrong_commandnpx_add_npx_to_commandomnienv_no_such_commandopenpacmanpacman_invalid_optionpacman_not_foundpamac_invalid_operationpath_from_historyphp_spingpip_externally_managedpip_installpip_unknown_commandport_already_in_useprove_recursivelypython_commandpython_executepython_module_errorquotation_marksrails_migrations_pendingrbenv_installreact_native_command_unrecognizedremove_shell_prompt_literalremove_trailing_cedillarestic_typormrm_dirrm_rootscm_correctionsed_unterminated_ssl_lssmart_command_suggestionssh_known_hostssusudosudo_command_from_user_pathswitch_langsystemctltar_missed_argumentterraform_initterraform_init_upgradeterraform_no_commandtest.pytmuxtouchtsuru_logintsuru_not_commandunknown_commanduninstall_thefuckunsudoupper_to_lower_casevagrant_upversionwhoisworkon_doesnt_existswrong_hyphen_before_subcommandxcode_licenseyarn_aliasyarn_command_not_foundyarn_command_replacedyarn_helpyum_invalid_operation