Skip to content
sproutboat
Esc
navigateopen⌘Jpreview
On this page

Manage and export KV data

List, inspect, and bulk-edit KV entries from the CLI, plus a restorable export format.

KV commands address a namespace by its account-level name.

Individual keys

bunx sproutboat kv key list registrations --prefix email:
bunx sproutboat kv key get registrations email:[email protected] --text
bunx sproutboat kv key put registrations email:[email protected] joined
bunx sproutboat kv key delete registrations email:[email protected] --yes
npx sproutboat kv key list registrations --prefix email:
npx sproutboat kv key get registrations email:[email protected] --text
npx sproutboat kv key put registrations email:[email protected] joined
npx sproutboat kv key delete registrations email:[email protected] --yes

Export

bunx sproutboat kv export registrations \
  --prefix email: \
  --output registrations.json
npx sproutboat kv export registrations \
  --prefix email: \
  --output registrations.json

The export pages through matching keys, reads values in bounded batches, and writes incrementally to a permission-restricted temporary file.

Exports use the version 1 text-value format accepted by kv bulk put:

[
  { "key": "email:[email protected]", "value": "joined" }
]

Bulk operations

Bulk get and delete take a JSON array of key strings:

["email:[email protected]", "email:[email protected]"]
bunx sproutboat kv bulk get registrations keys.json --output values.json
bunx sproutboat kv bulk put registrations registrations.json
bunx sproutboat kv bulk delete registrations keys.json --yes
npx sproutboat kv bulk get registrations keys.json --output values.json
npx sproutboat kv bulk put registrations registrations.json
npx sproutboat kv bulk delete registrations keys.json --yes

Was this page helpful?