nvbn /thefuck
Magnificent app which corrects your previous console command.
★ 97,946⑂ 3,977👁 806⑃ 782● 799▤ 17◈ 0
97,946
stars
+-2
3,977
forks
806
watchers
782
prs
799
issues
17
releases
0
discussions
README
The Fuck [![Version][version-badge]][version-link] [![Build Status][workflow-badge]][workflow-link] [![Coverage][coverage-badge]][coverage-link] [![MIT License][license-badge]](LICENSE.md)
The Fuck is a magnificent app, inspired by a @liamosaur
tweet,
that corrects errors in previous console commands.
Is The Fuck too slow? Try the experimental instant mode!
[![gif with examples][examples-link]][examples-link]
More examples:
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
...
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.
...
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)
...
bash
➜ git brnch
git: 'brnch' is not a git command. See 'git --help'.
Did you mean this?
branch
➜ fuck
git branch [enter/↑/↓/ctrl+c]
master
bash
➜ lein rpl
'rpl' is not a task. See 'lein help'.
Did you mean this?
repl
➜ fuck
lein repl [enter/↑/↓/ctrl+c]
nREPL server started on port 54848 on host 127.0.0.1 - nrepl://127.0.0.1:54848
REPL-y 0.3.1
...
If you're not afraid of blindly running corrected commands, the
require_confirmation settings option can be disabled:
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
[sudo] password for nvbn:
Reading package lists... Done
...
Contents
1. Requirements
2. Installations
3. Updating
4. How it works
5. Creating your own rules
6. Settings
7. Third party packages with rules
8. Experimental instant mode
9. Developing
10. License
Requirements
- python (3.5+)
- pip
- python-dev
Back to Contents
Installation
On macOS or Linux, you can install The Fuck via [Homebrew][homebrew]:
bash
brew install thefuck
On Ubuntu / Mint, install The Fuck with the following commands:
bash
sudo apt update
sudo apt install python3-dev python3-pip python3-setuptools
pip3 install thefuck --user
On FreeBSD, install The Fuck with the following commands:
bash
pkg install thefuck
On ChromeOS, install The Fuck using chromebrew with the following command:
bash
crew install thefuck
On Arch based systems, install The Fuck with the following command:
sudo pacman -S thefuck
On other systems, install The Fuck by using pip:
bash
pip install thefuck
Alternatively, you may uTop issues
#685Drop Python 2 support38 comments · 2017-08-28#1466The repo is dead29 comments · 2024-09-08#1457Cannot install on Ubuntu 24.04 LTS Noble Numbat24 comments · 2024-08-15#302How to install it on Windows?24 comments · 2015-07-21#1112[Bug] Key error when running thefuck on termux23 comments · 2020-07-13#1449Having a hard time getting set up on Ubuntu 24.0420 comments · 2024-05-22#1257Different rule found when using fish vs bash/zsh19 comments · 2022-01-02#1254Alias for nushell18 comments · 2021-12-27
Latest release
3.32 3.32 2022-01-02- Addition of new rules - 942: Add new git_branch_0v_to_dash_v rule - 1210: Add rule 'rails_migrations_pending' - 1131: Add rule for Git commit with no added files - 1184: Add new rule for main / master Git branches - 977: Add wrong_hyphen_before_subcommand rule - Improvements to existing rules - 1039: Remove all leading $ not just one - 1123: Update composer_not_command rule (1135) - 942: Improve git_branch_0flag rule - with a new name - 1131: Improve git_commit_add rule - 1184: Improve + fix git_main_master rule - 894: Combine commands with shell.and\_ in do
相关报道 (4)
News & coverage (4)
Hacker NewsThe Fuck – Correct your previous console command▲ 438 · 165 comments · 2015-04-17Hacker NewsThe Fuck – An app which corrects your previous console command▲ 287 · 103 comments · 2017-04-17Hacker NewsThefuck – Corrects your previous console command▲ 112 · 61 comments · 2018-10-18Hacker NewsThefuck: Magnificent app which corrects your previous console command▲ 42 · 18 comments · 2022-03-18