redink
A spellchecker for prose — a terminal UI for humans and a JSON CLI for agents.
Redink is built for long-form writing (novels, manuscripts). It pairs a vetted system dictionary with a per-project working dictionary that lives in your repository, so coinages, names, and foreign phrases travel with the text. It's smart about the things prose actually trips on: possessives of coinages, hyphenated compounds, short Latin phrases, and Markdown.
Dictionary model
- System dictionary: the bundled SCOWL
en_US(size 60, version 2020.12.07), embedded in the binary so redink works with nothing installed. If a systemen_US.{aff,dic}is present it is preferred (so--lang en_GBetc. work); see--sysdict-dir. - Working dictionary:
.redink.dicin your repo (found by searching from the current directory upward). All additions go here and only here — the system dictionary is never modified. Plain-text, one entry per line, git-friendly.
The working dictionary format:
# bare word -> case-insensitive (accepted in any case)
# =Word -> case-sensitive (accepted only in that exact casing)
# multi-word line -> phrase (matched as bigrams against neighbours)
# =Multi Word -> phrase, exact casing only
hobbit
=Gondor
per se
=Tzeya Gan
Build
# binary: target/release/redink
Usage
Global options: --dict <PATH>, --lang <LANG> (default en_US),
--sysdict-dir <DIR>, --format <auto|markdown|text> (default auto; md
is accepted as a shorthand for markdown).
Paths may be files or directories; a directory is walked for .md/.txt,
honoring .gitignore. A file named explicitly is checked whatever its
extension. With no paths at all, redink walks the current directory.
A bare redink <files> launches the TUI when stdout is a terminal, otherwise
runs a non-interactive check.
Exit codes: 0 clean · 1 misspellings found · 2 error. A file that
could not be read counts as an error, so 0 never hides a mistyped path.
JSON schema (check --json)
An array of objects, one per occurrence:
byte_offset is absolute and word is the exact bytes at that offset, so a
precise, unambiguous replacement is redink fix <file> --at <byte_offset> --word <word> --to <replacement>. compound carries the whole hyphenated
token when the misspelling is one part of a compound, otherwise null.
TUI keys
| key | action |
|---|---|
j k n N |
move between misspellings |
1–9 |
replace with the Nth suggestion |
r |
type a replacement (Enter/Esc) |
i |
ignore this word for the session (case-insensitive, not persisted) |
a |
add the word, case-insensitive (any case) |
A |
add the word, exact case |
h |
add the whole hyphenated compound, case-insensitive |
H |
add the whole hyphenated compound, exact case |
p |
add a word or phrase at a prompt (= toggles exact case, Enter/Esc) |
s |
save edited files · q save + quit · Q / Ctrl-C discard + quit · ? help |
The misspelling is shown in context (a character window centered on the word), highlighted, with numbered suggestions.
How it handles prose
-
Possessives of coinages. Add the base form and the possessive comes free: adding
BillacceptsBill'stoo. Adding via the possessive (Atrax's) registers the stem (Atrax). Works for ASCII and Unicode (') apostrophes. -
Hyphenated compounds.
Tzeya-Ganis checked whole first; if nothing recognizes it, each part is checked, and only the bad part is flagged (sorecieve-barflagsrecieve, leavesbar). Add a compound withh/Hordict add Tzeya-Ganto accept it as a unit.--em-dashes split cleanly. -
Phrases.
per se,de facto,a priori,in vitro,ad hoc, … are recognized as units (43 common Latin phrases bundled; add your own as multi-word lines, or=Multi Word/--sensitivefor exact casing). The fragment words are accepted only in the phrase, so a standaloneseis still flagged. -
Markdown. Fenced/inline code, bare URLs, YAML frontmatter, and HTML comments/tags are skipped. Override per-file with
--format. -
In-file directives (Markdown only). HTML comments, so they vanish from pandoc output:
<!-- redink:off -->…<!-- redink:on -->skips a passage — between blocks, or mid-sentence:She said <!-- redink:off -->"Ze vorld"<!-- redink:on -->.Either marker may carry an optional reason, echoed in any warning about it:<!-- redink:off Kesh's dialect -->.<!-- redink:allow vorld =Kesh -->accepts those words anywhere in the file (bare = any case,=Word= exact case, possessives free), without switching off checking for the surrounding prose.
An
offwith noonskips to end of file and warns — on stderr, and in an alert when the TUI opens. Strayons, typo'd directives (redink:of), and emptyallows warn on stderr; warnings never change the exit code. Directives inside code are inert.--no-ignoredisregards them all, for auditing what they hide. -
Suggestions. System-dictionary candidates arrive in that dictionary's own ranking and keep it. Working-dictionary entries are then merged into the list at the position their closeness to the flagged word earns — Damerau- Levenshtein, so a transposition counts as one slip — rather than being pinned to the front. A coinage that is genuinely the likely intent leads; one that is merely present in the project sinks to where it belongs. Exact ties go to the working dictionary, on the grounds that a word the author wrote down is the better guess between two equally close candidates. Candidates shorter than 3 characters are dropped as noise.
Credit & license
The bundled English dictionary is derived from SCOWL
© 2000–2026 Kevin Atkinson and others (permissive; see
assets/dict/en_US-COPYRIGHT), with the affix file from Geoff Kuenning's
ispell (BSD). Local fixes are kept as a build-time patch manifest
(assets/dict/en_US.patches); see "Local modifications" in that file.