Skip to Content
KryptWarden Developers
Agent SDK

CLI

Create agent keys and inspect live policy from the terminal.

The SDK ships a small CLI called kryptwarden. Run it with npx without installing, or as npx kryptwarden inside a project that depends on the SDK.

keygen

npx @kryptwarden/sdk keygen [--out .env.agent]

Creates a random ed25519 keypair and writes it to the file (default .env.agent) with mode 0600:

.env.agent
# Generated locally by @kryptwarden/sdk CLI — NEVER share or commit KW_AGENT_SECRET_KEY
KW_AGENT_PUBLIC_KEY=G...
KW_AGENT_PUBLIC_KEY_HEX=3a04cb5d...
KW_AGENT_SECRET_KEY=S...

It prints the public key to paste into the dashboard.

keygen overwrites the output file. Use a new --out path if you already have one.

inspect

npx @kryptwarden/sdk inspect --wallet <C...> --agent <G...>

Reads the agent's live summary from the contract and prints it as JSON: status, whether the key has expired, policy version, daily budget, auto-approve limit, spent today, reserved by holds, remaining budget and allowed sellers. It's read-only and needs no keys.

If you leave out the flags, it falls back to the KW_WALLET_ADDRESS and KW_AGENT_PUBLIC_KEY environment variables. It uses Testnet unless STELLAR_NETWORK says otherwise.

npx @kryptwarden/sdk inspect \
  --wallet CBRSOOZPMVB3SX6LPRG6ESCRBOPP6G4OZHVIQUNCVRQPNMCUE5BB4NVO \
  --agent GA5AJS25Q4JXCYFCRZOSC4JF2CBTWTPLLJHCIY2BQYC4O7RGTFQUP57J

On this page