Skip to content

CLI Reference

hmdb is the HyperMesh DB command-line interface.

hmdb [--db DIR] <subcommand> [options]
FlagDefaultDescription
--db$HMDB_DIR or ./hypermeshdbDatabase directory

Start the REST API server.

Terminal window
hmdb serve [options]
FlagDefaultDescription
--host0.0.0.0Bind address
--port8000TCP port
--workers1Uvicorn worker count
--log-levelinfoLogging level
--audit-logJSON audit log file path
--tls-certTLS certificate path
--tls-keyTLS private key path
--no-authDisable authentication (dev only)

Examples:

Terminal window
# Development (no auth)
hmdb serve --db /tmp/mydb --no-auth
# Production with TLS
hmdb serve --db /data --tls-cert /certs/server.crt --tls-key /certs/server.key \
--log-level info --audit-log /var/log/hmdb-audit.jsonl

Create a new API key.

Terminal window
hmdb add-key --role readwrite --description "ci-pipeline"
FlagDefaultDescription
--rolereadonlyreadonly / readwrite / admin
--description""Human-readable label

List all API keys.

Terminal window
hmdb list-keys

Revoke an API key by its ID.

Terminal window
hmdb revoke-key key_a3f9c2b1

Compact the WAL.

Terminal window
hmdb compact [--ttl SECONDS] [--table TABLE]
FlagDescription
--ttlDiscard records older than this many seconds
--tableCompact only the named table

Configure auto-compact threshold.

Terminal window
hmdb autocompact --threshold 1000 [--table TABLE]

Create a backup archive.

Terminal window
hmdb backup --out /backups [--no-compact]
FlagDefaultDescription
--out./backupsOutput directory
--no-compactSkip pre-backup compaction

Restore from a backup archive.

Terminal window
hmdb restore /backups/hypermeshdb_20260409_120000.tar.gz --target /data/restored

Migrate an older flat-file database to the per-table directory layout.

Terminal window
hmdb migrate --from /old_db --to /new_db

Compute a hypergraph analytics measure and print the result.

Terminal window
hmdb analytics --table CoProximity --measure pagerank
hmdb analytics --table CoProximity --measure spectral_gap

Open an interactive Cypher REPL.

Terminal window
hmdb shell --db /tmp/mydb
hypermeshdb> CREATE HYPEREDGE TABLE Events (Node)
hypermeshdb> INSERT INTO Events (event_ts, members) VALUES (1000, [1,2,3])
hypermeshdb> MATCH HYPEREDGE (he:Events) WHERE he.event_ts >= 1000 RETURN *