Pull California cases and annotated statutes from your own Lexis+ subscription straight into Word, by citation.
Resolve a citation, download the opinion or the Deering's annotated section as a Word file, and keep a local log of what you pulled. Uses your own logged-in Lexis+ session; no bulk crawling.
Authentication
Lexis+ has no API key. Sign in once with the press-auth companion (press-auth login plus.lexis.com); the CLI reuses that session's cookies and tells you when it expires.
Quick Start
# Check setup without touching Lexis
lexis-plus-pp-cli doctor --dry-run
# Confirm the citation lookup command works
lexis-plus-pp-cli cite check "27 Cal.3d 167" --dry-run
Unique Features
These capabilities aren't available in any other tool for this API.
From your brief to your binder
-
brief cites — List every California case and statute cited in your draft brief (.docx or .txt), de-duplicated.
Turns a draft into a pull list for batch.
lexis-plus-pp-cli brief cites motion.docx
-
brief check — Check every citation in a draft (footnotes included) against Lexis+ and flag the ones it does not recognize. A lookup that fails (expired session, timeout, server error) is reported as ERROR, never as NOT RECOGNIZED; the command exits 5 when any lookup failed and 3 when any citation was not recognized.
Catches mistyped volumes and pages before filing.
lexis-plus-pp-cli brief check motion.docx
-
brief gaps — See which cited authorities you have not pulled yet, and which pulled ones the draft no longer cites.
Shows exactly what is left to download.
lexis-plus-pp-cli brief gaps motion.docx --matter Acme
Keep a ledger
-
matter list — Browse everything you pulled for each matter, with date, format, and file path.
Answers 'did we pull the annotated version, and when?'
lexis-plus-pp-cli matter show Acme
-
statute whatsnew — Re-pull an annotated statute and see which annotations were added or removed since your last pull. Each run saves a new, separately named copy, so the previous copy is kept.
Finds new case notes without rereading 40 pages.
lexis-plus-pp-cli statute whatsnew "Cal Lab Code 1102.5"
-
matter binder — Copy a matter's files into one ordered folder (cases, then statutes) with an index.csv.
Binder and index in one command.
lexis-plus-pp-cli matter binder Acme --out ./binder
Cite-checking a brief
lexis-plus-pp-cli citecheck packet motion.docx --out ./citecheck/motion-sources --json
Lists every case and California statute the brief cites (footnotes and every section of a §§ list included) with each pin and the surrounding text, saves the Lexis+ Word copy and a page-marked text file for each, and runs Shepard's on the cases. Writes manifest.json in the folder. If any authority could not be fetched, or a requested Shepard's check did not run, the manifest lists it under incomplete, the text output marks it FAILED or PARTIAL, and the command exits 6; pass --allow-partial-failure to exit 0 with the partial packet.
lexis-plus-pp-cli citecheck quote "27 Cal.3d 167" --quote "an employer's authority over its employee does not include the right to demand that the employee commit a criminal act" --pin 178
Says whether the quotation is verbatim, lists every un-signaled difference, gives the official reporter page it sits on, and says whether the words are the majority's, a concurrence's, a dissent's, a footnote's, or Lexis editorial material. A pin matches only when it covers every page the quoted words sit on, so a quotation that runs from page 101 onto 102 needs --pin 101-102. Works offline once the authority is pulled; under --data-source local it never contacts Lexis+ and fails if the authority is not already on disk.
lexis-plus-pp-cli citecheck text "27 Cal.3d 167" --pages 175-176
Prints the opinion text on those official reporter pages, for checking a paraphrased proposition against its pin.
Recipes
Pull a case
lexis-plus-pp-cli case get "27 Cal.3d 167" --out ./authorities
Resolves the citation and saves the opinion as a Word file.
Pull an annotated statute
lexis-plus-pp-cli statute get "Cal Lab Code 1102.5" --out ./authorities
Saves Deering's with annotations as a Word file.
Narrow output
lexis-plus-pp-cli cite check "27 Cal.3d 167" --agent --select cite,doc_id
Agent-friendly JSON with only the fields you need.
Usage
Run lexis-plus-pp-cli --help for the full command reference and flag list.
Paths & environment variables
This CLI separates local files into four path kinds:
| Kind | Contents |
|---|
config | User-editable settings such as config.toml and saved profiles |
data | Durable local data: credentials.toml, data.db, cookies, browser-session proof files, and other auth sidecars |
state | Runtime state such as persisted queries, jobs, and teach.log |
cache | Regenerable HTTP/cache files |
Each kind resolves independently. The ladder is:
- Per-kind env var:
LEXIS_PLUS_CONFIG_DIR, LEXIS_PLUS_DATA_DIR, LEXIS_PLUS_STATE_DIR, or LEXIS_PLUS_CACHE_DIR
--home <dir> for this invocation
LEXIS_PLUS_HOME for a flat relocated root
- XDG env vars:
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME
- Platform defaults matching existing installs
For containers and agent sandboxes, prefer a single relocated root:
export LEXIS_PLUS_HOME=/srv/lexis-plus
lexis-plus-pp-cli doctor
Under LEXIS_PLUS_HOME=/srv/lexis-plus, the four dirs resolve to /srv/lexis-plus/config, /srv/lexis-plus/data, /srv/lexis-plus/state, and /srv/lexis-plus/cache.
On Windows, set the same variable in PowerShell:
$env:LEXIS_PLUS_HOME = "C:\srv\lexis-plus"
lexis-plus-pp-cli doctor
Under $env:LEXIS_PLUS_HOME = "C:\srv\lexis-plus", the four dirs resolve to C:\srv\lexis-plus\config, C:\srv\lexis-plus\data, C:\srv\lexis-plus\state, and C:\srv\lexis-plus\cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"lexis-plus": {
"command": "lexis-plus-pp-mcp",
"env": {
"LEXIS_PLUS_HOME": "/srv/lexis-plus"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as LEXIS_PLUS_DATA_DIR overrides an explicit --home for that kind. Use LEXIS_PLUS_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting LEXIS_PLUS_HOME does not move files back to platform defaults, and doctor cannot find credentials left under a former root. Move the files manually before unsetting relocation variables.
Existing installs keep working because the platform-default rung matches the legacy layout. On the first auth write, stored secrets leave config.toml and are consolidated into credentials.toml under the data directory. Run lexis-plus-pp-cli doctor --fail-on warn to check path and credential-location warnings in automation.
Local data
Reads are saved locally by default: in --data-source auto mode every successful read is also written to the SQLite store (data.db, or data-<hash>.db per credential) in the data directory. GET responses are cached for five minutes under http/ in the cache directory. Credentials live in credentials.toml in the data directory. The learn journal lives under learn/ in the state directory. lexis-plus-pp-cli doctor prints the resolved paths, every store file, and the response-cache size.
None of it is encrypted. New files are created owner-only; beyond that the data relies on OS account permissions and full-disk encryption (FileVault, BitLocker, LUKS).
- Erase it:
lexis-plus-pp-cli local-data purge lists the store files, response cache, learn journal, and Lexis+ research history (the retrieval log of matter names and file paths, and saved red-flag reports) it would delete; add --yes to delete them, or --only store|cache|journal|history to narrow it. Downloaded Word/PDF files, config, and credentials are kept.
- Research history follows
--home: the retrieval log (retrievals.jsonl) and red-flag reports (redflags/) live in the data directory, so --home, LEXIS_PLUS_HOME, and LEXIS_PLUS_DATA_DIR keep separate homes' matters apart. Records from earlier releases are moved there on first use when no home override is set.
- Run without a local copy: set
LEXIS_PLUS_NO_LOCAL_DATA=1. Reads go to the API (--data-source live; --data-source local still reads an existing store), the response cache is off (--no-cache), nothing new is written to the store, and sync and workflow archive refuse to run. Set it in an MCP host's env block and every command the server runs inherits it.
- Choose the read source without flags:
LEXIS_PLUS_DATA_SOURCE=auto|live|local sets the --data-source default; an explicit flag wins.
Commands
delivery
Lexis+ document delivery (download) jobs
lexis-plus-pp-cli delivery create - Queue a download job that renders one or more documents to Word (docx), PDF, or RTF
lexis-plus-pp-cli delivery file - Fetch the rendered file bytes for a finished delivery job
lexis-plus-pp-cli delivery get - Get a delivery job, including its downloadUri once rendered
lexis-plus-pp-cli delivery status - Poll a delivery job (status 6 = success)
lookup
Citation lookup: run a Lexis+ search-box search and read its queued result
lexis-plus-pp-cli lookup result - Read the result of a queued search; single-document (citation) hits come back as sdrResult with the document path
lexis-plus-pp-cli lookup start - Start a Lexis+ search-box search (returns the search page HTML, which embeds the searchId used by lookup result)
lexis-plus-pp-cli lookup suggest - Search-box type-ahead suggestions (recognizes citations and names the document they point to)
Self-learning loop
This CLI caches per-question discovery so repeat queries skip the walk and structurally similar queries get answered via entity substitution. The loop also self-captures: every invocation is journaled locally, and failed-flag corrections plus fresh teaches surface as candidates on the next recall for confirm/reject judgment. Agents call recall before discovery and fire teach & after answering. See the ## Automatic learning section in SKILL.md for the full protocol.
lexis-plus-pp-cli recall <query> - Look up cached resources for a query before running discovery
lexis-plus-pp-cli teach - Record a query -> resource mapping (silent on success, safe to background with &)
lexis-plus-pp-cli learnings list - Inspect taught rows
lexis-plus-pp-cli learnings forget <query> - Undo a teach
lexis-plus-pp-cli learnings candidates - List auto-captured candidates awaiting confirm/reject
lexis-plus-pp-cli learnings stats - Local loop metrics: recall hit rate, teach-to-reuse, playbook resolution, candidate counts
lexis-plus-pp-cli teach-pattern - Install a query/resource template up front
lexis-plus-pp-cli teach-lookup - Add an entity mapping (e.g. country code, team alias) for pattern substitution
Pass --no-learn or set LEXIS_PLUS_NO_LEARN=true to disable the loop for deterministic flows.
The local store's schema version stamp is one-way: once this version of lexis-plus-pp-cli opens the database, older binaries refuse it with a version error — upgrade the binary rather than downgrading.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
lexis-plus-pp-cli delivery get mock-value
# JSON for scripting and agents
lexis-plus-pp-cli delivery get mock-value --json
# Filter to specific fields
lexis-plus-pp-cli delivery get mock-value --json --select jobId,courierJobStatus,downloadUri
# Dry run — show the request without sending
lexis-plus-pp-cli delivery get mock-value --dry-run
# Agent mode — JSON + compact + no prompts in one flag
lexis-plus-pp-cli delivery get mock-value --agent
--csv prefixes a leading ' on cells and header keys that start with =, +, -, @, a tab, or a line break (including fullwidth =+-@) so a spreadsheet does not run them as formulas. Plain signed numbers such as -5 and +2.5e3 are left unchanged.
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select <field>[,<field>...] returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Explicit retries - add
--idempotent to create retries when a no-op success is acceptable
- Explicit confirmation -
--agent does not imply --yes; pass --yes separately only after the target, arguments, and side effects are clear
- Piped input - write commands can accept structured input when their help lists
--stdin
- Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 6 partial failure, 7 rate limited, 8 async job submitted but not finished (rerun the printed recovery command; do not resubmit), 10 config error.
Health Check
lexis-plus-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Run lexis-plus-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ~/.config/lexis-plus-pp-cli/config.toml on macOS/Linux and %USERPROFILE%\.config\lexis-plus-pp-cli\config.toml on Windows; --home, LEXIS_PLUS_HOME, and per-kind env vars can relocate it.
Static request headers can be configured under headers; per-command header overrides take precedence.
--ca-cert, LEXIS_PLUS_CA_CERT, or ca_cert adds a PEM CA bundle to the system trust roots. --tls-server-name, LEXIS_PLUS_TLS_SERVER_NAME, or tls_server_name is the name checked against the certificate when the dialed address does not match it. Precedence is flag, then environment, then the config file. A config file other users can change does not supply these settings. Certificate verification failures are not retried.
Troubleshooting
Authentication errors (exit code 4)
- Run
lexis-plus-pp-cli doctor to check credentials
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
API-specific