Skip to content
tanbopiaoPublic

About

Zhifei (知非) — a community revival of The Fuck: named for the sage Qu Boyu, "at fifty, knew the wrongs of forty-nine years." Where the community's 156 unmerged fixes finally merge.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

1,676 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

知非 (Zhifei)

upstream · 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.

Why this fork

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

Status

  • 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.

For contributors

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.)

Usage

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]

Rules

The bundled fix rules (community revival of thefuck's rule set):

  • adb_unknown_command
  • ag_literal
  • apt_get
  • apt_get_search
  • apt_invalid_operation
  • apt_list_upgradable
  • apt_unable_to_locate
  • apt_upgrade
  • aws_cli
  • az_cli
  • brew_cask_dependency
  • brew_install
  • brew_link
  • brew_reinstall
  • brew_uninstall
  • brew_unknown_command
  • brew_update_formula
  • cargo
  • cargo_no_command
  • cat_dir
  • cd_correction
  • cd_cs
  • cd_mkdir
  • cd_parent
  • cd_quotes
  • chdir
  • chatgpt
  • chmod_x
  • choco_install
  • composer_not_command
  • composer_not_package
  • conda_mistype
  • cp_create_destination
  • cp_omitting_directory
  • cpp11
  • dirty_untar
  • dirty_unzip
  • django_south_ghost
  • django_south_merge
  • dnf_no_such_command
  • eslint
  • docker_daemon_not_running
  • docker_image_being_used_by_container
  • docker_login
  • docker_not_command
  • dry
  • edit_filename
  • fab_command_not_found
  • fix_alt_space
  • fix_file
  • gcloud_cli
  • gem_unknown_command
  • git-checkout-master-no-git
  • git-commit-no-git
  • git-status-no-git
  • git_add
  • git_add_-a_-A
  • git_add_force
  • git_add_forgot_git
  • git_add_no_git
  • git_bisect_usage
  • git_branch_0flag
  • git_branch_delete
  • git_branch_delete_checked_out
  • git_branch_exists
  • git_branch_list
  • git_checkout
  • git_clone_git_clone
  • git_clone_missing
  • git_commit_add
  • git_commit_amend
  • git_commit_reset
  • git_direct_commit
  • git_diff_no_index
  • git_diff_staged
  • git_fix_stash
  • git_flag_after_filename
  • git_help_aliased
  • git_hook_bypass
  • git_init_no_git
  • git_lfs_mistype
  • git_log
  • git_main_master
  • git_merge
  • git_merge_originmain_mistake
  • git_merge_unrelated
  • git_not_command
  • git_pull
  • git_pull_clone
  • git_pull_uncommitted_changes
  • git_push
  • git_push_different_branch_names
  • git_push_force
  • git_push_origin_slash_main_mistake
  • git_push_pull
  • git_push_without_commits
  • git_rebase_merge_dir
  • git_rebase_no_changes
  • git_remote_delete
  • git_remote_seturl_add
  • git_rm_local_modifications
  • git_rm_recursive
  • git_rm_staged
  • git_stash
  • git_stash_pop
  • git_tag_force
  • git_two_dashes
  • go_run
  • go_unknown_command
  • gradle_no_task
  • gradle_wrapper
  • grep_arguments_order
  • grep_recursive
  • grunt_task_not_found
  • gulp_not_task
  • has_exists_script
  • heroku_multiple_apps
  • heroku_not_command
  • history
  • hostscli
  • ifconfig_device_not_found
  • install_packages
  • java
  • javac
  • kedro_no_such_command
  • lein_not_task
  • ln_no_hard_link
  • ln_s_order
  • long_form_help
  • ls_all
  • ls_lah
  • makefile
  • man
  • man_no_space
  • mdt
  • mercurial
  • missing_space_before_subcommand
  • mkdir_p
  • mvn_no_command
  • mvn_unknown_lifecycle_phase
  • ninja
  • nix_shell
  • nixos_cmd_not_found
  • no_command
  • no_such_file
  • npm_missing_script
  • npm_run_script
  • npm_wrong_command
  • npx_add_npx_to_command
  • omnienv_no_such_command
  • open
  • pacman
  • pacman_invalid_option
  • pacman_not_found
  • pamac_invalid_operation
  • path_from_history
  • php_s
  • ping
  • pip_externally_managed
  • pip_install
  • pip_unknown_command
  • port_already_in_use
  • prove_recursively
  • python_command
  • python_execute
  • python_module_error
  • quotation_marks
  • rails_migrations_pending
  • rbenv_install
  • react_native_command_unrecognized
  • remove_shell_prompt_literal
  • remove_trailing_cedilla
  • restic_typo
  • rm
  • rm_dir
  • rm_root
  • scm_correction
  • sed_unterminated_s
  • sl_ls
  • smart_command_suggestion
  • ssh_known_hosts
  • su
  • sudo
  • sudo_command_from_user_path
  • switch_lang
  • systemctl
  • tar_missed_argument
  • terraform_init
  • terraform_init_upgrade
  • terraform_no_command
  • test.py
  • tmux
  • touch
  • tsuru_login
  • tsuru_not_command
  • unknown_command
  • uninstall_thefuck
  • unsudo
  • upper_to_lower_case
  • vagrant_up
  • version
  • whois
  • workon_doesnt_exists
  • wrong_hyphen_before_subcommand
  • xcode_license
  • yarn_alias
  • yarn_command_not_found
  • yarn_command_replaced
  • yarn_help
  • yum_invalid_operation

About

Zhifei (知非) — a community revival of The Fuck: named for the sage Qu Boyu, "at fifty, knew the wrongs of forty-nine years." Where the community's 156 unmerged fixes finally merge.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages