> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/ja/clis/cli-assets-and-folders.md).

# CLI: Asset とフォルダー

Unitlab CLI でライブラリへファイルをアップロードし、カスタムメタデータの設定、フォルダーの管理、クラウドフォルダーの同期、Data Group の作成をターミナルから行う方法を説明します。

## ライブラリへのアップロード <a href="#upload-to-the-library" id="upload-to-the-library"></a>

```bash
unitlab assets upload ./cell-04 --folder "Robot cell 04" --tag site-berlin --tag 2026-11 \
  --custom-metadata '{"robot": "UR10e", "shift": "night"}' --json
```

| オプション                                            | 用途                            |
| ------------------------------------------------ | ----------------------------- |
| `--folder` または `--folder-id`                     | 送信先フォルダーを名前（作成または再利用）か ID で指定 |
| `--path`                                         | 送信先フォルダー内のサブフォルダーのパス          |
| `--tag`                                          | 複数のタグは繰り返して指定                 |
| `--custom-metadata` または `--custom-metadata-file` | すべてのファイルに付与する JSON オブジェクト     |
| `--type`                                         | `pointcloud` などの種類を強制指定       |
| `--dry-run`, `--split-sensor-folders`            | LiDAR シーン用                    |

## 処理とメタデータ <a href="#processing-and-metadata" id="processing-and-metadata"></a>

```bash
unitlab assets status "$ASSET_ID"
unitlab assets retry "$ASSET_ID"
unitlab assets set-metadata "$ASSET_ID" --custom-metadata '{"lighting": "low"}'
unitlab assets set-metadata "$ASSET_ID" --custom-metadata null
```

`set-metadata` はオブジェクト全体を置き換えます。`null` を指定するとクリアされます。

## フォルダー <a href="#folders" id="folders"></a>

```bash
FOLDER_ID=$(unitlab folders create "Robot cell 04" --json | jq -r .id)
unitlab folders create cam_front --parent "$FOLDER_ID"
unitlab folders list --parent "$FOLDER_ID"
unitlab folders items "$FOLDER_ID" --json
unitlab folders detail "$FOLDER_ID"
```

クラウドフォルダーはバケットのプレフィックスをミラーリングします。

```bash
INCOMING=$(unitlab folders create Incoming --cloud-storage "$CLOUD_STORAGE_ID" --prefix fleet/incoming/ --json | jq -r .id)
unitlab folders sync-cloud "$INCOMING"
```

## Data Group <a href="#data-groups" id="data-groups"></a>

```bash
unitlab assets group "$FOLDER_ID" --preview                    # show the suggested pattern
unitlab assets group "$FOLDER_ID"                              # group with the suggestion
unitlab assets group "$FOLDER_ID" --template "{cell}_{frame}_{view}" \
  --tile-values "view=front,left,right,wrist" --preview      # estimate a pattern
unitlab assets group "$FOLDER_ID" --config grouping.json       # a saved configuration
```

`--tile-values` は `field=value1,value2` の形式で指定し、複数のフィールドは繰り返して指定します。設定キーについては [Data Group の自動化](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/data-group-automation.md) を参照してください。

## 関連情報 <a href="#related" id="related"></a>

[Asset とカスタムメタデータ](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/assets-and-custom-metadata.md) · [フォルダー](https://docs.unitlab.ai/api-sdk-cli/ja/sdks/folders.md)
