---
title: Manage and export KV data
description: "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

<CodeGroup>

```sh Bun
bunx sproutboat kv key list registrations --prefix email:
bunx sproutboat kv key get registrations email:person@example.com --text
bunx sproutboat kv key put registrations email:person@example.com joined
bunx sproutboat kv key delete registrations email:person@example.com --yes
```

```sh npm
npx sproutboat kv key list registrations --prefix email:
npx sproutboat kv key get registrations email:person@example.com --text
npx sproutboat kv key put registrations email:person@example.com joined
npx sproutboat kv key delete registrations email:person@example.com --yes
```

</CodeGroup>

## Export

<CodeGroup>

```sh Bun
bunx sproutboat kv export registrations \
  --prefix email: \
  --output registrations.json
```

```sh npm
npx sproutboat kv export registrations \
  --prefix email: \
  --output registrations.json
```

</CodeGroup>

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

:::note
The destination file appears only after the export succeeds. It will not replace an existing file unless you pass `--force`.
:::

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

```json
[
  { "key": "email:person@example.com", "value": "joined" }
]
```

## Bulk operations

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

```json
["email:first@example.com", "email:second@example.com"]
```

<CodeGroup>

```sh Bun
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
```

```sh npm
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
```

</CodeGroup>

:::warning
The CLI splits large bulk files into bounded requests. Single and bulk deletion require `--yes`. Output files require `--force` before replacement.
:::
