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

# 结构与配置

> 了解 workspace repository 布局和配置文件

workspace directory 是连接到平台 workspace 的 GitHub workspace repository 的本地 clone。平台会从 Osmosis workspace template 创建新的 workspace repositories。

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
repository/
├── rollouts/                            # AgentWorkflow + Grader code
├── configs/
│   ├── eval/                            # Evaluation configs
│   ├── AGENTS.md                        # AI assistant instructions for configs
│   └── training/
│       └── default.toml                 # Training config template
├── data/                                # Local test datasets
├── pyproject.toml                       # Python project config
├── README.md                            # Project readme
├── AGENTS.md                            # AI coding assistant instructions
├── CLAUDE.md                            # Claude Code instructions
└── .gitignore                           # Git ignore rules
```

***

## 必需目录

CLI 期望以下目录存在：

| Path                | Purpose                                           |
| ------------------- | ------------------------------------------------- |
| `rollouts/`         | rollout 代码，每个 rollout 一个子目录                       |
| `configs/training/` | 用于 `osmosis train submit` 的训练任务 TOML 文件           |
| `configs/eval/`     | 用于 `osmosis eval submit` 的 evaluation run TOML 文件 |
| `data/`             | 用于 `osmosis dataset upload` 的本地数据集                |

在 workspace directory 中任意位置运行健康检查：

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis doctor
```

修复缺失的 scaffold 目录，且不覆盖已有文件：

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis doctor --fix
```

## `rollouts/`

存放 AgentWorkflow 和 Grader 代码的目录。每个 rollout 都是一个子目录，包含一个 entrypoint 文件（通常是 `main.py`），用于定义 agent workflow 和 grading 逻辑。

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
rollouts/
└── my-rollout/
    ├── main.py          # Entrypoint: defines AgentWorkflow + Grader
    ├── pyproject.toml   # Rollout package dependencies
    └── README.md        # Rollout notes
```

创建新的 rollout scaffold：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis rollout init <name>
```

或应用 starter template：

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis template list
osmosis template apply multiply-local-strands
```

## `configs/`

两类 CLI 操作的配置文件：training 和 evaluation。

| Subdirectory        | Purpose                                           | Reference                                               |
| ------------------- | ------------------------------------------------- | ------------------------------------------------------- |
| `configs/training/` | 用于 `osmosis train submit` 的训练任务 configs           | [Training Config](/zh/cli/config-files#training-config) |
| `configs/eval/`     | 用于 `osmosis eval submit` 的 evaluation run configs | [Evaluation Config](/zh/cli/config-files#eval-config)   |

`configs/training/default.toml` template 和命名为 `configs/eval/<rollout-name>.toml` 的 rollout-specific evaluation configs 已预填必需字段，并以注释形式包含可选设置。完整 TOML schema 参考请参见 [Configuration Files](/zh/cli/config-files)。

## `data/`

存放本地数据集文件的目录。通过 `osmosis dataset upload` 将它们上传到平台，然后在 [training](/zh/cli/config-files#training-config) 和 [evaluation](/zh/cli/config-files#eval-config) configs 中通过名称引用已上传的数据集。

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis dataset upload data/<dataset-file>.jsonl
```

## `pyproject.toml`

workspace repository 的标准 Python 项目配置。单个 rollout 也可以拥有自己的 `rollouts/<name>/pyproject.toml` 文件，用于 rollout-specific dependencies。

```toml pyproject.toml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
[project]
name = "osmosis-workspace"
description = "Osmosis workspace repository"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
    "osmosis-ai>=0.2.21",
]
```

## `AGENTS.md` 与 `CLAUDE.md`

面向 AI 编码助手的指令文件。`AGENTS.md` 为任意 AI assistant（GitHub Copilot、Cursor 等）提供通用指导，而 `CLAUDE.md` 包含 Claude Code-specific instructions。

这两个文件描述 workspace 结构、约定和 Osmosis-specific patterns，让您的 AI assistant 可以更有效地帮助您编写 rollout 代码。

## Generated Runtime State

CLI 可能会在 `.osmosis/` 下创建本地 runtime 文件，例如 exported metrics。请将它们视为本地状态，而不是源代码。

## 下一步

<CardGroup cols={2}>
  <Card title="Workspace Repository" icon="code-branch" href="/zh/cli/workspace/repository">
    了解 CLI 如何解析已连接 workspace。
  </Card>

  <Card title="Configuration Files" icon="file-lines" href="/zh/cli/config-files">
    查看 training 和 evaluation TOML schemas。
  </Card>
</CardGroup>
