Skip to content

✏ typos

typos is a fast, low-dependency spellchecker written in Rust. It checks source code and markdown documents for typos and spelling errors.

🛠 Installation

You can download pre-compiled binaries from the GitHub releases page, or install it using a package manager.

brew install typos-cli
cargo install typos-cli

⚙ Config

Typos is configured via a config file. In this repository, the config file is _typos.toml, which is auto-generated by a Python script from dictionary.txt.

Do NOT edit _typos.toml directly

Any custom words should be added to dictionary.txt (one word per line, sorted alphabetically). The config file _typos.toml must be regenerated afterwards.

Dictionary File

Add allowed words to dictionary.txt. Remember to sort the dictionary after editing:

task sort

Config Generation

Before running the spellchecker, regenerate the configuration:

uv run python scripts/generate_typos_config.py

📝 Usage

Task Tasks

1. Run spellcheck globally

task spellcheck

2. Run spellcheck on a specific file

task spellcheck-file FILE="docs/index.md"

3. Sort the custom dictionary file

task sort

CLI Commands

1. Run spellcheck on the current directory

typos

2. Run spellcheck on a specific file

typos file.md

🔗 References