English | ็ฎไฝไธญๆ
This guide covers breaking changes and migration steps for users upgrading from Typo 0.x releases to v1.
-
Check your current version:
typo version
-
Back up your local data directory:
cp -r ~/.typo ~/.typo.backup
-
Note which shell integration line you use. Run
typo doctorto confirm.
Typo 0.1.x did not have a config file. If you are upgrading from 0.1.x, no migration is needed โ v1 creates ~/.typo/config.json on first use with sensible defaults.
If you are upgrading from 0.2.x, the config file format (~/.typo/config.json) is forward-compatible with v1. The following keys are unchanged:
similarity_thresholdmax_edit_distancemax_fix_passesauto_learn_thresholdkeyboardhistory.enabledrules.<scope>.enabled
v1 may introduce additional config keys. Unknown keys in your existing file are preserved but ignored.
If your config file is invalid JSON, v1 quarantines it automatically (renamed to config.json.corrupt-<timestamp>) and falls back to defaults. You can regenerate a fresh config with:
typo config gen --force| 0.x command | v1 equivalent | Notes |
|---|---|---|
typo fix <command> |
typo fix <command> |
Unchanged |
typo learn <from> <to> |
typo learn <from> <to> |
Unchanged |
| N/A | typo config list|get|set|reset|gen |
New in 0.2.0, stable in v1 |
| N/A | typo rules list|add|remove|enable|disable |
New in 0.2.0, stable in v1 |
| N/A | typo history list|clear |
New in 0.2.0, stable in v1 |
| N/A | typo doctor |
New in v1 |
| N/A | typo uninstall |
New in v1 |
If you have scripts that call typo fix, they continue to work as before. The -s <file> and --exit-code <n> flags are unchanged.
The shell init commands are unchanged from 0.2.x:
# zsh
eval "$(typo init zsh)"
# bash
eval "$(typo init bash)"
# fish
typo init fish | source
# PowerShell
Invoke-Expression (& typo init powershell | Out-String)Changes to be aware of:
- fish support is new in v1. If you were using zsh or bash on 0.x and want to switch to fish, add the fish init line above.
TYPO_SHELL_INTEGRATIONenvironment variable is set to1by all shell integrations in v1.typo doctorchecks for this variable. If you have custom scripts that check for typo's presence, use this variable.TYPO_ACTIVE_SHELLenvironment variable is set by the fish integration to help typo detect the shell. Other shells use$SHELLdetection.- Shell integration scripts now set owner-tracking variables (
TYPO_STDERR_CACHE_OWNER,TYPO_ORIG_STDERR_FD_OWNER) to safely handle nested shell sessions. These are internal and should not be set manually.
The ~/.typo/ directory layout has expanded:
~/.typo/
โโโ config.json (new in 0.2.0)
โโโ rules.json (user rules, previously learned corrections)
โโโ usage_history.json (correction history)
โโโ subcommands.json (cached subcommand discovery)
- If upgrading from 0.1.x,
rules.jsonis the only file that may already exist. All other files are created automatically. subcommands.jsonis a cache file. Deleting it is safe โ it will be regenerated on next use.- The directory permissions should be
0755and file permissions should be0600.
Current v1 builds write subcommands.json with schema_version: 2. This format
stores a tree of subcommands so typo can correct nested command paths such as
aws cloudformation wait stack-create-complete and
gcloud container clusters list.
Older cache files from previous builds may not have a schema_version field or
may use a flat list format. On first load, typo moves those files aside as
subcommands.json.corrupt-<timestamp> and creates a fresh cache when
subcommand discovery runs again.
No manual migration is required. The cache does not store user rules, history,
or configuration. If you want to force a refresh, delete ~/.typo/subcommands.json
and run a command that uses subcommand correction.
v1 introduces additional builtin rule scopes beyond what was available in 0.2.0:
| Scope | Since |
|---|---|
git, docker, npm |
0.1.0 |
yarn, kubectl, cargo, brew |
0.2.0 |
helm, terraform, python, pip, go, java, system |
0.2.0 |
All scopes are enabled by default. If you previously disabled a scope, your setting is preserved.
v1 supports these install methods (all verified by typo doctor):
curlinstall script (macOS / Linux)- Windows PowerShell quick-install script
- Homebrew
- Manual GitHub Release binary
If you installed with Homebrew, upgrade through Homebrew:
brew update
brew upgrade typoIf you used the install script, re-run it to get the latest version:
curl -fsSL https://raw.githubusercontent.com/yuluo-yx/typo/main/tools/scripts/install.sh | bashAfter upgrading:
- Restart your terminal (or source your shell config).
- Run
typo doctorto verify the new version is loaded and all checks pass. - Run
typo versionto confirm the version number. - Run
typo config listto verify your settings carried over. - Run
typo rules listto verify your custom rules are intact.
If you need to revert to 0.x:
-
Restore your backup:
rm -rf ~/.typo mv ~/.typo.backup ~/.typo
-
Install the specific 0.x version:
curl -fsSL https://raw.githubusercontent.com/yuluo-yx/typo/main/tools/scripts/install.sh | bash -s -- -s 0.2.0 -
Restart your terminal.