# clawhdf5-cli The `clawhdf5` command: create, fill, search and inspect a [`clawhdf5-agent`](../clawhdf5-agent/README.md) memory store from the shell. Output is JSON. (For general HDF5 files use `h5rs` from [`clawhdf5-tools`](../clawhdf5-tools/README.md).) ```bash cargo install --path crates/clawhdf5-cli # installs `clawhdf5`; not on crates.io yet # or: cargo run -p clawhdf5-cli -- --help ``` No C is compiled. ## Commands The store is `--path FILE` (or `CLAWHDF5_PATH`) before the subcommand. | Command | What | |---|---| | `create [--agent-id ID] [--dim N] [--wal] [--f32] [--f32-index]` | a new store (dimension 384 by default); float16 embeddings and an int8 index copy unless `--f32` / `--f32-index`. The WAL is off unless `--wal` (the library's default is on), so each save is checkpointed at once | | `save [--json '{...}']` | save one entry, from `--json` or stdin: `{"chunk", "embedding", "source_channel", "timestamp", "session_id", "tags"}` | | `search --embedding '[...]' [--query TEXT] [-k N] [--vector-weight W] [--keyword-weight W]` | hybrid search (defaults 5 results, weights 0.7 / 0.3) | | `recall INDEX` | one entry by index | | `stats` | counts and configuration | | `flush-wal` | checkpoint the WAL into the `.h5` | | `agents-md [--output FILE]` | generate an `AGENTS.md` from the store | | `export` | every entry as JSON lines | | `snapshot DEST` | a copy of the store's `.h5` file | | `keygen --out FILE` | a new Ed25519 signing key (64 hex characters, created owner-only on Unix) | | `verify --public-key HEX_OR_FILE` | check a signed store; exit status 2 if it does not verify | `recall`, `stats`, `agents-md` and `export` open the store read-only (no lock, nothing written), so they work while another process has it open. `save`, `search` (which records activation boosts) and `flush-wal` open it for writing and take the store's lock. With `--signing-key FILE` (or `CLAWHDF5_SIGNING_KEY`) every checkpoint a command makes is signed; a signed store refuses to checkpoint without the key. ```bash clawhdf5 --path mem.h5 create --agent-id demo --dim 3 echo '{"chunk":"hello","embedding":[0.1,0.2,0.3],"source_channel":"cli","timestamp":0,"session_id":"s1","tags":""}' \ | clawhdf5 --path mem.h5 save clawhdf5 --path mem.h5 search --embedding '[0.1,0.2,0.3]' --query hello -k 3 ``` ## License MIT