CLICommands
kv
snug kv <COMMAND>Key-value store operations.
Subcommands
| Command | What it does |
|---|---|
set | Set a key-value pair |
get | Get a key's value |
set-binary | Store a raw binary value from a file |
get-binary | Retrieve a raw binary value to a file or stdout |
delete | Delete a key |
head | Check if a key exists (returns metadata in headers) |
list | List keys with filtering |
search | Search indexed values |
stats | Get key store statistics |
batch-get | Batch get multiple keys |
batch-set | Batch set multiple keys (from JSON file) |
batch-delete | Batch delete multiple keys |
ttl | Manage key TTL |
incr | Atomically increment a numeric value |
patch | Apply JSON merge patch to a key |
Run snug kv <command> --help for that command's own options.
The global options apply everywhere.
Examples
snug kv set config/db/host '"localhost"' --ttl 3600
snug kv set user/prefs '{"theme": "dark"}' --tags ui,user --private
snug kv get config/db/host
snug kv get user/prefs --include-metadata
snug kv delete config/db/host --force
snug kv head config/db/host
snug kv list --prefix config/
snug kv list --tags ui --owner me
snug kv search "dark theme" --prefix user/
snug kv stats --prefix config/
snug kv batch-get config/a,config/b,config/c
snug kv batch-set --file items.json
snug kv batch-delete config/old/a,config/old/b --force
snug kv ttl config/cache/token --set 7200
snug kv ttl config/cache/token --remove
snug kv incr stats/page-views
snug kv incr stats/errors --delta -1
snug kv patch user/settings '{"notifications": true}'
snug kv set-binary images/logo.png --file ./logo.png --ttl 86400
snug kv get-binary images/logo.png --out ./logo-copy.png
snug kv list --prefix config/ --depth 0Next
- kv guide - what the service does and when to reach for it.
- API reference - every endpoint these commands call.
- CLI reference - global options, output modes, and exit codes.