Free · Offline · MIT licensed · Rust CLI + MCP

redliner — Free Open-Source Legal & Contract Redliner CLI for AI Agents

redliner — Draftable for AI Agents: Diff two Word contracts and get a valid tracked-changes redline in one command. Skip fragile python-docx scripts and broken w:ins/w:del markup—redline contracts with 3.3x fewer tokens. Offline, fast, and free.

Install in one minute — see the install commands below. Source and README: github.com/creatorops-studio/redliner. 100% local — no network calls at all in the free build, your contracts never leave the machine.

Not legal advice. redliner is document markup, not legal advice. A lawyer must review any redline before it is relied on.

One JSON spec, one valid redline

Diff two contract versions, or drive the redline from a small JSON edit spec (replace / insert / delete by paragraph). The output is a real .docx with valid w:ins / w:del tracked changes that Word, LibreOffice and Google Docs open cleanly. No Word, no LibreOffice, no Python.

# 1. Diff two contract versions into a redlined .docx
redliner diff contract-v1.docx contract-v2.docx -o contract-red.docx

# 2. See the changes as machine-readable JSON
redliner list contract-red.docx

# 3. Or drive it from a JSON edit spec instead of a second file
redliner template > spec.json
redliner apply contract-v1.docx spec.json -o contract-red.docx

# 4. Check a document before you trust it
redliner validate contract-red.docx

Output of diff on the sample contracts (examples/contract-v1.docx → examples/contract-v2.docx), 6 changes:

wrote contract-red.docx (3657 bytes, 6 change(s))
Not legal advice: a redline is document markup, not legal advice. Have a lawyer review it before relying on it.

A change list your agent can read

list reports every change as machine-readable JSON — type, paragraph, text, author, date, id. Accept or reject all changes with one command; validate checks the document (missing parts, bad or duplicate w:id) before anyone trusts it. Abridged list output for the sample contracts:

[
  { "type": "insert", "paragraph": 2, "text": "Interest accrues on late payments at 1.5% per month. " },
  { "type": "delete", "paragraph": 3, "text": "thirty (30) " },
  { "type": "insert", "paragraph": 3, "text": "sixty (60) " },
  { "type": "delete", "paragraph": 5, "text": "Delaware, " },
  { "type": "insert", "paragraph": 5, "text": "New York, " },
  { "type": "delete", "paragraph": 7, "text": "in its sole discretion, " }
]

Install in one minute

Install straight from GitHub with a Rust toolchain (cargo) — the crate is not on crates.io yet:

cargo install --git https://github.com/creatorops-studio/redliner

Prefer a ready-made binary? Download the Release v0.1.0 binary for Linux x86_64 (2,243,960 B) from github.com/creatorops-studio/redliner/releases/tag/v0.1.0.

Measured numbers, not marketing

Measured 5 December 2026 on Linux x86_64, release build, with redliner benchmark. Timings are single-operation runs on the sample contracts (examples/contract-v1.docx → examples/contract-v2.docx, 10 paragraphs + 1 table); each command was run 3 times and the range is shown. Tokens ≈ characters / 4 (standard approximation, same rule both sides); the python-docx script is the canonical script an agent would write for the same redline task, kept verbatim in the repo so the comparison is reproducible.

What was measuredResult
Token cost to redline one contract120 tokens (JSON spec) vs 394 tokens (python-docx script) — 3.28× saving
Diff 2 sample contracts (6 changes)0.114–0.152 ms
Accept all changes (wall, incl. process start)~3–4 ms
Validate 1 document (wall, incl. process start)~2 ms
Peak RSS3,820 KB (~3.8 MB)
Binary size (release, stripped)2,243,960 B (2.14 MiB)

The token saving counts the spec vs the script only. It does not count the debug loops the script usually needs (broken w:ins/w:del markup, lost formatting), which would widen the gap.

Built for AI agents first

MCP server with five tools (diff_documents, apply_redline, accept_changes, reject_changes, list_changes). Add this to your MCP config — no browser, no cloud:

{
  "mcpServers": {
    "redliner": {
      "command": "redliner",
      "args": ["mcp"]
    }
  }
}

A contract redline that used to cost an agent 394 tokens of hand-written python-docx script now costs 120 tokens of JSON spec (3.28× saving, measured — see the repo README for the full benchmark). Example agent flow: diff_documents → list_changes to read the 6 changes as JSON → accept_changes → validate.

Built with: Rust, a single static binary, and an MCP server — clap + serde_json (+ zip + roxmltree for the .docx package and XML parsing).

Free, offline, MIT — and confidential

Single static binary, no cloud, no account, no network calls at all in the free build: your contracts never leave the machine. Free core is 80% of a real redline tool; Pro (coming later, $10–29/month) adds batch redlining, clause libraries, audit logs and a Cloud API.

Not legal advice

redliner is document markup, not legal advice. It marks what changed — never whether the change is good law. Every output says so, and a lawyer must review any redline before it is relied on.

Frequently asked questions

Is redliner really free?

Yes — MIT licensed, free core forever. Pro is a separate paid tier for batch/clause-library/audit/API features.

Does it work offline?

Yes. 100% local; the free build makes no network calls at all.

Does the redlined .docx open in Word?

Yes — it is a standard ECMA-376 package with valid w:ins/w:del tracked changes; accept reproduces the new version's text exactly and reject reproduces the old version's text exactly (verified by the repo's test suite).

Does it do move tracking or footnotes?

No — moved paragraphs show as delete + insert, and footnotes/endnotes/comments are preserved byte-for-byte, not diffed. Those are the 20% deliberately left out of the free version.

Is this legal advice?

No. redliner marks document changes only. Have a lawyer review any redline before relying on it.

How do I use it with Claude Code?

Add the MCP server block from the repo README to your MCP config; the agent gets diff_documents, apply_redline, accept_changes, reject_changes, list_changes.

How do I install it?

Run cargo install --git https://github.com/creatorops-studio/redliner (needs a Rust toolchain), or download the Release v0.1.0 binary for Linux x86_64 (2,243,960 B) from the v0.1.0 release. The crate is not on crates.io yet.

Redline a contract in one command.

Free, offline, MIT licensed — get the source on GitHub. Not legal advice.