Skip to main content

Shared KV Store

The shared key-value store is available in relay mode. It provides cross-node coordination for distributed agent workflows.

kv set

Set a key-value pair on the relay’s shared store.
cw kv set [--ns <namespace>] [--ttl <duration>] <key> <value>
FlagDescription
--nsNamespace for key isolation
--ttlTime-to-live duration (e.g. 1h, 30m, 24h)
cw kv set --ns build build-status "passing"
cw kv set --ttl 1h cache:result "42"

kv get

Get a value by key.
cw kv get [--ns <namespace>] <key>

kv list

List keys by prefix.
cw kv list [--ns <namespace>] [prefix]
cw kv list --ns build          # all keys in build namespace
cw kv list cache:              # keys starting with "cache:"

kv delete

Delete a key.
cw kv delete [--ns <namespace>] <key>

Use Cases

PatternExample
Build coordinationWorkers write results, supervisor reads them
Feature flagsSet flags that agents check before proceeding
Distributed locksUse TTL keys as advisory locks
Shared stateAgents on different nodes share data through the relay KV