Command-line interface¶
language_tool_python can be invoked directly from the command line, without writing
any Python code.
Usage¶
language_tool_python [OPTIONS] FILE [FILE ...]
Use - as the file argument to read from stdin.
Options¶
Option |
Description |
|---|---|
|
One or more plain-text files to check. Use |
|
Input file encoding (default: system locale). |
|
BCP 47 language code to use (e.g. |
|
First-language code. Enables false-friend detection between the target language and the mother tongue. |
|
Comma-separated list of rule IDs to disable. |
|
Comma-separated list of rule IDs to enable. |
|
Run only the rules listed with |
|
Enable stricter (picky) checking mode. |
|
Automatically apply the first suggestion for each match and print the corrected text. |
|
Disable all spell-checking rules. |
|
Skip lines that match the given regular expression. |
|
Hostname of a remote LanguageTool server to connect to instead of starting a local one. |
|
Port of the remote LanguageTool server. |
|
Enable debug logging. |
|
Print the |
Exit codes¶
Code |
Meaning |
|---|---|
|
No issues found. |
|
At least one issue was found. |
Examples¶
# Check a file
language_tool_python -l en-US README.md
# Check stdin
echo "This are bad." | language_tool_python -l en-US -
# Auto-apply suggestions and print the result
language_tool_python -l en-US --apply input.txt
# Disable spell checking
language_tool_python -l en-US --spell-check-off input.txt
# Disable specific rules
language_tool_python -l en-US -d RULE_ID1,RULE_ID2 input.txt
# Run only one specific rule
language_tool_python -l en-US --enabled-only -e MORFOLOGIK_RULE_EN_US input.txt
# Use a remote LanguageTool server
language_tool_python -l en-US --remote-host 127.0.0.1 --remote-port 8081 input.txt
# Picky mode with mother-tongue detection
language_tool_python -l de-DE -m en --picky input.txt