# div storage

> List, upload and download files on a volume.

## Synopsis

```text
div storage ls <volume> [directory] [flags]
div storage put <volume> <path> [destination] [flags]
div storage get <volume> <path> [destination] [flags]
```

Moves files between this machine and a volume. Runs see every volume at `/mnt/<volume>`.

## Subcommands

| Subcommand | Description |
| --- | --- |
| `ls` | List one directory on a volume. Does not recurse. |
| `put` | Upload a file or directory. Creates the volume if it does not exist. |
| `get` | Download a file or directory. |

## Arguments

| Argument | Description | Default |
| --- | --- | --- |
| `<volume>` | Volume name. | |
| `[directory]` | `ls`: directory on the volume. | the root |
| `<path>` | `put`: local file or directory. `get`: file or directory on the volume. | |
| `[destination]` | `put`: path on the volume. `get`: local path, or `-` for stdout. | `put`: the source's name. `get`: the source's name in the current directory |

## Flags

| Flag | Description | Default |
| --- | --- | --- |
| `--json` | `ls`: print the entries as JSON. | |
| `--token <key>` | API key to use. | see [Configuration](https://docs.divergentlabs.xyz/compute/cli/configuration.md) |
| `--api-url <url>` | API URL to use. | see [Configuration](https://docs.divergentlabs.xyz/compute/cli/configuration.md) |

## put

- A directory lands under its own name: `./data` becomes `data/…` on the volume. Pass a destination to place it elsewhere.
- Inside a git repository, `put` uploads the files `git ls-files` lists. Outside one, it skips the same files as [`div run`](https://docs.divergentlabs.xyz/compute/cli/run.md#uploaded-files).
- Uploading to an existing path replaces the file.
- If a file fails, `put` continues with the rest, prints the command to retry each failed file, and exits `1`. Errors that would affect every file, such as an invalid key, no credit or a full storage quota, stop the upload immediately.

| Limit | Value |
| --- | --- |
| Maximum file size | 256 MB |
| Maximum upload time per file | 5 minutes |

For larger files, download them from inside a run and write them to `/mnt/<volume>`. See [Keep data and checkpoints on a volume](https://docs.divergentlabs.xyz/compute/guides/volumes.md#large-files).

## get

- A file is saved under its own name, or at the destination. A directory is downloaded into a local directory of the same name.
- Downloads have no size limit. Files stream to disk, so memory use stays constant.
- A file is written to `<destination>.part` and renamed when complete. An incomplete download is an error, and the `.part` file is removed.
- `-` as the destination writes a single file to stdout. A directory cannot go to stdout.
- If a file fails, `get` continues with the rest, prints the command to retry each failed file, and exits `1`.

## Output

`ls` prints directories first, ending in `/`, then files with size and date. The path is the last column.

```text
$ div storage ls mask-data openpii
                    openpii/shards/
229 MB  2026-09-23  openpii/train.parquet
 21 MB  2026-09-23  openpii/validation.parquet
```

`put` and `get` print the file count and total size first, show progress on a terminal, and print a summary when done. All of it goes to stderr:

```text
212 files, 1.4 GB → contracts-v3
Uploaded 212 files (1.4 GB) to contracts-v3.
```

`get` also prints the local path of what it downloaded to stdout.

## Exit codes

| Code | Meaning |
| --- | --- |
| `0` | Every file was transferred. |
| `1` | One or more files failed, the volume or path does not exist, or the API rejected the request. |
| `2` | Invalid arguments. |

## Examples

```bash
div storage ls contracts-v3
div storage put contracts-v3 ./data
div storage put contracts-v3 ./data corpus
div storage put contracts-v3 ./data.csv raw/data.csv
div storage get training-volume-1 log/training.jsonl
div storage get training-volume-1 log/training.jsonl - | tail -5
div storage get rubric-runs sft-v0c/final checkpoints/sft-v0c
```

The dashboard's **Storage** page shows the same files.
