Linc is a legal AI terminal agent built on top of the Pi agent harness.
The project goal is deliberately narrow:
- keep upstream Pi behavior as intact as possible;
- make Case.dev the first-class model and legal-workflow provider;
- ship built-in legal tools, skills, themes, and matter context;
- keep the Linc overlay small enough that upstream Pi changes can be merged without drama.
In short: Linc = Pi + legal workflows + Case.dev.
| Package | Description |
|---|---|
@casemark/linc |
Linc CLI and TUI |
@earendil-works/pi-ai |
Upstream Pi model/provider toolkit |
@earendil-works/pi-agent-core |
Upstream Pi agent runtime |
@earendil-works/pi-tui |
Upstream Pi terminal UI library |
Linc-specific source lives in packages/coding-agent/src/linc.
That directory owns:
- Case.dev auth and model loading;
- native Case.dev vault tools;
- vault session attachment;
- vault-backed
MATTER.mdmaterialization and sync; - bundled legal skills;
- Linc startup policy.
Code outside that directory should stay close to upstream Pi unless the change is a small generic hook needed by the overlay.
npm install -g --ignore-scripts @casemark/linc
export CASEDEV_API_KEY=sk_case_...
lincUseful local development commands:
npm install --ignore-scripts
npm run check
npm run dark-lincdark-linc is the local/internal development variant. It uses a separate config directory (~/.dark-linc) so experimental auth, sessions, and settings do not collide with normal linc.
Release automation is documented in docs/release.md.
Linc uses one Case.dev API key for model access and legal workflow tools:
export CASEDEV_API_KEY=sk_case_...Inside the TUI:
/loginconfigures Case.dev auth./modelselects dynamically fetched Case.dev models./vaultopens the vault selector./vault attach <vault-id>attaches a Case.dev vault to the session./vault showshows the attached vault./vault clearor/vault unlinkunlinks the vault./mattershows the active matter file and vault./matter editopensMATTER.mdin Linc's editor and syncs changes back to the vault./matter syncmanually syncs workspaceMATTER.mdback to the vault./initstarts guided legal matter initialization for the attached vault./autoinitexplores the attached vault and draftsMATTER.md, marking unsupported fields asUNKNOWN.
An attached vault is persisted in the session until /vault clear.
MATTER.md is Linc's durable legal matter context file.
When a vault is attached, Linc looks for MATTER.md in the vault, materializes it into the workspace, and loads it into the agent prompt. Edits to the workspace-root MATTER.md are synced back to the attached vault.
The file should contain durable matter-level state:
- representation and role;
- goals and open questions;
- jurisdiction and source rules;
- working preferences;
- short source-map pointers to vault documents;
- durable tasks and status.
It should not contain raw evidence dumps, full transcripts, credentials, scratchpad reasoning, or bulk legal research output.
After code changes:
npm run checkRun focused tests from the relevant package root:
cd packages/coding-agent
npx tsx ../../node_modules/vitest/dist/cli.js --run test/linc-vault-matter.test.tsDo not use broad staging commands when committing. Stage only the files you changed.
Linc is a fork of Pi. The clean merge strategy is to keep Linc-specific behavior isolated under packages/coding-agent/src/linc and avoid runtime rewrites in Pi core.
When upstream Pi changes land, merge them into Linc, then resolve only the small set of intentional Linc overlay touchpoints.
MIT