@343dev/languagetool-node
June 28, 2026 · View on GitHub
CLI spell and grammar checker. Sends checks to an externally managed LanguageTool HTTP service.
Rationale
Some projects have a lot of documentation inside the repos. Once we decided to start linting their grammar and check for spelling errors. But we didn’t want to send our docs to the unknown servers of the well-known services.
Hence, we decided to build our own CLI tool upon the LanguageTool.
Getting Started
Install the package:
npm i -g @343dev/languagetool-node
Run a LanguageTool service. The easiest way is an official-style Docker image, for example:
Example:
docker run --rm -p 8081:8081 erikvl87/languagetool
Check the selected image’s documentation for its exposed port and configuration. The CLI defaults to http://127.0.0.1:8081. If your service runs elsewhere, set languageTool.url in ~/.languagetoolrc.js (see below).
Usage
The tool can check the passed files or the text from STDIN.
Check files:
languagetool-node README.md CHANGELOG.md
Check files defined using globs:
languagetool-node ~/project1/**/*.txt ~/project2/*.md
Check the text from STDIN:
echo "Insert your text here .. or check this textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017." | languagetool-node
Running languagetool-node with no arguments (and no piped stdin) prints usage and exits non-zero, so you can always rediscover how to drive the tool.
Options
-h,--help— Print usage and exit. Takes precedence over everything else.-V,--version— Print the CLI version and exit.-u,--url <url>— Override the LanguageTool service URL for this run only (beats config).
The --url flag accepts the same forms as languageTool.url in config: an origin (http://127.0.0.1:8081), a URL with a path prefix (https://example.com/languagetool), or a URL with a trailing slash (trimmed). /v2/check is appended automatically.
languagetool-node --url http://127.0.0.1:9090 README.md
Output example
$ echo "Insert your text here .. or check this textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017." | languagetool-node
<stdin>
1:23 warning Two consecutive dots typographical spell
Context: «Insert your text here .. or check this textt. LanguageTool 4.0 w...»
Possible replacements: «.»
1:26 warning This sentence does not start with an uppercase letter typographical spell
Context: «Insert your text here .. or check this textt. LanguageTool 4.0 were...»
Possible replacements: «Or»
1:40 warning Possible spelling mistake found misspelling spell
Context: «Insert your text here .. or check this textt. LanguageTool 4.0 were releasd on Thurs...»
Possible replacements: «text, texts, text t»
1:69 warning Possible spelling mistake found misspelling spell
Context: «...check this textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017. »
Possible replacements: «released, release»
1:80 warning The date 29 december 2017 is not a Thursday, but a Friday. inconsistency spell
Context: «...textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017. »
⚠ 5 warnings
External configuration file
It’s possible to override default options by creating file ~/.languagetoolrc.js. It will be merged with default config.
Example of external config:
export default {
// LanguageTool HTTP service base URL. `/v2/check` is appended to it,
// so a path prefix is preserved, e.g. `https://example.com/languagetool`
// becomes `https://example.com/languagetool/v2/check`.
languageTool: {
url: 'http://127.0.0.1:8081',
},
// allowed words (regexps are supported)
ignore: [
'(T|O)TF',
],
};
Credits
The picture for the project was made by Sergey Mylnikov & Igor Garybaldi.
Other projects
- 🖼 optimizt — CLI tool for image optimization: compresses PNG, JPEG, GIF, SVG, and creates AVIF/WebP
- 📦 harold — CLI tool that compares frontend project bundle sizes between snapshots
- 🐳 jailbot — Docker container wrapper with automatic filesystem path mounting
- 📝 markdown-lint — Markdown code style linter based on Prettier, Remark, and Typograf