CLICommands

kv

snug kv <COMMAND>

Key-value store operations.

Subcommands

CommandWhat it does
setSet a key-value pair
getGet a key's value
set-binaryStore a raw binary value from a file
get-binaryRetrieve a raw binary value to a file or stdout
deleteDelete a key
headCheck if a key exists (returns metadata in headers)
listList keys with filtering
searchSearch indexed values
statsGet key store statistics
batch-getBatch get multiple keys
batch-setBatch set multiple keys (from JSON file)
batch-deleteBatch delete multiple keys
ttlManage key TTL
incrAtomically increment a numeric value
patchApply 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 0

Next

  • 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.

On this page