CLI reference
Every command, flag, and exit code.
lawlint [options] <file.txt|file.md|file.docx|->
lawlint init [options]
lawlint learn <path> [options]
lawlint rules [--json]
lawlint rules test <path> [options]
lawlint self-update [options]
The file argument defaults to - (stdin), so a bare lawlint reads a pipe.
Linting options
FILE?path
File to lint. "-" reads stdin.
path"-"--format?"pretty" | "json" | "prompt"
Human-readable output, machine-readable JSON, or an AI revision brief for the flagged text.
"pretty" | "json" | "prompt""pretty"--rules?ID,ID
Run only the listed rules. Full ids or bare aliases.
ID,ID--disable?ID,ID
Run every rule except the listed ones.
ID,ID--markdown?flag
Strip fenced code blocks from the input. Enabled automatically for .md files.
flag--max-warnings?N | inf
Exit 1 when warnings exceed N.
N | inf"inf"--fix?flag
Apply machine-applicable fixes to FILE in place. For .docx, as native tracked changes with a review comment per fix.
flag--diff?flag
Show what --fix would change, or did change, as a colored diff.
flag--judge?flag | =MODEL
Run the soft-rule AI judge. Bare --judge uses the model from lawlint init; --judge=MODEL overrides it. Requires the = form when passing a model.
flag | =MODEL--quiet?flag
Suppress pretty output while preserving the exit status.
flag--rule-dir?DIR
Additional rule package directory. Repeatable; merged over the built-ins. Available on every command.
DIR--no-update-check?flag
Skip the once-a-day check for a newer release. Available on every command.
flagModel specs
--judge=MODEL, init --ai, and learn --model share one grammar:
| Spec | Provider |
|---|---|
anthropic:<model> |
Anthropic |
openai:<base-url>#<model> |
Any OpenAI-compatible endpoint |
foundry:<deployment> |
Azure AI Foundry |
init --ai additionally accepts the shorthands qwen and gemma.
lawlint init
Sets up the project: AI-model, judge, Markdown, and custom-rule choices, written
to .lawlint/config.json. API keys go to a user-level credential file, never
into the project.
--yes?flag
Accept the default answer for every prompt (non-interactive).
flag--force?flag
Overwrite an existing .lawlint/config.json.
flag--ai?MODEL
Model preference, skipping the catalog prompt: qwen, gemma, or a full spec.
MODELlawlint learn <path>
Mines a personal rule package from your own prior writing: a local statistical pass over the full corpus, an AI mining pass over a small sample, and a self-check so no generated rule flags your own text.
PATHpath
A file or directory of your writing (.docx, .md, .txt).
path--out?DIR
Where to write the generated rule package.
DIR.lawlint/rules/personal--model?MODEL
Mining model, overriding the lawlint init AI preferences.
MODELSee Learning your voice.
lawlint rules
lawlint rules --json
Prints metadata for every loaded rule — id, tier, scope, severity, description,
intent, rationale, and documentation URL — as JSON. Combine with --rule-dir to
include a package.
lawlint rules test <path>
Runs each Markdown rule’s own flag and pass examples and reports the result per example.
FILE_OR_DIRpath
A rule file or a rule package directory.
path--judge?flag | =MODEL
Judge inferential rules' examples. Without it, they are skipped.
flag | =MODEL--offline?flag
Skip inferential examples and never load a judge model. Conflicts with --judge.
flagSee Authoring rules.
lawlint self-update
--check?flag
Report current and latest version and whether an update is available. Downloads nothing.
flag--force?flag
Reinstall even when already on the latest version.
flag--version?X
Install this specific version instead of the latest.
XExit codes
| Code | Meaning |
|---|---|
0 |
No error-severity findings, and warnings within --max-warnings. |
1 |
An error-severity finding, or warnings over --max-warnings. |
2 |
An I/O or configuration error — the document was never linted. |