# The Fuck: Automatically Correct Your Previous Console Commands

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/nvbn-thefuck
Generated for open source discovery and AI-assisted research.

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
OSRepos URL: https://osrepos.com/repo/nvbn-thefuck

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

## Topics

- python
- shell
- cli
- productivity
- automation
- terminal
- developer-tools

## Repository Information

Last analyzed by OSRepos: Sat Jan 31 2026 00:00:36 GMT+0000 (Western European Standard Time)
Detail views: 3
GitHub clicks: 3

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

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.

## Installation

Installing The Fuck is straightforward and supported across various platforms.

**On macOS or Linux (via Homebrew):**
bash
brew install thefuck


**On Ubuntu / Mint:**
bash
sudo apt update
sudo apt install python3-dev python3-pip python3-setuptools
pip3 install thefuck --user


**On Arch based systems:**
bash
sudo pacman -S thefuck


**On other systems (via pip):**
bash
pip install thefuck


After installation, it is recommended to add an alias to your shell configuration file (e.g., `.bashrc`, `.zshrc`):
bash
eval $(thefuck --alias)
# You can use a custom alias, for example:
eval $(thefuck --alias FUCK)

Remember to `source` your shell config file or open a new session for changes to take effect.

**Updating:**
To update The Fuck to the latest version, use:
bash
pip3 install thefuck --upgrade


## Examples

The Fuck shines in its ability to correct a wide range of common command-line errors. Here are a few illustrative examples:

**Fixing `sudo` permissions:**
bash
? apt-get install vim
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

? fuck
sudo apt-get install vim [enter/?/?/ctrl+c]
[sudo] password for nvbn:
Reading package lists... Done
...


**Correcting Git upstream issues:**
bash
? git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master


? fuck
git push --set-upstream origin master [enter/?/?/ctrl+c]
Counting objects: 9, done.
...


**Typo correction for basic commands:**
bash
? puthon
No command 'puthon' found, did you mean:
 Command 'python' from package 'python-minimal' (main)
 Command 'python' from package 'python3' (main)
zsh: command not found: puthon

? fuck
python [enter/?/?/ctrl+c]
Python 3.4.2 (default, Oct  8 2014, 13:08:17)
...


The tool also supports running fixed commands without confirmation using `fuck --yeah` or `fuck -y`.

## Why Use It

The Fuck is an invaluable tool for anyone who spends a significant amount of time in the terminal. Its primary benefits include:

*   **Increased Productivity:** By automatically correcting common mistakes, it saves time and reduces the frustration of retyping commands.
*   **Reduced Errors:** It intelligently identifies and fixes a vast array of errors, from simple typos to complex Git command issues and permission problems.
*   **Extensibility:** Users can create their own custom rules to address specific workflows or unique command patterns, making it highly adaptable.
*   **Broad Compatibility:** It supports various shells (Bash, Zsh, Fish, Powershell, tcsh) and integrates seamlessly into existing command-line environments.
*   **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.

## Links

*   **GitHub Repository:** [https://github.com/nvbn/thefuck](https://github.com/nvbn/thefuck)
*   **Official Installation Wiki:** [https://github.com/nvbn/thefuck/wiki/Installation](https://github.com/nvbn/thefuck/wiki/Installation)
*   **Shell Aliases Wiki:** [https://github.com/nvbn/thefuck/wiki/Shell-aliases](https://github.com/nvbn/thefuck/wiki/Shell-aliases)