Skip to content
lawlint
Esc
navigateopen⌘Jpreview
On this page

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

PropType
FILE?path

File to lint. "-" reads stdin.

Typepath
Default"-"
--format?"pretty" | "json" | "prompt"

Human-readable output, machine-readable JSON, or an AI revision brief for the flagged text.

Type"pretty" | "json" | "prompt"
Default"pretty"
--rules?ID,ID

Run only the listed rules. Full ids or bare aliases.

TypeID,ID
--disable?ID,ID

Run every rule except the listed ones.

TypeID,ID
--markdown?flag

Strip fenced code blocks from the input. Enabled automatically for .md files.

Typeflag
--max-warnings?N | inf

Exit 1 when warnings exceed N.

TypeN | inf
Default"inf"
--fix?flag

Apply machine-applicable fixes to FILE in place. For .docx, as native tracked changes with a review comment per fix.

Typeflag
--diff?flag

Show what --fix would change, or did change, as a colored diff.

Typeflag
--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.

Typeflag | =MODEL
--quiet?flag

Suppress pretty output while preserving the exit status.

Typeflag
--rule-dir?DIR

Additional rule package directory. Repeatable; merged over the built-ins. Available on every command.

TypeDIR
--no-update-check?flag

Skip the once-a-day check for a newer release. Available on every command.

Typeflag

Model 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.

PropType
--yes?flag

Accept the default answer for every prompt (non-interactive).

Typeflag
--force?flag

Overwrite an existing .lawlint/config.json.

Typeflag
--ai?MODEL

Model preference, skipping the catalog prompt: qwen, gemma, or a full spec.

TypeMODEL

See Setting up AI features.

lawlint 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.

PropType
PATHpath

A file or directory of your writing (.docx, .md, .txt).

Typepath
--out?DIR

Where to write the generated rule package.

TypeDIR
Default.lawlint/rules/personal
--model?MODEL

Mining model, overriding the lawlint init AI preferences.

TypeMODEL

See 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.

PropType
FILE_OR_DIRpath

A rule file or a rule package directory.

Typepath
--judge?flag | =MODEL

Judge inferential rules' examples. Without it, they are skipped.

Typeflag | =MODEL
--offline?flag

Skip inferential examples and never load a judge model. Conflicts with --judge.

Typeflag

See Authoring rules.

lawlint self-update

PropType
--check?flag

Report current and latest version and whether an update is available. Downloads nothing.

Typeflag
--force?flag

Reinstall even when already on the latest version.

Typeflag
--version?X

Install this specific version instead of the latest.

TypeX

Exit 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.

Last updated on July 24, 2026