diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 3b07e19..e1dfe84 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to the `nirium-cli` package are documented here. ## Unreleased +### Added + +- `nirium anchor` ([#133](https://github.com/nirium-protocol/nirium/issues/133)): anchors a sha-256 hash (`--hash`), a file's sha-256 (`--file`, the file itself is never uploaded), or a small JSON record (`--record`, max 8KB, enforced client-side) to IPFS via an Audit Trail node's `POST /api/audit/log`. Optional `--tx`/`--tag`; no `--network` flag by design - the agent box decides its own network. Prints the CID, content hash, gateway URL, and a `nirium verify` suggestion. + ## 3.0.1 - 2026-10-24 ### Fixed diff --git a/packages/cli/README.md b/packages/cli/README.md index 0db7131..58aa02a 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -202,6 +202,46 @@ Each line is pass or fail: `--json` prints the same report (`ok`, `seller`, `network`, `checks`) for CI. +## Anchor a record + +```bash +nirium anchor --file evidence.json +nirium anchor --hash <64-hex-sha256> +nirium anchor --record '{"order":"A-12"}' +``` + +Anchors a sha-256 hash (or a small JSON object, up to 8KB) to IPFS via an +Audit Trail node's `POST /api/audit/log`, and prints back the CID. + +- `--file ` computes the sha-256 of the file locally and sends only + the hash - the file's contents are never uploaded. IPFS cannot delete + anything once pinned, so hashing locally means raw evidence never + leaves your machine. +- `--hash ` sends a sha-256 you already have (64 hex chars, optional + `sha-256:` prefix). +- `--record ` anchors a small JSON object verbatim (max 8KB, + enforced here before the request, not just by the server). Don't put + personal data in it - an anchored record can never be deleted. + +Exactly one of the three is required. `--tx ` and `--tag