Skip to content

yuluo-yx/typo

Typo

Fix mistyped shell commands from the command line.

Build Status Go Version License Stars

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.

Typo Demo

TheFuck?

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.

Highlights

  • 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.

Quick Start

Install with Homebrew:

brew tap yuluo-yx/typo https://github.com/yuluo-yx/typo
brew install typo

Or install on macOS / Linux with the script:

curl -fsSL https://raw.githubusercontent.com/yuluo-yx/typo/main/tools/scripts/install.sh | bash

On Windows PowerShell 7+:

iwr -useb https://raw.githubusercontent.com/yuluo-yx/typo/main/tools/scripts/quick-install.ps1 | iex

For upgrades, checksum verification, and platform-specific notes, see Quick Start.

Shell Integration

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 doctor

Now type a command with a mistake and press Esc Esc:

gti stauts

# after pressing Esc Esc
git status

CLI Commands

Use 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 list

See Command Reference for all subcommands and flags.

Documentation

Development

Development requires Go 1.25+ and GNU Make.

make setup
make test
make ci

Before submitting changes, make sure the Git pre-commit hooks pass. See Contributing for coding standards, test expectations, and commit message format.

Release Integrity

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.

Contributors

Thanks to everyone who helped build Typo.

Typo Contributors

License

MIT