nvbn/thefuck
61.1
Adequate · 5 August 2026
5.2k
lines of production code
Python
primary language
4
measurements over time
What this system is
The Fuck is a command-line utility that automatically corrects previous shell commands by matching user input against a comprehensive set of correction rules. It integrates deeply with various Unix shells and Windows environments to capture command output and history, then suggests and executes corrected versions of mistyped or failed commands. The system supports a wide range of tools and package managers, providing a robust, cross-platform experience for fixing common command-line errors.
How it got here
2015 — Architecture refactoring and test coverage
9 changes.
The project underwent a major architectural restructuring, centralizing OS-specific logic and settings management while introducing a comprehensive test suite. This period focused on improving cross-platform compatibility for Windows and Linux, expanding correction rules, and ensuring code quality through extensive unit and functional testing.
2016–2023 — Modular architecture and cross-platform support
7 changes.
The codebase underwent a significant refactoring to replace monolithic structures with a modular architecture for shell integration and command entry points. This period also introduced instant mode support for faster output retrieval and added Windows CMD and PowerShell scripts to extend cross-platform usability.
Features
Added Windows CMD and PowerShell support for thefuck
Users on Windows can now use thefuck via a new CMD batch script (fuck.bat) and a PowerShell script (fuck.ps1). The PowerShell script automatically configures the user's profile to include thefuck initialization and defines a global 'fuck' function, while the CMD script sets the necessary environment variables and invokes the tool.
scripts · high confidence
Expanded command correction rules for Git, package managers, and system utilities
The \thefuck/rules\ directory was significantly expanded with dozens of new rule files to correct common command-line mistakes. This includes new rules for Git (e.g., \git\_add\, \git\_checkout\, \git\_push\), package managers (e.g., \apt\_get\, \brew\_install\, \pip\_install\), and system utilities (e.g., \cd\_mkdir\, \chmod\_x\, \sudo\). These additions enable The Fuck to automatically fix errors such as missing files, incorrect subcommands, permission issues, and typos across a wide range of tools.
thefuck/rules · high confidence
Release 3.32 with improved packaging and Windows support
The package is now built as a universal wheel and includes Windows-specific scripts (a .bat and .ps1 file) alongside the standard console entry points. The setup configuration was updated to enforce Python 2.7+ and 3.5+ requirements, add explicit dependencies (psutil, colorama, six), and integrate the fastentrypoints module for faster script generation.
(repo-wide) · high confidence
Architecture
Major refactoring of core components and settings management
The application's architecture has been significantly restructured. The \Command\ and \Rule\ classes have been moved to \thefuck/types.py\ with expanded attributes (e.g., \priority\, \requires\_output\), and the \corrector.py\ module now handles rule loading and command organization. Settings are now managed via a new \conf.py\ module that supports environment variables, command-line arguments, and XDG-compliant configuration paths, replacing the previous \main.py\-based initialization. Additionally, the \ui.py\ module now handles user interaction, including key bindings for navigation and confirmation.
thefuck · high confidence
Behavioural changes
Centralize OS and tool-specific logic into the \`thefuck/specific\` package
The \thefuck/specific\ package has been introduced to house all OS and package-manager-specific utilities, replacing scattered implementations. This includes new modules for apt, Arch Linux (supporting yay, pikaur, and yaourt), brew, DNF, Git (with alias expansion support), Nix, npm (script detection), sudo, and Yum. Each module provides availability checks or helper functions (e.g., \get\_pkgfile\, \get\_brew\_path\_prefix\, \get\_scripts\) that were previously embedded in rules or the main codebase, improving modularity and enabling dynamic loading of corrections based on available tools.
thefuck/specific · high confidence
Platform-specific system utilities for Linux and Windows
Thefuck now uses separate system modules for Linux and Windows to handle platform-specific behaviors. On Windows, it uses \win\_unicode\_console\ and \msvcrt\ for key input and output initialization, while Linux relies on \tty\ and \termios\. Both platforms now share a common interface for getting keys and opening files, with Windows-specific fixes like monkeypatching \pathlib.Path.expanduser\ to work around a Python bug. This change improves cross-platform compatibility and input handling.
thefuck/system · high confidence
Refactor shell integration into a modular architecture
The shell-specific logic for Bash, Zsh, Fish, Tcsh, and PowerShell has been extracted from a monolithic structure into dedicated modules under the \thefuck/shells\ directory. This change introduces a generic base class and shell-specific implementations that handle alias generation, history management, and configuration instructions. Users will benefit from improved shell detection, better support for command-line arguments (like \-y/--yeah\), and more robust handling of shell history and aliases across different environments.
thefuck/shells · high confidence
Reorganized thefuck entrypoints into dedicated modules
The \thefuck/entrypoints\ directory has been restructured by splitting the previous monolithic entrypoint code into separate modules: \alias.py\ (handling the shell alias), \fix\_command.py\ (the main \fuck\ command logic), \main.py\ (argument parsing and routing), \not\_configured.py\ (first-run configuration help), and \shell\_logger.py\ (instant mode logging). This reorganization improves code maintainability and clarity without changing user-facing behavior.
thefuck/entrypoints · high confidence
Unify output retrieval with instant mode support
The \output\_readers\ module has been restructured to support an 'instant mode' that reads command output from a log file using memory-mapped I/O (mmap) for improved performance. The new \read\log.py\ module handles this log-based retrieval, while \rerun.py\ continues to handle classic mode by re-executing the command. The \\\init\\_.py\ entry point now routes to the appropriate reader based on the \instant\_mode\ setting, with a Python 2 compatibility check ensuring instant mode is disabled on that version. Additionally, a \shell\_logger.py\ module was added to support an external shell logger via a Unix socket, which takes precedence if available.
_thefuck/output\readers · medium confidence
Test coverage
Add comprehensive test suite for core application components; Add tests for numerous shell and package manager correction rules; Added functional tests for bash, zsh, tcsh, and fish shells; Added test coverage for shell implementations; Added tests for entrypoints; Added tests for git, npm, and sudo specific utilities; Added tests for the output\_readers.rerun module.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 61 (+0.0)
- Rubric changed (rubric-2026.08.18 → rubric-2026.08.19) — scores are not directly comparable.
Lenses
- Code Health 99 → 99 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 54 → 54 (+0.0)
- Readiness 46 → 46 (+0.0)
- Security 93 → 93 (+0.0)
Findings
- No change — the same findings as the prior survey.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nvbn/thefuck was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 5 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c7e7e1d884d3bb241ea6448f72a989434c2a35ec — the exact code this score is about.
- Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer latest.