
The Fuck
Corrects your previous console command after you mistype it.
- Stars
- 97.9k
- Forks
- 4k
- Licence
- MIT
- Language
- Python
- Last update
- 2.3 years ago
- Type
- CLI
No commits in over a year — check for forks or alternatives before adopting.
What it is
The Fuck is a command-line tool that looks at the last command you ran, finds a likely fix for an error, and offers the corrected command for you to run. It works through a set of rules, such as fixing misspelled git subcommands or adding a missing sudo. You can confirm each suggestion before it runs, or turn confirmation off.
- Fix a misspelled git command like `git brnch` to `git branch`
- Add a missing sudo when apt-get fails with a permission error
- Correct a misspelled command name such as `puthon` to `python`
- Create a missing directory before a cd when the folder does not exist
Great for
- Developers who often mistype git, docker, or other common commands
- People who use a terminal regularly and want quicker recovery from typos
- Users on macOS, Linux, or FreeBSD who can install it with a package manager or pip
Not ideal for
- People who would rather not run suggested commands at all, since the README warns against blindly running corrected commands
- Users on Windows, where the README does not describe a supported install path beyond pip and the listed systems
- People who need the tool to be instant on every keystroke, since the README mentions an experimental instant mode because the default can be slow
How to get it
- 1
Install with a package manager
You'll need: Python 3.5+ · pip
Install with Homebrew (macOS or Linux)
brew install thefuckInstall with pip on other systems
pip install thefuck - 2
Run it
- Install the package with pip or your package manager.
- Add `eval $(thefuck --alias)` to your .bashrc, .zshrc, or other shell startup file.
- Open a new shell session or run `source ~/.bashrc` (or your shell config file).
- After a mistyped command, type `fuck` and confirm the suggested fix.
- 3
Get the most out of it
- Use `fuck --yeah` (or `-y`) to run fixed commands without confirmation, only if you are comfortable with that risk
- Use `fuck -r` to fix commands recursively until one succeeds
- Set a different alias such as `eval $(thefuck --alias FUCK)` if you prefer another name
- Check the README's settings section to change options such as require_confirmation
Downloads
Strengths
- Simple to use: run `fuck` after an error and confirm the suggestion
- Covers many common tools through a built-in list of rules
- Open source under the MIT license with a large user base
Trade-offs
- Runs commands it suggests, so you need to review each one unless you disable confirmation
- Can be slow by default, which the README addresses with an experimental mode
- Needs Python and a shell alias set up in your shell config
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| thefuck (this) | 97.9k | CLI | beginner | 2.3 years ago | Developers who often mistype git, docker, or other common commands |
| ohmyzsh | 190k | Dev tool | beginner | 4 days ago | People who already use zsh and want a ready-made configuration without writing it from scratch |
| PowerShell | 56k | CLI | beginner | 4 days ago | Developers who script or automate tasks across Windows, Linux, and macOS |
| zsh-autosuggestions | 36.2k | App | beginner | 1.4 years ago | People who use zsh as their daily terminal shell |
| atuin | 32.2k | Dev tool | beginner | 4 days ago | Developers who work in a terminal and often need to find past commands |
| autocomplete | 25.2k | Other | intermediate | 1.5 years ago | macOS developers who use zsh, bash or fish and want suggestions for common CLIs |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.