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

# CLI commands

> Upload files, download asset content, and read or update metadata with the Dataerai command-line client.

These commands require you to be [signed in](/cli/authenticate).

## Download

Download all files from an asset's latest content into a local directory. Partial downloads resume automatically.

```bash theme={null}
dataerai download --asset <ASSET_UUID> --output ./my-data
```

| Flag       | Description                                                 |
| ---------- | ----------------------------------------------------------- |
| `--asset`  | Asset UUID to download (required).                          |
| `--output` | Directory to write files into (default: current directory). |
| `--server` | Override the server (defaults to the one stored at login).  |

## Upload

Create or update an asset from a local file and a JSON metadata file.

```bash theme={null}
dataerai upload \
  --collection <COLLECTION_UUID> \
  --metadata meta.json \
  --file dataset.csv
```

| Flag              | Description                                                                             |
| ----------------- | --------------------------------------------------------------------------------------- |
| `--collection`    | Collection UUID to place the asset in (required).                                       |
| `--metadata`      | Path to a JSON metadata file (required).                                                |
| `--file`          | Local file to upload (omit for a metadata-only placeholder).                            |
| `--project`       | Project UUID (required if the metadata file doesn't supply `owner_id`).                 |
| `--allocation-id` | Allocation UUID to store the content in (defaults to the project's default allocation). |
| `--server`        | Override the server (defaults to the one stored at login).                              |

The metadata JSON file accepts:

```json theme={null}
{
  "title":       "My dataset",
  "description": "optional",
  "alias":       "my-dataset",
  "tags":        ["ml", "csv"],
  "metadata":    { "version": 1 },
  "owner_type":  "project",
  "owner_id":    "<project-uuid>"
}
```

## Metadata

Read an asset's metadata as JSON:

```bash theme={null}
dataerai metadata get --asset <ASSET_UUID>
```

Update fields from a JSON patch file — only the fields you include change; the accepted fields are `title`, `description`, `alias`, `tags`, and `metadata`:

```bash theme={null}
dataerai metadata set --asset <ASSET_UUID> patch.json
```

```json theme={null}
{
  "title": "Renamed dataset",
  "metadata": { "env": "prod" }
}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Python SDK" icon="circle" href="/sdks/python">
    Drive the same operations from Python.
  </Card>

  <Card title="Node SDK" icon="hexagon" href="/sdks/nodejs">
    Drive the same operations from Node.js.
  </Card>
</CardGroup>
