> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinycloud.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Key-Value Storage

> Store and retrieve data in TinyCloud spaces

Use `tc kv` when you want the shortest path from a shell prompt to a stored value.

## Basic workflow

```bash theme={null}
tc kv put greeting "Hello, TinyCloud"
tc kv get greeting
tc kv list
tc kv delete greeting
```

## Input and output

`tc kv put` accepts one of three inputs:

| Input    | Example                                 |                             |
| -------- | --------------------------------------- | --------------------------- |
| Argument | `tc kv put greeting "Hello"`            |                             |
| File     | `tc kv put config --file ./config.json` |                             |
| Stdin    | \`cat payload.json                      | tc kv put payload --stdin\` |

`tc kv get` can print plain text, raw bytes, or JSON:

```bash theme={null}
tc kv get greeting
tc kv get greeting --raw
tc kv get greeting --output ./greeting.txt
```

## Target a different space

```bash theme={null}
tc kv get greeting --space applications
tc kv put config/app --space applications --file ./config.json
```

`--space` accepts either a short owned-space name or a full `tinycloud:pkh:eip155:...` URI.

## What the command family does

* `put`, `get`, `list`, `delete`
* `head` for metadata without fetching the body
* `--prefix` for listing a subset of keys
* `--json` for scripting-friendly output

## Good defaults

* Quote SQL and JSON-like shell values so the shell passes them as a single argument
* Use `--raw` when you need the exact stored value in a pipe
* Use `--output` when you want to save binary data to a file

<Note>
  The CLI source routes KV operations through the active profile and uses the node's primary space unless you pass `--space`.
</Note>
