Command Auto-Correction Tool
English | 简体中文
Press Esc Esc to fix typos automatically.
# Install
go install github.com/yuluo-yx/typo/cmd/typo@latest
# Add to ~/.zshrc
eval "$(typo init zsh)"Restart your terminal, then press Esc Esc after a typo.
Download from Release
Download the binary for your platform from the Releases page:
| Platform | File |
|---|---|
| Linux AMD64 | typo-linux-amd64 |
| Linux ARM64 | typo-linux-arm64 |
| macOS AMD64 | typo-darwin-amd64 |
| macOS ARM64 | typo-darwin-arm64 |
| Windows AMD64 | typo-windows-amd64.exe |
# Example for macOS ARM64
curl -LO https://github.com/yuluo-yx/typo/releases/latest/download/typo-darwin-arm64
chmod +x typo-darwin-arm64
sudo mv typo-darwin-arm64 /usr/local/bin/typoBuild from Source
git clone https://github.com/yuluo-yx/typo.git
cd typo
make installtypo fix "gut stauts" # → git status
typo fix "dcoker ps" # → docker pstypo learn "gut" "git" # Save rule for future usetypo rules list # List all rules
typo rules add "gut" "git" # Add custom rule
typo rules remove "gut" # Remove ruletypo history list # Show past corrections
typo history clear # Clear historytypo doctor # Check configuration statustypo init zsh # Print shell integration script
typo version # Show version
typo uninstall # Uninstall typoTypo corrects commands in this priority:
- Error Parsing - Extracts "did you mean" suggestions from stderr
- History - Uses previously learned corrections
- Rules - Built-in and user-defined patterns
- Edit Distance - Fuzzy matching based on keyboard layout
- git:
did you mean..., missing upstream, etc. - docker: Unknown command suggestions
- npm: Command not found suggestions
Automatically parses tool subcommands for intelligent suggestions:
typo fix "git stattus" # → git status
typo fix "docker biuld" # → docker buildSupported: git, docker, npm, yarn, kubectl, cargo, go, pip, brew, terraform, helm
Files stored in ~/.typo/:
~/.typo/
├── history.json # Correction history
├── rules.json # User rules
└── subcommands.json # Subcommand cache
make build # Build for current platform
make build-all # Build for all platforms
make test # Run tests
make lint # Run linterMIT
