Sarek CLI
A single compiled binary, sarek, that exposes Sarek Core directly in the
terminal. No runtime required. Results go to stdout, errors and progress go to
stderr, so it composes well in scripts and pipelines.
Commands
| Command | Description |
|---|---|
sarek stamp "text" | Hash a string locally and stamp it |
sarek stamp file.pdf | Auto-detects a file path, hashes the bytes locally, stamps |
sarek verify <proof.ldgp> | Verify a proof file |
sarek verify <proof.ldgp> <data> | Verify a proof plus the original data (full check) |
sarek stamps list | List all local stamps as a table |
sarek stamps get <id> | Show one stamp and its proof path |
sarek config show | Show the current configuration |
sarek config set url <url> | Set the Core Service URL and persist it |
The data you verify is hashed locally; the CLI never uploads file contents.
stamp
sarek stamp "loan #4821 approved, rate 4.1%"Stamping...
Stamped
ID 550e8400-e29b-41d4-a716-446655440000
Hash a7ffc6f8...
TX 0xbb325c9f...
Block 10789522
Proof sarek-core/proofs/550e8400-e29b-41d4-a716-446655440000.ldgpStamping a file works the same way. If the argument is an existing file path, the file bytes are hashed; otherwise the argument is treated as a string:
sarek stamp invoice-2026-118.pdfverify
Verification renders a progressive checklist and stops at the first failing check.
With the original data attached, all checks run:
sarek verify proof.ldgp "loan #4821 approved, rate 4.1%"Verifying...
Data unchanged... ok
Proof is valid... ok
Integrity proven... ok block 10789522
Independently verifiable... ok
Status: Full match - all layers verifiedWith only the proof file, the data integrity check is skipped:
sarek verify proof.ldgpVerifying...
Data unchanged... skip - no raw data attached
Proof is valid... ok
Integrity proven... ok block 10789522
Independently verifiable... ok
Status: Partial match - proof file verified. Attach raw data for
full verificationA tampered proof fails with exit code 1. The report still goes to stdout, because an invalid proof is a legitimate answer, not an operational error:
Verifying...
Data unchanged... skip - no raw data attached
Proof is valid... FAILED
Invalid
Proof has been tampered withstamps
sarek stamps list ID Hash Timestamp TX
550e84 a7ffc6 2026-06-10 10:00:00 0xbb325c...
def456 3e23e8 2026-06-10 11:00:00 0xcc456d...sarek stamps get 550e8400-e29b-41d4-a716-446655440000Prints the full record fields and the proof file path. An unknown id exits with code 1.
config
sarek config show url https://api.sarek.technology
timeout 30000sarek config set url https://core.example.comurl is the only supported key. An unknown key exits with code 1 and a clear
error message.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success, including verify with a valid proof |
| 1 | Runtime error: network, timeout, IO, missing file, invalid proof |
| 2 | Usage error: wrong arguments or unknown command |
This makes the CLI usable in CI:
if sarek verify proof.ldgp report.pdf; then
echo "report intact"
else
echo "verification failed"
fiLocal files
The CLI bootstraps a sarek-core/ directory in the working directory on first
run:
sarek-core/
config.json { "url": "https://api.sarek.technology", "timeout": 30000 }
.gitignore created automatically
records/
records.jsonl one line per stamp (UUID, hash, timestamp, txHash,
blockNumber)
proofs/
<id>.ldgp one proof file per stamp, named by record idColors are only emitted on a TTY and respect NO_COLOR. Hashes and
transaction ids are truncated for display only; the stored values are
complete.