@credence/cli
v0.6.0
Published
Credence CLI: `credence demo` (zero-infra) and `credence mcp`.
Readme
@credence/cli
npx credence demo # narrated, zero-infra investigation (in-memory PGlite)
npx credence mcp --data ./data # serve the tool surface over MCP (persistent)
npx credence export --case <id> --out ./evidence --data ./data # auditor evidence packcredence demo
Runs a full investigation end to end — an agent reads public documents about a company and tracks what it knows, what it doesn't, where sources conflict, what it verified as absent, and what changed before a decision. No Docker, no Postgres — an in-memory PGlite database is created and torn down in-process.
credence mcp
Starts an MCP server over stdio using a sample domain (swap the ontology, rules, and
views for your own). Pass --data <dir> for a persistent PGlite database and
--case-title to open a default case.
The sample domain lives in src/domain.ts — copy it as the
starting point for your own policy.
credence export
Writes a deterministic auditor evidence pack for one case.
npx credence export --case case_acme --out ./evidence --data ./.credence-data
npx credence export --case case_acme --out ./evidence --data ./.credence-data --redact pii| Flag | Meaning |
|---|---|
| --case <id> | the case to export (required) |
| --out <dir> | destination directory; must be empty or not exist (required) |
| --data <dir> | PGlite data directory. Without it the ledger is in-memory and therefore empty, and the command fails naming the case it could not find — it will never emit a hollow pack. |
| --redact <preset> | none (default), pii, or structure-only |
The pack is a directory of 17 files: 16 artifacts plus a MANIFEST.json holding
each artifact's SHA-256 and byte length, the chain verdict, and a packDigest
over all of them. It is byte-identical for identical ledger state: no
generation timestamp, canonical JSON throughout, and no archive — tar/zip
headers embed mtimes that would break exactly the property the pack exists to
prove. The sixteenth artifact is prov.jsonld — the case projected into W3C
PROV-DM — so a consumer that has never heard of Credence can read the graph.
NOTICE.md inside the pack states what it does not attest, so the
disclaimer travels with the evidence.
packDigest is an RFC 6962 Merkle root, and MANIFEST.json carries the
construction — leaf definition, ordering, odd-node handling — as data, so it can
be re-derived without this repository. RFC 6962 rather than the Bitcoin
construction for two reasons: leaves and internal nodes are domain-separated by a
prefix byte, and no node is ever duplicated to pad an odd level, so two different
file lists can never share a root.
MANIFEST.json also carries the ledger's chain checkpoint and the full
verifyChain verdict, witnessed included. chainIntact is true only for a
verdict of ok — an indeterminate chain is reported as not intact, because an
unverifiable history must never read as a clean one.
Redaction presets hash rather than delete, so an auditor can still verify that two
sources agree without being shown the value. Page and bounding box are always
kept: they are pointers, and dropping them would destroy the auditability the pack
exists to demonstrate. Actor strings are never redacted under any preset —
attribution is the record here. The resolved policy is recorded in
MANIFEST.json.
Like credence mcp, this wires the sample domain from src/domain.ts.
Swap it for your own ontology, rules and conflict families in a real deployment —
the pack builder in src/pack/ takes a ledger, a rules engine and an
optional judge, and does not care whose policy produced them.
See docs/COMPLIANCE.md for what each artifact answers under NIST AI RMF, ISO/IEC 42001 and EU AI Act Articles 12 and 14.
