Fix mistyped shell commands from the command line.
English | 简体中文
Typo is a command auto-correction tool written in Go. Type a command, press Esc Esc, and Typo replaces the command line with a likely correction.
There is already TheFuck, so why write Typo?
There were a few reasons:
- TheFuck is no longer actively maintained, and issues and PRs are not being handled. This is the main reason.
- TheFuck is tied to Python versions, so installation took extra effort.
- TheFuck does not handle commands containing
""very well.
For these reasons, I wrote Typo in Go. It is not a translation of TheFuck. It is built from scratch.
- Correct commands in place from zsh, bash, fish, and PowerShell.
- Fix top-level commands, subcommands, compound commands, pipes, and runtime errors.
- Teach personal corrections with
typo learn; Typo stores user rules and history under~/.typo. - Install native binaries on macOS, Linux, WSL, and Windows PowerShell 7+.
- Written in Go, with binary installs that do not require an external runtime.
Install with Homebrew:
brew tap yuluo-yx/typo https://github.com/yuluo-yx/typo
brew install typoOr install on macOS / Linux with the script:
curl -fsSL https://raw.githubusercontent.com/yuluo-yx/typo/main/tools/scripts/install.sh | bashOn Windows PowerShell 7+:
iwr -useb https://raw.githubusercontent.com/yuluo-yx/typo/main/tools/scripts/quick-install.ps1 | iexFor upgrades, checksum verification, and platform-specific notes, see Quick Start.
Install Typo first, then add the matching init command to your shell config.
| Shell | Config file | Init command |
|---|---|---|
| zsh | ~/.zshrc |
eval "$(typo init zsh)" |
| bash | ~/.bashrc |
eval "$(typo init bash)" |
| fish | ~/.config/fish/config.fish |
typo init fish | source |
| PowerShell 7+ | $PROFILE.CurrentUserCurrentHost |
Invoke-Expression (& typo init powershell | Out-String) |
Restart your terminal and check the setup:
typo doctorNow type a command with a mistake and press Esc Esc:
gti stauts
# after pressing Esc Esc
git statusUse the CLI directly when you want explicit output or custom rules:
typo fix "gut status && dcoker ps"
typo learn "gst" "git status"
typo config list
typo rules list
typo history listSee Command Reference for all subcommands and flags.
- Quick Start
- Command Reference
- Usage Examples
- Stability Contract
- Troubleshooting
- Upgrading from 0.x
- How Typo Works
Development requires Go 1.25+ and GNU Make.
make setup
make test
make ciBefore submitting changes, make sure the Git pre-commit hooks pass. See Contributing for coding standards, test expectations, and commit message format.
Each GitHub Release publishes a checksums.txt file with SHA-256 hashes for all platform binaries.
If you install from release assets directly, verify the downloaded binary against that file before placing it on your PATH.
For step-by-step verification commands, see Quick Start.
Thanks to everyone who helped build Typo.
MIT