Tool · Python
template-vault-cli
A Git-backed, clause-aware package manager for legal-document templates. Public sources
(Common Paper, YC SAFE, Bonterms) and your own house templates live in one searchable,
composable, version-tracked vault. Clauses are first-class objects with provenance: fork a
template, swap a single clause in from another, and later pull upstream parent improvements into
your fork — meta.json records which clause came from where, so the merge
is deterministic. The storage layer at the start of the contract pipeline.
pipx install template-vault-cli, then template-vault demo
for a zero-config compose-and-swap tour. template-vault init in a folder makes a
vault; import, find, compose,
and swap work from there. It structures templates — it doesn't
generate clause text.
Try it live
Explore a seeded demo vault — search, list, and inspect templates and their clauses (read-only).
Runs the real CLI on your input in a sandbox — no setup, nothing stored. Open in a new tab ↗
What it does
- Stores templates as plain files in a Git repo. Multi-user sync is just
git pull/git push(wrapped assync/publish). No database, no server. - Indexes with a small
meta.jsonper template. Category, jurisdiction, tags, summary, version history.findsearches by category, tag, jurisdiction, or keyword. - Clause-aware composition.
composeforks a base template;swapreplaces one clause from another template. Each swap appends toclause_overridesinmeta.json— e.g."Term and Survival" from nda/yc@v1— so the provenance is permanent. - Deterministic upgrades. When a parent template gets a new version,
upgradepulls the parent's other clause changes into your fork but leaves locally-swapped clauses alone. That's the whole point of recording the override. - Public-source import.
sourceslists known upstreams;import common-paper-mutual-ndafetches the text from the upstream URL at import time (with optional hash pinning). Nothing is bundled. - Versioning + integrity.
historyshows the versions / swaps / amends timeline;diffcompares two versions;verifydoes a content-level sha256 check across the vault. - Opt-in, metadata-only LLM.
asksends only template metadata (name, category, jurisdiction, tags, summary, clause titles) to your configured provider by default;--with-contentadds excerpts only after explicit confirmation (or--yes-sendin CI). The CLI structures existing templates; it does not write new clauses.
Quickstart
# Install
pipx install template-vault-cli
template-vault --version
# Zero-config: compose + swap against inline fixtures, then poke at the vault
template-vault demo
# Or pull a real public template into a vault of your own
mkdir my-vault && cd my-vault
template-vault init
template-vault import common-paper-mutual-nda
template-vault list
# Fork + swap one clause, with provenance recorded
template-vault compose --base nda/house --as nda/house-startup
template-vault swap nda/house-startup --clause "Term and Survival" --from nda/yc
template-vault info nda/house-startup # shows clause_overrides: 1 For agents and automation
template-vault is the suite's storage contract. The cross-CLI interop doc
(docs/INTEROP.md)
is the citation point for what this repo provides to its siblings. Structured outputs
(info --json, find --json, history --json,
stats --json) are validated against JSON Schemas committed under
docs/spec/,
with a semver commitment: a backward-incompatible schema change requires a major version bump.
Downstream tools (e.g. nda-review-cli pulling clause structure) validate
against the schema rather than trusting field shapes by convention.
# Discover what's in the vault, then resolve a template path
template-vault find "mutual nda california" --json --top-k 5
template-vault info nda/common-paper-mutual --json
template-vault get nda/common-paper-mutual --path-only # → hand to draft-cli
LLM features (ask) share one on-disk provider config with the other Python CLI in the
suite: ~/.config/contract-ops/llm.json is the suite-wide location, so configuring it once
lights up LLM features across every tool that adopts the same lookup order. Metadata-only by default; content
excerpts require explicit consent. --why on the write-side commands prints a short
structured explanation to stderr so it never pollutes structured stdout.
Where it fits in the workflow
The storage layer at the start of the six-CLI workflow. template-vault get <ref>
resolves a versioned template, which you hand to draft-cli to fill placeholders,
then to nda-review-cli for review and negotiation. It's where your house
templates and forked public sources live with provenance — the source of truth the rest of the pipeline draws
from. See the full workflow for the chained commands.
It's also useful on its own as a versioned, searchable library for any team that maintains a collection of document templates and wants composition with an audit trail. The contract pipeline is one application.
Repo
github.com/DrBaher/template-vault-cli · MIT licensed · Stdlib-only Python ([docx] extra adds python-docx) · PyPI-installable.