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 asuint)'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 withre.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 bycodespell. 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 bycodespell. 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 bycodespellin 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 ofstderr.-S,--skip SKIPβ comma-separated list of files to skip. it accepts globs too! e.g.: if you wantcodespellto skip.epsand.txtfiles, 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: both1and2.
-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β usechardetto detect the encoding of each file. this can slow downcodespell, but it's more reliable in detecting encodings other thanutf-8,iso8859-1, andascii. (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 apyproject.tomlfile.
π 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
- ubuntu stonking: codespell 2.4.3-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms