[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-341":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},341,"thefuck","nvbn\u002Fthefuck","nvbn","Magnificent app which corrects your previous console command.","",null,"Python",97359,3948,813,304,0,12,70,395,56,100,"MIT License",false,"master",true,[27,28],"python","shell","2026-06-17 04:00:02","# The Fuck [![Version][version-badge]][version-link] [![Build Status][workflow-badge]][workflow-link] [![Coverage][coverage-badge]][coverage-link] [![MIT License][license-badge]](LICENSE.md)\n\n*The Fuck* is a magnificent app, inspired by a [@liamosaur](https:\u002F\u002Ftwitter.com\u002Fliamosaur\u002F)\n[tweet](https:\u002F\u002Ftwitter.com\u002Fliamosaur\u002Fstatus\u002F506975850596536320),\nthat corrects errors in previous console commands.\n\n\nIs *The Fuck* too slow? [Try the experimental instant mode!](#experimental-instant-mode)\n\n[![gif with examples][examples-link]][examples-link]\n\nMore examples:\n\n```bash\n➜ apt-get install vim\nE: Could not open lock file \u002Fvar\u002Flib\u002Fdpkg\u002Flock - open (13: Permission denied)\nE: Unable to lock the administration directory (\u002Fvar\u002Flib\u002Fdpkg\u002F), are you root?\n\n➜ fuck\nsudo apt-get install vim [enter\u002F↑\u002F↓\u002Fctrl+c]\n[sudo] password for nvbn:\nReading package lists... Done\n...\n```\n\n```bash\n➜ git push\nfatal: The current branch master has no upstream branch.\nTo push the current branch and set the remote as upstream, use\n\n    git push --set-upstream origin master\n\n\n➜ fuck\ngit push --set-upstream origin master [enter\u002F↑\u002F↓\u002Fctrl+c]\nCounting objects: 9, done.\n...\n```\n\n```bash\n➜ puthon\nNo command 'puthon' found, did you mean:\n Command 'python' from package 'python-minimal' (main)\n Command 'python' from package 'python3' (main)\nzsh: command not found: puthon\n\n➜ fuck\npython [enter\u002F↑\u002F↓\u002Fctrl+c]\nPython 3.4.2 (default, Oct  8 2014, 13:08:17)\n...\n```\n\n```bash\n➜ git brnch\ngit: 'brnch' is not a git command. See 'git --help'.\n\nDid you mean this?\n    branch\n\n➜ fuck\ngit branch [enter\u002F↑\u002F↓\u002Fctrl+c]\n* master\n```\n\n```bash\n➜ lein rpl\n'rpl' is not a task. See 'lein help'.\n\nDid you mean this?\n         repl\n\n➜ fuck\nlein repl [enter\u002F↑\u002F↓\u002Fctrl+c]\nnREPL server started on port 54848 on host 127.0.0.1 - nrepl:\u002F\u002F127.0.0.1:54848\nREPL-y 0.3.1\n...\n```\n\nIf you're not afraid of blindly running corrected commands, the\n`require_confirmation` [settings](#settings) option can be disabled:\n\n```bash\n➜ apt-get install vim\nE: Could not open lock file \u002Fvar\u002Flib\u002Fdpkg\u002Flock - open (13: Permission denied)\nE: Unable to lock the administration directory (\u002Fvar\u002Flib\u002Fdpkg\u002F), are you root?\n\n➜ fuck\nsudo apt-get install vim\n[sudo] password for nvbn:\nReading package lists... Done\n...\n```\n\n## Contents\n\n1. [Requirements](#requirements)\n2. [Installations](#installation)\n3. [Updating](#updating)\n4. [How it works](#how-it-works)\n5. [Creating your own rules](#creating-your-own-rules)\n6. [Settings](#settings)\n7. [Third party packages with rules](#third-party-packages-with-rules)\n8. [Experimental instant mode](#experimental-instant-mode)\n9. [Developing](#developing)\n10. [License](#license-mit)\n\n## Requirements\n\n- python (3.5+)\n- pip\n- python-dev\n\n##### [Back to Contents](#contents)\n\n## Installation\n\nOn macOS or Linux, you can install *The Fuck* via [Homebrew][homebrew]:\n\n```bash\nbrew install thefuck\n```\n\nOn Ubuntu \u002F Mint, install *The Fuck* with the following commands:\n```bash\nsudo apt update\nsudo apt install python3-dev python3-pip python3-setuptools\npip3 install thefuck --user\n```\n\nOn FreeBSD, install *The Fuck* with the following commands:\n```bash\npkg install thefuck\n```\n\nOn ChromeOS, install *The Fuck* using [chromebrew](https:\u002F\u002Fgithub.com\u002Fskycocker\u002Fchromebrew) with the following command:\n```bash\ncrew install thefuck\n```\n\nOn Arch based systems, install *The Fuck* with the following command:\n```\nsudo pacman -S thefuck\n```\n\nOn other systems, install *The Fuck*  by using `pip`:\n\n```bash\npip install thefuck\n```\n\n[Alternatively, you may use an OS package manager (OS X, Ubuntu, Arch).](https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Fwiki\u002FInstallation)\n\n\u003Ca href='#manual-installation' name='manual-installation'>#\u003C\u002Fa>\nIt is recommended that you place this command in your `.bash_profile`,\n`.bashrc`, `.zshrc` or other startup script:\n\n```bash\neval $(thefuck --alias)\n# You can use whatever you want as an alias, like for Mondays:\neval $(thefuck --alias FUCK)\n```\n\n[Or in your shell config (Bash, Zsh, Fish, Powershell, tcsh).](https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Fwiki\u002FShell-aliases)\n\nChanges are only available in a new shell session. To make changes immediately\navailable, run `source ~\u002F.bashrc` (or your shell config file like `.zshrc`).\n\nTo run fixed commands without confirmation, use the `--yeah` option (or just `-y` for short, or `--hard` if you're especially frustrated):\n\n```bash\nfuck --yeah\n```\n\nTo fix commands recursively until succeeding, use the `-r` option:\n\n```bash\nfuck -r\n```\n\n##### [Back to Contents](#contents)\n\n## Updating\n\n```bash\npip3 install thefuck --upgrade\n```\n\n**Note: Alias functionality was changed in v1.34 of *The Fuck***\n\n## Uninstall\n\nTo remove *The Fuck*, reverse the installation process:\n- erase or comment *thefuck* alias line from your Bash, Zsh, Fish, Powershell, tcsh, ... shell config\n- use your package manager (brew, pip3, pkg, crew, pip) to uninstall the binaries\n\n## How it works\n\n*The Fuck* attempts to match the previous command with a rule. If a match is\nfound, a new command is created using the matched rule and executed. The\nfollowing rules are enabled by default:\n\n* `adb_unknown_command` &ndash; fixes misspelled commands like `adb logcta`;\n* `ag_literal` &ndash; adds `-Q` to `ag` when suggested;\n* `aws_cli` &ndash; fixes misspelled commands like `aws dynamdb scan`;\n* `az_cli` &ndash; fixes misspelled commands like `az providers`;\n* `cargo` &ndash; runs `cargo build` instead of `cargo`;\n* `cargo_no_command` &ndash; fixes wrong commands like `cargo buid`;\n* `cat_dir` &ndash; replaces `cat` with `ls` when you try to `cat` a directory;\n* `cd_correction` &ndash; spellchecks and corrects failed cd commands;\n* `cd_cs` &ndash; changes `cs` to `cd`;\n* `cd_mkdir` &ndash; creates directories before cd'ing into them;\n* `cd_parent` &ndash; changes `cd..` to `cd ..`;\n* `chmod_x` &ndash; adds execution bit;\n* `choco_install` &ndash; appends common suffixes for chocolatey packages;\n* `composer_not_command` &ndash; fixes composer command name;\n* `conda_mistype` &ndash; fixes conda commands;\n* `cp_create_destination` &ndash; creates a new directory when you attempt to `cp` or `mv` to a non-existent one\n* `cp_omitting_directory` &ndash; adds `-a` when you `cp` directory;\n* `cpp11` &ndash; adds missing `-std=c++11` to `g++` or `clang++`;\n* `dirty_untar` &ndash; fixes `tar x` command that untarred in the current directory;\n* `dirty_unzip` &ndash; fixes `unzip` command that unzipped in the current directory;\n* `django_south_ghost` &ndash; adds `--delete-ghost-migrations` to failed because ghosts django south migration;\n* `django_south_merge` &ndash; adds `--merge` to inconsistent django south migration;\n* `docker_login` &ndash; executes a `docker login` and repeats the previous command;\n* `docker_not_command` &ndash; fixes wrong docker commands like `docker tags`;\n* `docker_image_being_used_by_container` &dash; removes the container that is using the image before removing the image;\n* `dry` &ndash; fixes repetitions like `git git push`;\n* `fab_command_not_found` &ndash; fixes misspelled fabric commands;\n* `fix_alt_space` &ndash; replaces Alt+Space with Space character;\n* `fix_file` &ndash; opens a file with an error in your `$EDITOR`;\n* `gem_unknown_command` &ndash; fixes wrong `gem` commands;\n* `git_add` &ndash; fixes *\"pathspec 'foo' did not match any file(s) known to git.\"*;\n* `git_add_force` &ndash; adds `--force` to `git add \u003Cpathspec>...` when paths are .gitignore'd;\n* `git_bisect_usage` &ndash; fixes `git bisect strt`, `git bisect goood`, `git bisect rset`, etc. when bisecting;\n* `git_branch_delete` &ndash; changes `git branch -d` to `git branch -D`;\n* `git_branch_delete_checked_out` &ndash; changes `git branch -d` to `git checkout master && git branch -D` when trying to delete a checked out branch;\n* `git_branch_exists` &ndash; offers `git branch -d foo`, `git branch -D foo` or `git checkout foo` when creating a branch that already exists;\n* `git_branch_list` &ndash; catches `git branch list` in place of `git branch` and removes created branch;\n* `git_branch_0flag` &ndash; fixes commands such as `git branch 0v` and `git branch 0r` removing the created branch;\n* `git_checkout` &ndash; fixes branch name or creates new branch;\n* `git_clone_git_clone` &ndash; replaces `git clone git clone ...` with `git clone ...`\n* `git_clone_missing` &ndash; adds `git clone` to URLs that appear to link to a git repository.\n* `git_commit_add` &ndash; offers `git commit -a ...` or `git commit -p ...` after previous commit if it failed because nothing was staged;\n* `git_commit_amend` &ndash; offers `git commit --amend` after previous commit;\n* `git_commit_reset` &ndash; offers `git reset HEAD~` after previous commit;\n* `git_diff_no_index` &ndash; adds `--no-index` to previous `git diff` on untracked files;\n* `git_diff_staged` &ndash; adds `--staged` to previous `git diff` with unexpected output;\n* `git_fix_stash` &ndash; fixes `git stash` commands (misspelled subcommand and missing `save`);\n* `git_flag_after_filename` &ndash; fixes `fatal: bad flag '...' after filename`\n* `git_help_aliased` &ndash; fixes `git help \u003Calias>` commands replacing \u003Calias> with the aliased command;\n* `git_hook_bypass` &ndash; adds `--no-verify` flag previous to `git am`, `git commit`, or `git push` command;\n* `git_lfs_mistype` &ndash; fixes mistyped `git lfs \u003Ccommand>` commands;\n* `git_main_master` &ndash; fixes incorrect branch name between `main` and `master`\n* `git_merge` &ndash; adds remote to branch names;\n* `git_merge_unrelated` &ndash; adds `--allow-unrelated-histories` when required\n* `git_not_command` &ndash; fixes wrong git commands like `git brnch`;\n* `git_pull` &ndash; sets upstream before executing previous `git pull`;\n* `git_pull_clone` &ndash; clones instead of pulling when the repo does not exist;\n* `git_pull_uncommitted_changes` &ndash; stashes changes before pulling and pops them afterwards;\n* `git_push` &ndash; adds `--set-upstream origin $branch` to previous failed `git push`;\n* `git_push_different_branch_names` &ndash; fixes pushes when local branch name does not match remote branch name;\n* `git_push_pull` &ndash; runs `git pull` when `push` was rejected;\n* `git_push_without_commits` &ndash; creates an initial commit if you forget and only `git add .`, when setting up a new project;\n* `git_rebase_no_changes` &ndash; runs `git rebase --skip` instead of `git rebase --continue` when there are no changes;\n* `git_remote_delete` &ndash; replaces `git remote delete remote_name` with `git remote remove remote_name`;\n* `git_rm_local_modifications` &ndash; adds `-f` or `--cached` when you try to `rm` a locally modified file;\n* `git_rm_recursive` &ndash; adds `-r` when you try to `rm` a directory;\n* `git_rm_staged` &ndash;  adds `-f` or `--cached` when you try to `rm` a file with staged changes\n* `git_rebase_merge_dir` &ndash; offers `git rebase (--continue | --abort | --skip)` or removing the `.git\u002Frebase-merge` dir when a rebase is in progress;\n* `git_remote_seturl_add` &ndash; runs `git remote add` when `git remote set_url` on nonexistent remote;\n* `git_stash` &ndash; stashes your local modifications before rebasing or switching branch;\n* `git_stash_pop` &ndash; adds your local modifications before popping stash, then resets;\n* `git_tag_force` &ndash; adds `--force` to `git tag \u003Ctagname>` when the tag already exists;\n* `git_two_dashes` &ndash; adds a missing dash to commands like `git commit -amend` or `git rebase -continue`;\n* `go_run` &ndash; appends `.go` extension when compiling\u002Frunning Go programs;\n* `go_unknown_command` &ndash; fixes wrong `go` commands, for example `go bulid`;\n* `gradle_no_task` &ndash; fixes not found or ambiguous `gradle` task;\n* `gradle_wrapper` &ndash; replaces `gradle` with `.\u002Fgradlew`;\n* `grep_arguments_order` &ndash; fixes `grep` arguments order for situations like `grep -lir . test`;\n* `grep_recursive` &ndash; adds `-r` when you try to `grep` directory;\n* `grunt_task_not_found` &ndash; fixes misspelled `grunt` commands;\n* `gulp_not_task` &ndash; fixes misspelled `gulp` tasks;\n* `has_exists_script` &ndash; prepends `.\u002F` when script\u002Fbinary exists;\n* `heroku_multiple_apps` &ndash; adds `--app \u003Capp>` to `heroku` commands like `heroku pg`;\n* `heroku_not_command` &ndash; fixes wrong `heroku` commands like `heroku log`;\n* `history` &ndash; tries to replace command with the most similar command from history;\n* `hostscli` &ndash; tries to fix `hostscli` usage;\n* `ifconfig_device_not_found` &ndash; fixes wrong device names like `wlan0` to `wlp2s0`;\n* `java` &ndash; removes `.java` extension when running Java programs;\n* `javac` &ndash; appends missing `.java` when compiling Java files;\n* `lein_not_task` &ndash; fixes wrong `lein` tasks like `lein rpl`;\n* `long_form_help` &ndash; changes `-h` to `--help` when the short form version is not supported\n* `ln_no_hard_link` &ndash; catches hard link creation on directories, suggest symbolic link;\n* `ln_s_order` &ndash; fixes `ln -s` arguments order;\n* `ls_all` &ndash; adds `-A` to `ls` when output is empty;\n* `ls_lah` &ndash; adds `-lah` to `ls`;\n* `man` &ndash; changes manual section;\n* `man_no_space` &ndash; fixes man commands without spaces, for example `mandiff`;\n* `mercurial` &ndash; fixes wrong `hg` commands;\n* `missing_space_before_subcommand` &ndash; fixes command with missing space like `npminstall`;\n* `mkdir_p` &ndash; adds `-p` when you try to create a directory without a parent;\n* `mvn_no_command` &ndash; adds `clean package` to `mvn`;\n* `mvn_unknown_lifecycle_phase` &ndash; fixes misspelled life cycle phases with `mvn`;\n* `npm_missing_script` &ndash; fixes `npm` custom script name in `npm run-script \u003Cscript>`;\n* `npm_run_script` &ndash; adds missing `run-script` for custom `npm` scripts;\n* `npm_wrong_command` &ndash; fixes wrong npm commands like `npm urgrade`;\n* `no_command` &ndash; fixes wrong console commands, for example `vom\u002Fvim`;\n* `no_such_file` &ndash; creates missing directories with `mv` and `cp` commands;\n* `omnienv_no_such_command` &ndash; fixes wrong commands for `goenv`, `nodenv`, `pyenv` and `rbenv` (eg.: `pyenv isntall` or `goenv list`);\n* `open` &ndash; either prepends `http:\u002F\u002F` to address passed to `open` or creates a new file or directory and passes it to `open`;\n* `pip_install` &ndash; fixes permission issues with `pip install` commands by adding `--user` or prepending `sudo` if necessary;\n* `pip_unknown_command` &ndash; fixes wrong `pip` commands, for example `pip instatl\u002Fpip install`;\n* `php_s` &ndash; replaces `-s` by `-S` when trying to run a local php server;\n* `port_already_in_use` &ndash; kills process that bound port;\n* `prove_recursively` &ndash; adds `-r` when called with directory;\n* `python_command` &ndash; prepends `python` when you try to run non-executable\u002Fwithout `.\u002F` python script;\n* `python_execute` &ndash; appends missing `.py` when executing Python files;\n* `python_module_error` &ndash; fixes ModuleNotFoundError by trying to `pip install` that module;\n* `quotation_marks` &ndash; fixes uneven usage of `'` and `\"` when containing args';\n* `path_from_history` &ndash; replaces not found path with a similar absolute path from history;\n* `rails_migrations_pending` &ndash; runs pending migrations;\n* `react_native_command_unrecognized` &ndash; fixes unrecognized `react-native` commands;\n* `remove_shell_prompt_literal` &ndash; removes leading shell prompt symbol `$`, common when copying commands from documentations;\n* `remove_trailing_cedilla` &ndash; removes trailing cedillas `ç`, a common typo for European keyboard layouts;\n* `rm_dir` &ndash; adds `-rf` when you try to remove a directory;\n* `scm_correction` &ndash; corrects wrong scm like `hg log` to `git log`;\n* `sed_unterminated_s` &ndash; adds missing '\u002F' to `sed`'s `s` commands;\n* `sl_ls` &ndash; changes `sl` to `ls`;\n* `ssh_known_hosts` &ndash; removes host from `known_hosts` on warning;\n* `sudo` &ndash; prepends `sudo` to the previous command if it failed because of permissions;\n* `sudo_command_from_user_path` &ndash; runs commands from users `$PATH` with `sudo`;\n* `switch_lang` &ndash; switches command from your local layout to en;\n* `systemctl` &ndash; correctly orders parameters of confusing `systemctl`;\n* `terraform_init.py` &ndash; runs `terraform init` before plan or apply;\n* `terraform_no_command.py` &ndash; fixes unrecognized `terraform` commands;\n* `test.py` &ndash; runs `pytest` instead of `test.py`;\n* `touch` &ndash; creates missing directories before \"touching\";\n* `tsuru_login` &ndash; runs `tsuru login` if not authenticated or session expired;\n* `tsuru_not_command` &ndash; fixes wrong `tsuru` commands like `tsuru shell`;\n* `tmux` &ndash; fixes `tmux` commands;\n* `unknown_command` &ndash; fixes hadoop hdfs-style \"unknown command\", for example adds missing '-' to the command on `hdfs dfs ls`;\n* `unsudo` &ndash; removes `sudo` from previous command if a process refuses to run on superuser privilege.\n* `vagrant_up` &ndash; starts up the vagrant instance;\n* `whois` &ndash; fixes `whois` command;\n* `workon_doesnt_exists` &ndash; fixes `virtualenvwrapper` env name os suggests to create new.\n* `wrong_hyphen_before_subcommand` &ndash; removes an improperly placed hyphen (`apt-install` -> `apt install`, `git-log` -> `git log`, etc.)\n* `yarn_alias` &ndash; fixes aliased `yarn` commands like `yarn ls`;\n* `yarn_command_not_found` &ndash; fixes misspelled `yarn` commands;\n* `yarn_command_replaced` &ndash; fixes replaced `yarn` commands;\n* `yarn_help` &ndash; makes it easier to open `yarn` documentation;\n\n##### [Back to Contents](#contents)\n\nThe following rules are enabled by default on specific platforms only:\n\n* `apt_get` &ndash; installs app from apt if it not installed (requires `python-commandnotfound` \u002F `python3-commandnotfound`);\n* `apt_get_search` &ndash; changes trying to search using `apt-get` with searching using `apt-cache`;\n* `apt_invalid_operation` &ndash; fixes invalid `apt` and `apt-get` calls, like `apt-get isntall vim`;\n* `apt_list_upgradable` &ndash; helps you run `apt list --upgradable` after `apt update`;\n* `apt_upgrade` &ndash; helps you run `apt upgrade` after `apt list --upgradable`;\n* `brew_cask_dependency` &ndash; installs cask dependencies;\n* `brew_install` &ndash; fixes formula name for `brew install`;\n* `brew_reinstall` &ndash; turns `brew install \u003Cformula>` into `brew reinstall \u003Cformula>`;\n* `brew_link` &ndash; adds `--overwrite --dry-run` if linking fails;\n* `brew_uninstall` &ndash; adds `--force` to `brew uninstall` if multiple versions were installed;\n* `brew_unknown_command` &ndash; fixes wrong brew commands, for example `brew docto\u002Fbrew doctor`;\n* `brew_update_formula` &ndash; turns `brew update \u003Cformula>` into `brew upgrade \u003Cformula>`;\n* `dnf_no_such_command` &ndash; fixes mistyped DNF commands;\n* `nixos_cmd_not_found` &ndash; installs apps on NixOS;\n* `pacman` &ndash; installs app with `pacman` if it is not installed (uses `yay`, `pikaur` or `yaourt` if available);\n* `pacman_invalid_option` &ndash; replaces lowercase `pacman` options with uppercase.\n* `pacman_not_found` &ndash; fixes package name with `pacman`, `yay`, `pikaur` or `yaourt`.\n* `yum_invalid_operation` &ndash; fixes invalid `yum` calls, like `yum isntall vim`;\n\nThe following commands are bundled with *The Fuck*, but are not enabled by\ndefault:\n\n* `git_push_force` &ndash; adds `--force-with-lease` to a `git push` (may conflict with `git_push_pull`);\n* `rm_root` &ndash; adds `--no-preserve-root` to `rm -rf \u002F` command.\n\n##### [Back to Contents](#contents)\n\n## Creating your own rules\n\nTo add your own rule, create a file named `your-rule-name.py`\nin `~\u002F.config\u002Fthefuck\u002Frules`. The rule file must contain two functions:\n\n```python\nmatch(command: Command) -> bool\nget_new_command(command: Command) -> str | list[str]\n```\n\nAdditionally, rules can contain optional functions:\n\n```python\nside_effect(old_command: Command, fixed_command: str) -> None\n```\nRules can also contain the optional variables `enabled_by_default`, `requires_output` and `priority`.\n\n`Command` has three attributes: `script`, `output` and `script_parts`.\nYour rule should not change `Command`.\n\n\n**Rules api changed in 3.0:** To access a rule's settings, import it with\n `from thefuck.conf import settings`\n\n`settings` is a special object assembled from `~\u002F.config\u002Fthefuck\u002Fsettings.py`,\nand values from env ([see more below](#settings)).\n\nA simple example rule for running a script with `sudo`:\n\n```python\ndef match(command):\n    return ('permission denied' in command.output.lower()\n            or 'EACCES' in command.output)\n\n\ndef get_new_command(command):\n    return 'sudo {}'.format(command.script)\n\n# Optional:\nenabled_by_default = True\n\ndef side_effect(command, fixed_command):\n    subprocess.call('chmod 777 .', shell=True)\n\npriority = 1000  # Lower first, default is 1000\n\nrequires_output = True\n```\n\n[More examples of rules](https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Ftree\u002Fmaster\u002Fthefuck\u002Frules),\n[utility functions for rules](https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Ftree\u002Fmaster\u002Fthefuck\u002Futils.py),\n[app\u002Fos-specific helpers](https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Ftree\u002Fmaster\u002Fthefuck\u002Fspecific\u002F).\n\n##### [Back to Contents](#contents)\n\n## Settings\n\nSeveral *The Fuck* parameters can be changed in the file `$XDG_CONFIG_HOME\u002Fthefuck\u002Fsettings.py`\n(`$XDG_CONFIG_HOME` defaults to `~\u002F.config`):\n\n* `rules` &ndash; list of enabled rules, by default `thefuck.const.DEFAULT_RULES`;\n* `exclude_rules` &ndash; list of disabled rules, by default `[]`;\n* `require_confirmation` &ndash; requires confirmation before running new command, by default `True`;\n* `wait_command` &ndash; the max amount of time in seconds for getting previous command output;\n* `no_colors` &ndash; disable colored output;\n* `priority` &ndash; dict with rules priorities, rule with lower `priority` will be matched first;\n* `debug` &ndash; enables debug output, by default `False`;\n* `history_limit` &ndash; the numeric value of how many history commands will be scanned, like `2000`;\n* `alter_history` &ndash; push fixed command to history, by default `True`;\n* `wait_slow_command` &ndash; max amount of time in seconds for getting previous command output if it in `slow_commands` list;\n* `slow_commands` &ndash; list of slow commands;\n* `num_close_matches` &ndash; the maximum number of close matches to suggest, by default `3`.\n* `excluded_search_path_prefixes` &ndash; path prefixes to ignore when searching for commands, by default `[]`.\n\nAn example of `settings.py`:\n\n```python\nrules = ['sudo', 'no_command']\nexclude_rules = ['git_push']\nrequire_confirmation = True\nwait_command = 10\nno_colors = False\npriority = {'sudo': 100, 'no_command': 9999}\ndebug = False\nhistory_limit = 9999\nwait_slow_command = 20\nslow_commands = ['react-native', 'gradle']\nnum_close_matches = 5\n```\n\nOr via environment variables:\n\n* `THEFUCK_RULES` &ndash; list of enabled rules, like `DEFAULT_RULES:rm_root` or `sudo:no_command`;\n* `THEFUCK_EXCLUDE_RULES` &ndash; list of disabled rules, like `git_pull:git_push`;\n* `THEFUCK_REQUIRE_CONFIRMATION` &ndash; require confirmation before running new command, `true\u002Ffalse`;\n* `THEFUCK_WAIT_COMMAND` &ndash; the max amount of time in seconds for getting previous command output;\n* `THEFUCK_NO_COLORS` &ndash; disable colored output, `true\u002Ffalse`;\n* `THEFUCK_PRIORITY` &ndash; priority of the rules, like `no_command=9999:apt_get=100`,\nrule with lower `priority` will be matched first;\n* `THEFUCK_DEBUG` &ndash; enables debug output, `true\u002Ffalse`;\n* `THEFUCK_HISTORY_LIMIT` &ndash; how many history commands will be scanned, like `2000`;\n* `THEFUCK_ALTER_HISTORY` &ndash; push fixed command to history `true\u002Ffalse`;\n* `THEFUCK_WAIT_SLOW_COMMAND` &ndash; the max amount of time in seconds for getting previous command output if it in `slow_commands` list;\n* `THEFUCK_SLOW_COMMANDS` &ndash; list of slow commands, like `lein:gradle`;\n* `THEFUCK_NUM_CLOSE_MATCHES` &ndash; the maximum number of close matches to suggest, like `5`.\n* `THEFUCK_EXCLUDED_SEARCH_PATH_PREFIXES` &ndash; path prefixes to ignore when searching for commands, by default `[]`.\n\nFor example:\n\n```bash\nexport THEFUCK_RULES='sudo:no_command'\nexport THEFUCK_EXCLUDE_RULES='git_pull:git_push'\nexport THEFUCK_REQUIRE_CONFIRMATION='true'\nexport THEFUCK_WAIT_COMMAND=10\nexport THEFUCK_NO_COLORS='false'\nexport THEFUCK_PRIORITY='no_command=9999:apt_get=100'\nexport THEFUCK_HISTORY_LIMIT='2000'\nexport THEFUCK_NUM_CLOSE_MATCHES='5'\n```\n\n##### [Back to Contents](#contents)\n\n## Third-party packages with rules\n\nIf you'd like to make a specific set of non-public rules, but would still like\nto share them with others, create a package named `thefuck_contrib_*` with\nthe following structure:\n\n```\nthefuck_contrib_foo\n  thefuck_contrib_foo\n    rules\n      __init__.py\n      *third-party rules*\n    __init__.py\n    *third-party-utils*\n  setup.py\n```\n\n*The Fuck* will find rules located in the `rules` module.\n\n##### [Back to Contents](#contents)\n\n## Experimental instant mode\n\nThe default behavior of *The Fuck* requires time to re-run previous commands.\nWhen in instant mode, *The Fuck* saves time by logging output with [script](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FScript_(Unix)),\nthen reading the log.\n\n[![gif with instant mode][instant-mode-gif-link]][instant-mode-gif-link]\n\nCurrently, instant mode only supports Python 3 with bash or zsh. zsh's autocorrect function also needs to be disabled in order for thefuck to work properly.\n\nTo enable instant mode, add `--enable-experimental-instant-mode`\nto the alias initialization in `.bashrc`, `.bash_profile` or `.zshrc`.\n\nFor example:\n\n```bash\neval $(thefuck --alias --enable-experimental-instant-mode)\n```\n\n##### [Back to Contents](#contents)\n\n## Developing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## License MIT\nProject License can be found [here](LICENSE.md).\n\n\n[version-badge]:   https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fthefuck.svg?label=version\n[version-link]:    https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fthefuck\u002F\n[workflow-badge]:  https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Fworkflows\u002FTests\u002Fbadge.svg\n[workflow-link]:   https:\u002F\u002Fgithub.com\u002Fnvbn\u002Fthefuck\u002Factions?query=workflow%3ATests\n[coverage-badge]:  https:\u002F\u002Fimg.shields.io\u002Fcoveralls\u002Fnvbn\u002Fthefuck.svg\n[coverage-link]:   https:\u002F\u002Fcoveralls.io\u002Fgithub\u002Fnvbn\u002Fthefuck\n[license-badge]:   https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-007EC7.svg\n[examples-link]:   https:\u002F\u002Fraw.githubusercontent.com\u002Fnvbn\u002Fthefuck\u002Fmaster\u002Fexample.gif\n[instant-mode-gif-link]:   https:\u002F\u002Fraw.githubusercontent.com\u002Fnvbn\u002Fthefuck\u002Fmaster\u002Fexample_instant_mode.gif\n[homebrew]:        https:\u002F\u002Fbrew.sh\u002F\n\n##### [Back to Contents](#contents)\n","The Fuck 是一个能够自动纠正你上一条控制台命令错误的应用。它使用 Python 编写，主要功能是在用户输入错误命令后，通过分析错误信息并提供正确的命令建议来提高工作效率。该工具支持多种 Shell 环境，并且可以通过简单的配置实现即时模式以加快响应速度。适用于经常需要在终端中执行命令的开发者或系统管理员，在遇到拼写错误、权限不足等问题时能够快速得到解决方案，从而避免了手动查找和修正错误的繁琐过程。",2,"2026-06-17 02:34:12","top_all"]