# nvbn/thefuck

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nvbn-thefuck).**

95,503 stars · 3,841 forks · Python · mit

## Links

- GitHub: https://github.com/nvbn/thefuck
- awesome-repositories: https://awesome-repositories.com/repository/nvbn-thefuck.md

## Topics

`python` `shell`

## Description

This tool is a rule-based engine designed to automate the correction of failed terminal commands. By integrating directly into the shell environment, it intercepts command execution errors, analyzes exit codes and output streams, and applies corrective logic to resolve typos or syntax mistakes. It functions as a persistent background utility that monitors command history to provide immediate remediation for input failures.

The system distinguishes itself through a modular, plugin-oriented architecture that allows for extensive customization. Users can define their own correction rules via scripts or integrate third-party packages to handle specialized command-line tools and unique workflows. By utilizing shell aliases to trigger the correction process, the tool dynamically injects fixed command strings back into the input buffer, enabling rapid recovery without manual retyping.

Beyond its core correction capabilities, the software includes utilities for managing shell environments, configuring correction behavior, and tailoring rules to specific operating systems. These features support the development of custom automation logic, allowing for context-aware error resolution that adapts to the user's specific terminal environment and installed toolset.

## Tags

### Development Tools & Productivity

- [Command Correction Tools](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/general-enhancements-tooling/terminal-productivity/command-line-utilities/command-correction-tools.md) — Fixes common typos and syntax errors in terminal commands by automatically applying corrective logic to failed inputs. ([source](https://github.com/nvbn/thefuck#readme))
- [Command Correction Engines](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/general-enhancements-tooling/terminal-productivity/command-line-utilities/command-correction-engines.md) — Supports a modular architecture for defining custom patterns that identify and resolve recurring command-line mistakes.
- [Command-Line Correction Engines](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/general-enhancements-tooling/terminal-productivity/command-line-utilities/command-line-correction-engines.md) — Intercepts failed command executions to resolve syntax errors and typos through an automated rule-based engine.
- [Terminal Error Recovery Tools](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/general-enhancements-tooling/terminal-utilities/interactive-navigation-helpers/terminal-error-recovery-tools.md) — Maintains developer flow by automatically detecting and repairing mistyped shell commands without requiring manual re-entry.
- [Command Interception Hooks](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/automation-integration-tools/shell-integration/command-interception-hooks.md) — Hooks into the shell environment to intercept failed command attempts and trigger automated repair sequences.
- [Custom Correction Rules](https://awesome-repositories.com/f/development-tools-productivity/workflow-automation/automation-execution-frameworks/cli-automation-frameworks/custom-correction-rules.md) — Allows users to write custom scripts that intercept and automatically rectify specific command-line input errors. ([source](https://github.com/nvbn/thefuck#readme))
- [Command Re-execution Utilities](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/automation-integration-tools/shell-automation/command-re-execution-utilities.md) — Injects corrected command strings directly into the shell input buffer to execute the intended operation after a failure.
- [Workflow Optimization Tools](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/workflow-productivity-enhancers/developer-productivity-utilities/developer-productivity/workflow-automation-frameworks/workflow-optimization-tools.md) — Reduces terminal friction by minimizing time spent manually correcting trivial input mistakes during daily operations.

### Artificial Intelligence & ML

- [Command Error Correction Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/reasoning-symbolic-systems/pattern-matching-engines/command-error-correction-engines.md) — Evaluates command exit codes and output streams against modular scripts to identify and rectify specific execution errors.

### DevOps & Infrastructure

- [Extensible Shell Automation](https://awesome-repositories.com/f/devops-infrastructure/automation-orchestration/task-execution-frameworks/automation-frameworks/extensibility-hooks/extensible-shell-automation.md) — Enables the definition of custom rule-based logic to intercept and modify command execution after a failure occurs.

### Software Engineering & Architecture

- [Rule-Based Plugin Systems](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/domain-specific/rule-based-plugin-systems.md) — Loads external rule definitions to extend correction capabilities without requiring modifications to the core engine.
- [Application Plugins](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/application-plugins.md) — Integrates specialized rule packages to provide tailored correction logic for diverse command-line tools and environments. ([source](https://github.com/nvbn/thefuck#readme))
