# サンプル

> AI SDK のコンテンツ操作、Office ファイルの入出力、視覚的検査、Worktree を順番に学びます。

- Human documentation: [https://docs.univer.ai/ja-JP/ai/examples](https://docs.univer.ai/ja-JP/ai/examples)

- Agent Markdown: [https://docs.univer.ai/ja-JP/ai/examples.md](https://docs.univer.ai/ja-JP/ai/examples.md)

- Requested language: `ja-JP`

- Content language: `ja-JP`

- Documentation version: `1.1.0`

- Source: [examples.ja-JP.mdx](https://github.com/dream-num/documentation/blob/dev/content/ai/examples.ja-JP.mdx)

---

[`univer-cli-examples`](https://github.com/dream-num/univer-cli-examples) には、独立して実行できる 4 つの学習用アプリケーションがあります。各ディレクトリに専用の `package.json` とロックファイルがあり、前のサンプルの機能を保ちながら 1 つのテーマを追加しています。

## 学習順序

| サンプル                    | 学ぶ内容                            | 追加される機能                              |
| ----------------------- | ------------------------------- | ------------------------------------ |
| `01-content-operations` | Sheet、Doc、Slide ユニットの読み取り、編集、表示 | CLI、Server、Web、Collaboration Runtime |
| `02-file-exchange`      | Office ファイルのインポートとエクスポート        | Exchange、UnitData、ネイティブバインディング       |
| `03-visual-inspection`  | 実際に描画されたユニットの確認                 | レンダリングページ、スクリーンショット、レイアウト検査          |
| `04-worktree`           | AI Agent の変更を分離し、人によるレビューに渡す    | Worktree、Ready、Merge、Reopen          |

## サンプルの実行

どのサンプルのディレクトリでも、同じ順序で起動します。

```bash
pnpm install
pnpm build
pnpm link-cli
pnpm start-server
```

サーバー起動後、別のターミナルで `univer-example-cli` を実行します。各 README にはコピーして使える完全な手順と AI Agent 用スキルプロンプトが含まれています。

これらは最小限の学習用構成で、完成した製品ではありません。コマンド、対象、ID と認可、出力、デプロイはアプリケーションが担当します。

> [!NOTE: ソース全体を見る]
> [univer-cli-examples](https://github.com/dream-num/univer-cli-examples) で番号付きのサンプルを確認し、実行してください。
