Skip to content
CAI
Software that uses CAICheck a score

nvbn/thefuck

54.1

Adequate · 10 November 2026

5.2k

lines of production code

Python

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

The Fuck is a command-line utility that automatically corrects common shell typing errors by analyzing command history and suggesting fixes. It operates as a modular Python application supporting Bash, Zsh, Fish, Tcsh, and PowerShell, with rules for correcting misspelled commands, missing sudo privileges, and workflow mistakes. The system features configurable settings, multiple output retrieval methods including instant mode, and cross-platform compatibility for Unix and Windows environments.

How it got here

2015 — Initial release and architectural refactor

9 changes.

This period marks the initial release of The Fuck 3.32, establishing the core Python application structure and a comprehensive set of shell correction rules. The work involved a major architectural refactor that transformed the project from a simple script into a modular system with XDG-compliant configuration and platform-specific utilities. A robust test suite was also introduced to cover unit, functional, and rule-specific logic across multiple shells and operating systems.

2016–2023 — Windows support and shell refactoring

7 changes.

The project expanded its platform compatibility by adding native support for Windows CMD and PowerShell, alongside a comprehensive refactoring of shell integration into modular classes. Significant architectural changes were made to the output retrieval system, introducing instant mode and shell logger support to improve performance and handle complex prompts. These functional enhancements were accompanied by extensive test coverage additions and entrypoint reorganization to ensure stability across the new and modified components.

Features

Added Windows CMD and PowerShell support for The Fuck

Users on Windows can now use The Fuck via CMD and PowerShell. A new \fuck.bat\ script enables CMD usage by invoking PowerShell to execute the command and retrieve the last history entry. A new \fuck.ps1\ script provides a PowerShell experience that automatically initializes The Fuck in the user's profile on first use, defines a global \fuck\ function, and handles color reset.

scripts · high confidence

Initial release of The Fuck 3.32

The project is initialized with version 3.32, establishing the core Python application structure. This includes the \setup.py\ configuration with specific Python version requirements (2.7+ and 3.5+), dependency declarations for \psutil\, \colorama\, and \six\, and the integration of \fastentrypoints.py\ to optimize console script generation. The release also introduces essential project infrastructure files such as \.editorconfig\, \tox.ini\ for multi-version testing, \snapcraft.yaml\ for Snap packaging, and a deprecated \install.sh\ script, alongside updated documentation in \README.md\ and \CONTRIBUTING.md\.

(repo-wide) · high confidence

Initial release of shell correction rules

The \thefuck/rules\ directory is populated with a comprehensive set of rules that automatically correct common shell mistakes. This includes corrections for misspelled commands (via \no\_command\ and specific CLI tools like \git\, \brew\, \docker\, \apt\, \cargo\, etc.), missing \sudo\ privileges, typos in arguments (such as \cd..\ or \cs\), and specific workflow errors like dirty tar/unzip extraction, git branch management, and file path issues.

thefuck/rules · high confidence

Shell support refactored into modular classes with PowerShell added

The shell integration logic has been restructured into distinct classes (Bash, Zsh, Fish, Tcsh, PowerShell, and a Generic fallback) within the \thefuck/shells\ module. This change introduces native support for PowerShell (both \powershell\ and \pwsh\), allowing the tool to correct commands in Windows environments. The refactoring also improves shell detection by checking the process tree via \psutil\ if the \TF\_SHELL\ environment variable is not set, and implements shell-specific alias generation and history management (e.g., using \fc\ for Bash/Zsh and \builtin history\ for Fish) to ensure commands are correctly expanded and recorded.

thefuck/shells · high confidence

Architecture

Reorganizes OS-specific utilities into a dedicated module

The \thefuck/specific\ package has been introduced to centralize OS- and tool-specific logic, moving utilities previously scattered across the codebase into dedicated modules for apt, Arch Linux (yay/pikaur/yaourt), brew, DNF, Git (alias expansion), Nix, npm (script detection), sudo, and yum. This change improves import performance and isolates platform-specific checks, such as verifying the availability of package managers or resolving Git aliases, making the core rule logic cleaner and more maintainable.

thefuck/specific · high confidence

Behavioural changes

Major architectural refactor and feature expansion

The application has been completely rewritten from a simple script into a modular system. Configuration now follows the XDG Base Directory Specification (defaulting to \~/.config/thefuck) with a new settings file and environment variable support. The command-line interface now supports arguments like --debug, --yes, and --repeat, and includes an experimental instant mode. The core logic has been split into distinct modules (conf, corrector, types, ui, logs), introducing features such as rule priorities, exclusion lists, third-party rule support, and colored output.

thefuck · high confidence

Refactor system utilities into platform-specific modules

The system-dependent utility functions have been reorganized into a new \system\ module with separate implementations for Unix and Windows. This change introduces \system/unix.py\ and \system/win32.py\, which handle platform-specific logic for key input (\get\_key\), output initialization (\init\_output\), and file opening (\open\_command\). The refactoring ensures consistent behavior across platforms, such as handling arrow keys correctly on Windows via \msvcrt\ and initializing colorama properly, while also applying a monkeypatch to \pathlib.Path.expanduser\ to fix a known Windows bug.

thefuck/system · high confidence

Reorganized entrypoints and fixed alias printing order

The entrypoint logic has been reorganized into separate modules (alias, fix\_command, main, not\_configured, shell\_logger). A key behavioral change ensures the alias is printed before attempting to fix a command, preventing issues with subshells. Additionally, settings are now initialized before printing the alias, and the system checks for the 'script' utility when instant mode is enabled.

thefuck/entrypoints · high confidence

Unified output retrieval with instant mode and shell logger support

The output reading mechanism has been refactored into a modular system that supports three distinct methods for retrieving command output. Users with instant mode enabled (Python 3+ only) will now have command output read from a memory-mapped log file, which parses the last megabyte of the shell log to improve performance and handle multiline PS1 prompts correctly. Additionally, a new shell logger integration allows the tool to fetch output from an external shell logger via a Unix socket if available, providing a fallback or alternative to the classic rerun method. The classic rerun method remains the default when neither instant mode nor the shell logger is active, but now includes improved handling for slow command timeouts and decoding errors.

_thefuck/output\readers · high confidence

Test coverage

Added functional test suite for shell integration; Added test coverage for shell integration modules; Added tests for entrypoint modules; Added tests for git, npm, and sudo specific utilities; Added tests for rule correction logic; Added tests for the output reader rerun module; Initial test suite for The Fuck.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 53 → 54 (+1.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 87 → 85 (-2.3)
  • Architecture 100 → 100 (+0.0)
  • Maturity 48 → 54 (+5.4)
  • Readiness 38 → 38 (+0.0)
  • Security 85 → 85 (+0.0)
  • Performance 75 → 75 (+0.0)

Findings

  • No change — the same findings as the prior survey.

Written by cca.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 10 November 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.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.12+preprod-0a1a03138314.