CLI Reference¶
PrimeStamp provides a command-line interface built with Typer and Rich. The CLI is available as primestamp (or the short alias ps) after installation.
Global Usage¶
stamp¶
Create a document stamp.
Arguments:
| Argument | Description |
|---|---|
FILE |
Path to the file to stamp (required) |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--output |
-o |
FILE.stamp.json |
Output stamp file path |
--key |
-k |
None | Identity key file for signing |
--preset |
-p |
None | Preset: casual, standard, archival, maximum |
--anchors |
-a |
bitcoin,ethereum |
Comma-separated anchor types |
--version |
-v |
1.0.0 |
Semantic version for the document |
--fingerprint |
-f |
False |
Generate Prime-Space fingerprint |
Examples:
# Basic stamp with default anchors
primestamp stamp document.pdf
# Stamp with identity and preset
primestamp stamp document.pdf -k identity.json -p archival
# Custom anchors and output path
primestamp stamp paper.pdf -a bitcoin,ethereum,rfc3161 -o paper.stamp.json
# Include Prime-Space fingerprint
primestamp stamp thesis.pdf -k identity.json -p archival --fingerprint
# Stamp with version number
primestamp stamp contract.pdf -v 2.1.0 -k identity.json
verify¶
Verify a document stamp's integrity, signature, and optionally check content hash.
Arguments:
| Argument | Description |
|---|---|
STAMP_FILE |
Path to the stamp file to verify (required) |
Options:
| Option | Short | Description |
|---|---|---|
--file |
-f |
Original document file to verify content hash against |
Examples:
# Verify stamp structure and signature only
primestamp verify document.stamp.json
# Verify stamp AND content hash against original file
primestamp verify document.stamp.json -f document.pdf
Output: A table showing signature check, content hash check, trust score, and overall validity.
hash¶
Compute a cryptographic hash of a document.
Arguments:
| Argument | Description |
|---|---|
FILE |
Path to the file to hash (required) |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--algorithm |
-a |
sha3-256 |
Hash algorithm: sha3-256, sha256, blake3 |
Examples:
# Default SHA3-256
primestamp hash document.pdf
# BLAKE3 (faster for large files)
primestamp hash document.pdf -a blake3
# SHA-256 (Bitcoin-compatible)
primestamp hash document.pdf -a sha256
info¶
Display detailed information about a stamp.
Arguments:
| Argument | Description |
|---|---|
STAMP_FILE |
Path to the stamp file to inspect (required) |
Options:
| Option | Description |
|---|---|
--json |
Output raw JSON instead of formatted display |
Examples:
# Human-readable summary
primestamp info document.stamp.json
# Raw JSON output (useful for piping)
primestamp info document.stamp.json --json
presets¶
List all available configuration presets with their settings.
Output: A table showing each preset's name, description, storage mode, encryption, anchors, and trust threshold.
identity generate¶
Generate a new Ed25519 signing identity.
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--output |
-o |
identity.json |
Output key file path |
--force |
-f |
False |
Overwrite existing file |
Examples:
# Generate with default filename
primestamp identity generate
# Custom output path
primestamp identity generate -o ~/.primestamp/my-identity.json
# Overwrite existing
primestamp identity generate -o identity.json --force
Protect your key file
The identity file contains your Ed25519 private key. Anyone with this file can sign stamps as you. Store it securely and back it up.
identity show¶
Display the public key from an identity file.
Arguments:
| Argument | Description |
|---|---|
KEY_FILE |
Path to the identity key file (required) |
Examples:
fingerprint generate¶
Generate a Prime-Space fingerprint for a document.
Arguments:
| Argument | Description |
|---|---|
FILE |
Path to the file to fingerprint (required) |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--output |
-o |
None | Output fingerprint JSON file |
--method |
-m |
hierarchical |
Decomposition method: hierarchical, flat, content_addressed, semantic |
Examples:
# Generate and display summary
primestamp fingerprint generate document.pdf
# Save to file
primestamp fingerprint generate document.pdf -o document.fingerprint.json
# Use flat decomposition
primestamp fingerprint generate document.pdf -m flat
fingerprint compare¶
Compare two documents using their Prime-Space fingerprints.
Arguments:
| Argument | Description |
|---|---|
FILE1 |
First file to compare (required) |
FILE2 |
Second file to compare (required) |
Examples:
Output: A table showing similarity at each shadow scale (2, 3, 5, 7, 11, 13) with percentage and assessment.
fingerprint shadows¶
Display the shadow transform of a document at a specific scale.
Arguments:
| Argument | Description |
|---|---|
FILE |
Path to the file to analyze (required) |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--scale |
-s |
7 |
Shadow scale to display (prime number: 2, 3, 5, 7, 11, 13) |
Examples:
# Default scale (7)
primestamp fingerprint shadows document.pdf
# Fine-grained scale
primestamp fingerprint shadows document.pdf -s 2
# Coarse scale
primestamp fingerprint shadows document.pdf -s 13
init¶
Initialize PrimeStamp in a directory or git repository.
Arguments:
| Argument | Default | Description |
|---|---|---|
PATH |
. (current directory) |
Directory to initialize |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--preset |
standard |
Anchoring preset | |
--wizard |
-w |
False |
Run interactive setup wizard |
Examples:
# Initialize in current directory
primestamp init
# Initialize with archival preset
primestamp init --preset archival
# Interactive setup wizard
primestamp init --wizard
When run inside a git repository, this sets up git integration with hooks for automatic stamping.
anchor¶
Submit all pending stamps to blockchain anchors.
Options:
| Option | Short | Description |
|---|---|---|
--force |
-f |
Force anchor even if under cost threshold |
Examples:
# Anchor with confirmation prompt
primestamp anchor
# Force anchor without prompt
primestamp anchor --force
status¶
Show PrimeStamp status for the current directory.
Displays the configuration, git integration status, pending stamps, and daily cost.
serve¶
Start the PrimeStamp API server with web dashboard.
Options:
| Option | Default | Description |
|---|---|---|
--host |
127.0.0.1 |
Host to bind to |
--port |
8800 |
Port to listen on |
--web |
True |
Serve web dashboard |
--reload |
False |
Enable auto-reload for development |
Examples:
# Start with defaults (localhost:8800)
primestamp serve
# Public access on custom port
primestamp serve --host 0.0.0.0 --port 8080
# Development mode with auto-reload
primestamp serve --reload
After starting, the following endpoints are available:
- API:
http://host:port - OpenAPI docs:
http://host:port/docs - Web dashboard:
http://host:port/dashboard
ui¶
Launch the terminal user interface (TUI).
Requires the textual package. Install with:
vault create¶
Create a new vault for dead man's switch key escrow.
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--key-file |
-k |
required | Path to the encrypted key file to escrow |
--deadline |
-d |
72h |
Heartbeat deadline (e.g. 24h, 7d, 168h) |
--content-uri |
-u |
None | Content URI (repeatable for multiple URIs) |
--manual-release |
False |
Allow manual release by the vault owner | |
--metadata |
-m |
None | Metadata as key=value pairs (repeatable) |
Examples:
# Create a vault with 72-hour deadline
primestamp vault create -k secret.key.enc -d 72h
# With multiple content URIs and manual release
primestamp vault create -k secret.key.enc -d 7d \
-u ipfs://Qm... -u arweave://tx123 --manual-release
# With metadata
primestamp vault create -k secret.key.enc -d 48h -m label=project-keys -m env=production
vault heartbeat¶
Submit a heartbeat to extend a vault's deadline.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault to renew (required) |
Options:
| Option | Short | Description |
|---|---|---|
--fee-receipt |
-r |
Transaction receipt for the mandatory fee |
Examples:
vault batch-heartbeat¶
Submit heartbeats for multiple vaults in a single operation.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
One or more vault IDs (required) |
Options:
| Option | Short | Description |
|---|---|---|
--fee-receipt |
-r |
Transaction receipt for the mandatory batch fee |
Examples:
vault status¶
Display the current status of a vault.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault to inspect (required) |
Examples:
Output: A table showing the vault state, deadline, last heartbeat time, heartbeat count, content URIs, and metadata.
vault list¶
List vaults belonging to the current identity.
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--state |
-s |
None | Filter by state: active, released, burned, expired |
--limit |
-l |
50 |
Maximum number of results |
--offset |
0 |
Pagination offset | |
--json |
False |
Output raw JSON instead of formatted table |
Examples:
# List all vaults
primestamp vault list
# List only active vaults
primestamp vault list -s active
# JSON output for scripting
primestamp vault list --json
vault release¶
Manually release a vault's escrowed key. Only works if the vault was created with --manual-release.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault to release (required) |
Options:
| Option | Short | Description |
|---|---|---|
--reason |
-r |
Reason for the release |
--force |
-f |
Skip confirmation prompt |
Examples:
# Release with confirmation prompt
primestamp vault release vault-a1b2c3d4... -r "Project handover"
# Force release without prompt
primestamp vault release vault-a1b2c3d4... -r "Emergency" --force
vault burn¶
Permanently destroy a vault and its escrowed key. This action is irreversible.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault to burn (required) |
Options:
| Option | Short | Description |
|---|---|---|
--force |
-f |
Skip confirmation prompt |
Examples:
# Burn with confirmation prompt
primestamp vault burn vault-a1b2c3d4...
# Force burn without prompt
primestamp vault burn vault-a1b2c3d4... --force
vault history¶
Show the heartbeat and event history of a vault.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault to inspect (required) |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--limit |
-l |
20 |
Maximum number of events to show |
--json |
False |
Output raw JSON |
Examples:
vault deadline¶
Show or adjust the heartbeat deadline for a vault.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault (required) |
Options:
| Option | Short | Description |
|---|---|---|
--set |
-s |
New deadline duration (e.g. 48h, 7d) |
Examples:
# Show current deadline
primestamp vault deadline vault-a1b2c3d4...
# Update deadline (requires heartbeat fee)
primestamp vault deadline vault-a1b2c3d4... --set 7d
vault group¶
Manage heartbeat groups for batch vault maintenance.
vault group create¶
Options:
| Option | Short | Description |
|---|---|---|
--name |
-n |
Group name (required) |
--interval |
-i |
Heartbeat interval (e.g. 48h, 7d) |
Examples:
vault group list¶
vault group show¶
vault group heartbeat¶
Submit a heartbeat for all vaults in a group.
Options:
| Option | Short | Description |
|---|---|---|
--fee-receipt |
-r |
Transaction receipt for the mandatory fee |
Examples:
vault fees¶
Display the current vault fee schedule.
Output: A table showing the create fee, heartbeat fee, batch discount, and currency.
node start¶
Start a PrimeStamp vault node for monitoring and indexing.
Options:
| Option | Default | Description |
|---|---|---|
--host |
127.0.0.1 |
Host to bind to |
--port |
8801 |
Port to listen on |
--data-dir |
~/.primestamp/node |
Node data directory |
--daemon |
False |
Run as a background daemon |
Examples:
# Start in foreground
primestamp node start
# Start as daemon on custom port
primestamp node start --port 9000 --daemon
node stop¶
Stop a running PrimeStamp node daemon.
node status¶
Show the status of the local PrimeStamp node.
Output: Node uptime, number of watched vaults, indexed vaults, and connection status.
node watch¶
Subscribe the node to watch a specific vault for deadline warnings and events.
Arguments:
| Argument | Description |
|---|---|
VAULT_ID |
ID of the vault to watch (required) |
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--warn-hours |
-w |
24 |
Hours before deadline to trigger a warning |
Examples:
node unwatch¶
Stop watching a vault.
node index¶
Index all public vaults from the network into the local node database.
Options:
| Option | Short | Default | Description |
|---|---|---|---|
--full |
-f |
False |
Full re-index (otherwise incremental) |
Examples:
node stats¶
Display aggregate vault statistics from the local node.
Options:
| Option | Description |
|---|---|
--json |
Output raw JSON |
Examples:
Output: Active vaults, total heartbeats, total releases, total burns, and fee totals.