{"name":"The Fuck: Automatically Correct Your Previous Console Commands","description":"The Fuck is a magnificent and highly popular Python application designed to automatically correct errors in your previous console commands. Inspired by a tweet, this tool aims to significantly enhance productivity for anyone frequently working in the terminal by fixing common typos and mistakes. With over 95,000 stars on GitHub, it's a widely adopted solution for command-line efficiency.","github":"https://github.com/nvbn/thefuck","url":"https://osrepos.com/repo/nvbn-thefuck","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/nvbn-thefuck","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/nvbn-thefuck.md","json":"https://osrepos.com/repo/nvbn-thefuck.json","topics":["python","shell","cli","productivity","automation","terminal","developer-tools"],"keywords":["python","shell","cli","productivity","automation","terminal","developer-tools"],"stars":null,"summary":"The Fuck is a magnificent and highly popular Python application designed to automatically correct errors in your previous console commands. Inspired by a tweet, this tool aims to significantly enhance productivity for anyone frequently working in the terminal by fixing common typos and mistakes. With over 95,000 stars on GitHub, it's a widely adopted solution for command-line efficiency.","content":"## Introduction\n\nThe Fuck is a magnificent and highly popular Python application designed to automatically correct errors in your previous console commands. Inspired by a tweet, this tool aims to significantly enhance productivity for anyone frequently working in the terminal by fixing common typos and mistakes. With over 95,000 stars on GitHub, it's a widely adopted solution for command-line efficiency.\n\n## Installation\n\nInstalling The Fuck is straightforward and supported across various platforms.\n\n**On macOS or Linux (via Homebrew):**\nbash\nbrew install thefuck\n\n\n**On Ubuntu / Mint:**\nbash\nsudo apt update\nsudo apt install python3-dev python3-pip python3-setuptools\npip3 install thefuck --user\n\n\n**On Arch based systems:**\nbash\nsudo pacman -S thefuck\n\n\n**On other systems (via pip):**\nbash\npip install thefuck\n\n\nAfter installation, it is recommended to add an alias to your shell configuration file (e.g., `.bashrc`, `.zshrc`):\nbash\neval $(thefuck --alias)\n# You can use a custom alias, for example:\neval $(thefuck --alias FUCK)\n\nRemember to `source` your shell config file or open a new session for changes to take effect.\n\n**Updating:**\nTo update The Fuck to the latest version, use:\nbash\npip3 install thefuck --upgrade\n\n\n## Examples\n\nThe Fuck shines in its ability to correct a wide range of common command-line errors. Here are a few illustrative examples:\n\n**Fixing `sudo` permissions:**\nbash\n? apt-get install vim\nE: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)\nE: Unable to lock the administration directory (/var/lib/dpkg/), are you root?\n\n? fuck\nsudo apt-get install vim [enter/?/?/ctrl+c]\n[sudo] password for nvbn:\nReading package lists... Done\n...\n\n\n**Correcting Git upstream issues:**\nbash\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/?/?/ctrl+c]\nCounting objects: 9, done.\n...\n\n\n**Typo correction for basic commands:**\nbash\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/?/?/ctrl+c]\nPython 3.4.2 (default, Oct  8 2014, 13:08:17)\n...\n\n\nThe tool also supports running fixed commands without confirmation using `fuck --yeah` or `fuck -y`.\n\n## Why Use It\n\nThe Fuck is an invaluable tool for anyone who spends a significant amount of time in the terminal. Its primary benefits include:\n\n*   **Increased Productivity:** By automatically correcting common mistakes, it saves time and reduces the frustration of retyping commands.\n*   **Reduced Errors:** It intelligently identifies and fixes a vast array of errors, from simple typos to complex Git command issues and permission problems.\n*   **Extensibility:** Users can create their own custom rules to address specific workflows or unique command patterns, making it highly adaptable.\n*   **Broad Compatibility:** It supports various shells (Bash, Zsh, Fish, Powershell, tcsh) and integrates seamlessly into existing command-line environments.\n*   **Instant Mode:** For even faster corrections, an experimental instant mode is available, which logs output and reads it directly, bypassing the need to re-run commands.\n\n## Links\n\n*   **GitHub Repository:** [https://github.com/nvbn/thefuck](https://github.com/nvbn/thefuck)\n*   **Official Installation Wiki:** [https://github.com/nvbn/thefuck/wiki/Installation](https://github.com/nvbn/thefuck/wiki/Installation)\n*   **Shell Aliases Wiki:** [https://github.com/nvbn/thefuck/wiki/Shell-aliases](https://github.com/nvbn/thefuck/wiki/Shell-aliases)","metrics":{"detailViews":3,"githubClicks":3},"dates":{"published":null,"modified":"2026-01-31T00:00:36.000Z"}}