typos

Source code spell checker that reports known misspellings, applies unambiguous corrections, and supports project-specific dictionaries and CI checks.

install

typos is a spell checker for source code. Running typos reports misspellings in a project, and typos --write-changes (or -w) applies the corrections in place. If a typo has more than one possible correction, it reports the typo and moves on without changing the file.

Instead of guessing the closest valid word from a dictionary, typos keeps a list of known typo corrections. This approach targets recognized misspellings and supports automated checks on pull requests. Heuristics skip non-words such as hashes. Intentional spellings such as names, acronyms and localized content can be allowed in _typos.toml with extend-words, extend-identifiers or extend-ignore-identifiers-re. File types can be configured to skip content checks while still checking file names (check-file = false), and files can be excluded with files.extend-exclude.

For debugging, --dump-config - shows the effective config, and --files, --identifiers and --words show how the project is being processed. -v enables debug logging. For custom integrations, - reads from stdin and writes corrections to stdout with --write-changes. --diff outputs a diff, and --format json emits jsonlines, with exit code 0 for no typos and 2 when typos are found. Documented integrations include GitHub Actions, pre-commit, GitLab Code Quality, a VS Code extension, a language server (typos-lsp) and a Putout processor. It suits developers and CI maintainers who want automated spell checking of code and documentation.

Installation

# via Homebrew
brew install typos-cli
# via Cargo
cargo install typos-cli --locked
# via Conda
conda install typos

typos terminal output showing detected spelling mistakes

Alternatives & related tools

add a badge to your README

Maintain typos? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/typos.svg)](https://www.trmn.sh/tools/typos?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/typos?utm_source=badge"><img src="https://www.trmn.sh/badge/typos.svg" alt="Featured on trmn" height="20"></a>