---
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 name. Keys can be up to 512 bytes and values up to 1 MiB.

## Individual keys

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

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

```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 yarn
yarn sproutboat kv key list registrations --prefix email:
yarn sproutboat kv key get registrations email:person@example.com --text
yarn sproutboat kv key put registrations email:person@example.com joined
yarn sproutboat kv key delete registrations email:person@example.com --yes
```

## Export

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

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

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

```sh yarn
yarn 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.

:::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"]
```

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

```sh pnpm
pnpm sproutboat kv bulk get registrations keys.json --output values.json
pnpm sproutboat kv bulk put registrations registrations.json
pnpm sproutboat kv bulk delete registrations keys.json --yes
```

```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 yarn
yarn sproutboat kv bulk get registrations keys.json --output values.json
yarn sproutboat kv bulk put registrations registrations.json
yarn sproutboat kv bulk delete registrations keys.json --yes
```

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