CODESPELL(1)

🌸 CODESPELL 🌸

okay so bestie, lemme tell you about codespell β€” it finds and fixes your typos, and honestly? she's iconic for it.


✨ SYNOPSIS ✨

codespell [OPTIONS] [file1 file2 ... fileN]

πŸ’– DESCRIPTION πŸ’–

codespell is designed to find and fix common misspellings in text files. She's built primarily for sniffing out misspelled words in source code, but she'll happily vibe with other files too. no gatekeeping πŸ’…

the full usage situation, verbatim, so you can screenshot it:

usage: codespell [-h] [--version] [-d] [-c] [-w] [-D DICTIONARY]
       [--builtin BUILTIN-LIST] [--ignore-regex IGNORE_REGEX]
       [--ignore-multiline-regex IGNORE_MULTILINE_REGEX] [-I FILES] [-L
       WORDS] [--uri-ignore-words-list WORDS] [-r REGEX] [--uri-regex
       URI_REGEX] [-s] [--count] [-S SKIP] [-x FILES] [-i MODE] [-q
       LEVEL] [-e] [-f] [-H] [-A LINES] [-B LINES] [-C LINES]
       [--ignore-sic] [--stdin-single-line] [--config CONFIG] [--toml
       TOML] [files ...]

🫢 positional arguments πŸ’œ

  • files β€” the files or directories you want her to check. hand 'em over.

🌈 options ✨

  • -h, --help β€” show this help message and exit. classic.
  • --version β€” show program's version number and exit.
  • -d, --disable-colors β€” turn off colors, even when printing to terminal. (no fun allowed mode 😭 but do what u gotta do)
  • -c, --enable-colors β€” turn colors ON, even when not printing to terminal. rainbow always 🌈
  • -w, --write-changes β€” write the changes in place if possible. she's fixing it for real, no cap.
  • -D, --dictionary DICTIONARY β€” comma-separated list of custom dictionary files that contain spelling corrections. if this flag isn't specified, or if it equals "-", then the default dictionary is used.
  • --builtin BUILTIN-LIST β€” comma-separated list of builtin dictionaries to include (when "-D -" or no "-D" is passed). Use 'all' to include every builtin dictionary. current options are:
    • 'clear' β€” for unambiguous errors
    • 'rare' β€” for rare (but valid) words that are likely to be errors
    • 'informal' β€” for making informal words more formal
    • 'usage' β€” for replacing phrasing with recommended terms
    • 'code' β€” for words from code and/or mathematics that are likely to be typos in other contexts (such as uint)
    • 'names' β€” for valid proper names that might be typos
    • 'en-GB_to_en-US' β€” for corrections from en-GB to en-US
    • 'en_to_en-OX' β€” for corrections from en to en-OX

the default is 'clear,rare'.

  • --ignore-regex IGNORE_REGEX β€” regular expression used to find patterns to ignore by treating them as whitespace. when writing regular expressions, consider making sure there are boundary nonword chars, e.g., "\bmatch\b". defaults to empty/disabled.
  • --ignore-multiline-regex IGNORE_MULTILINE_REGEX β€” regular expression used to ignore text that may span multi-line regions. the regex is run with re.DOTALL. for example, to allow skipping of regions of Python code using begin/end comments, you could use: --ignore-multiline-regex '# codespell:ignore-begin *\n.*# codespell:ignore-end *\n'. defaults to empty/disabled.
  • -I, --ignore-words FILES β€” comma-separated list of files that contain words to be ignored by codespell. files must contain 1 word per line. words are case sensitive based on how they are written in the dictionary file.
  • -L, --ignore-words-list WORDS β€” comma-separated list of words to be ignored by codespell. words are case sensitive based on how they are written in the dictionary file.
  • --uri-ignore-words-list WORDS β€” comma-separated list of words to be ignored by codespell in URIs and emails only. words are case sensitive based on how they are written in the dictionary file. if set to "*", all misspelling in URIs and emails will be ignored.
  • -r, --regex REGEX β€” regular expression used to find words. by default, any alphanumeric character, the underscore, the hyphen, and the apostrophe are used to build words. 🫒 heads up bestie: this option cannot be specified together with --write-changes.
  • --uri-regex URI_REGEX β€” regular expression used to find URIs and emails. a default expression is provided.
  • -s, --summary β€” print a summary of fixes.
  • --count β€” print the number of errors as the last line of stderr.
  • -S, --skip SKIP β€” comma-separated list of files to skip. it accepts globs too! e.g.: if you want codespell to skip .eps and .txt files, you'd give "*.eps,*.txt" to this option.
  • -x, --exclude-file FILES β€” ignore whole lines that match those in the comma-separated list of files EXCLUDE. the lines in these files should match the to-be-excluded lines exactly.
  • -i, --interactive MODE β€” set interactive mode when writing changes:
    • 0: no interactivity.
    • 1: ask for confirmation.
    • 2: ask user to choose one fix when more than one is available.
    • 3: both 1 and 2.
  • -q, --quiet-level LEVEL β€” bitmask that allows suppressing messages:
    • 0: print all messages.
    • 1: disable warnings about wrong encoding.
    • 2: disable warnings about binary files.
    • 4: omit warnings about automatic fixes that were disabled in the dictionary.
    • 8: don't print anything for non-automatic fixes.
    • 16: don't print the list of fixed files.
    • 32: don't print configuration files.

as usual with bitmasks, these levels can be combined; e.g. use 3 for levels 1+2, 7 for 1+2+4, 23 for 1+2+4+16, etc. the default mask is 34.

  • -e, --hard-encoding-detection β€” use chardet to detect the encoding of each file. this can slow down codespell, but it's more reliable in detecting encodings other than utf-8, iso8859-1, and ascii. (she's thorough, not fast πŸ’)
  • -f, --check-filenames β€” check file names as well.
  • -H, --check-hidden β€” check hidden files and directories (those starting with ".") as well. yes, even the sneaky ones πŸ‘€
  • -A, --after-context LINES β€” print LINES of trailing context.
  • -B, --before-context LINES β€” print LINES of leading context.
  • -C, --context LINES β€” print LINES of surrounding context.
  • --ignore-sic β€” ignore a misspelling immediately followed by the editorial "[sic]" marker (optionally preceded by a closing quote).
  • --stdin-single-line β€” output just a single line for each misspelling in stdin mode.
  • --config CONFIG β€” path to config file.
  • --toml TOML β€” path to a pyproject.toml file.
πŸŽ€ pro tip moment: use @PATH to read additional arguments from file PATH.

πŸ‘‘ AUTHOR πŸ‘‘

Lucas De Marchi <lucas.de.marchi@gmail.com>


πŸ”₯ SEE ALSO πŸ”₯

https://github.com/codespell-project/codespell β€” go say hi, she's got a whole repo πŸ’–


and that's the whole manpage bestie, you ate that. this was codespell 2.4.3, dated August 2026, written up in the CODESPELL(1) manual. now go fix ur typos, ily, bye πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from