> ## 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.

> ## Agent Instructions
> Treat this site as the source of truth for public Osmosis behavior.
> Distinguish the web Platform, the open source Python SDK, and the CLI.
> Use documented commands, configuration fields, and public APIs exactly as written; do not infer internal endpoints or services.

# Osmosis CLI Benchmarks

> 发现 benchmarks，并提交、查看和下载 benchmark runs

使用 benchmark commands 在公开 task set 上比较 agents。Benchmark config 用于选择 tasks、agent harnesses、models 和 execution settings；它不引用 workspace rollout code。

<Note>
  Benchmarks 处于 beta 阶段，按账号开通；未开通时 CLI 会返回 `Benchmarks is not available for your account`。此外，benchmark 必须已经存在于 workspace 中。Osmosis-managed benchmarks 会自动添加；Harbor registry benchmark 需要先从 Platform 添加，然后才能用于 CLI config。
</Note>

## 快速开始

在 workspace repository 内运行：

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis benchmark list
osmosis benchmark info terminal-bench-2-1
osmosis secret set OPENAI_API_KEY
osmosis benchmark submit configs/benchmark/terminal-bench-smoke.toml
```

然后查看该 run：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis benchmark runs list
osmosis benchmark runs info <run-name>
osmosis benchmark runs logs <run-name>
```

## Benchmark 配置

请从一个 task、一个 agent 和一次 attempt 开始。Task sets、categories、多个 agents、custom endpoints、hosted models、judges、verifiers 和 execution controls 请参见 [Config Files](/zh/cli/config-files#benchmark-config)。

```toml configs/benchmark/terminal-bench-smoke.toml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
[experiment]
benchmark = "terminal-bench-2-1"

[tasks]
task_names = ["terminal-bench/git-multibranch"]

[[agents]]
harness = "codex"

[agents.model]
type = "provider"
model = "openai/gpt-5.2"
api_key_secret = "OPENAI_API_KEY"

[execution]
attempts_per_task = 1
max_concurrent_attempts = 1
timeout_multiplier = 1.0
max_retries = 0
```

`api_key_secret` 是 Platform secret record 名称，而不是 credential value。提交前请注册 config 引用的所有 model、harness、judge 和 verifier secrets。

<Warning>
  Benchmark run 会产生 sandbox 和 model 费用，model 花费使用您的 provider keys。扩大 task selection 或 concurrency 前，请先运行一个 task 和一次 attempt。
</Warning>

## 工作方式

<Steps>
  <Step title="查看 benchmark">
    `benchmark list` 显示 workspace 可以运行的 benchmarks。`benchmark info` 会报告准确 key、task manifest、categories、命名 task sets、支持的 harnesses、judge 要求、pass threshold、leaderboard 和已有 runs。
  </Step>

  <Step title="选择 tasks 和 agents">
    省略 `[tasks]` 会运行完整 benchmark；也可以选择明确的 task names、categories 或公开 task set。每个要比较的 agent 添加一个 `[[agents]]` 条目。
  </Step>

  <Step title="预览并提交">
    `benchmark submit` 会校验 benchmark、task selection、harnesses、models、execution controls 和 secret references，然后在确认前预览解析后的 run。
  </Step>

  <Step title="执行并评分">
    Osmosis 会在 benchmark-managed environments 中，让每个 agent 使用相同的 task selection 和 attempt budget。Run 会记录 outcomes、pass\@k metrics、cost、duration、tokens，以及可用的 logs 和 artifacts。
  </Step>
</Steps>

## 命令

| 命令                                           | 描述                                                 |
| -------------------------------------------- | -------------------------------------------------- |
| `osmosis benchmark list`                     | 列出 workspace 中可用的 benchmarks。                      |
| `osmosis benchmark info <key-name-or-id>`    | 显示 requirements、tasks、leaderboard 和 runs。          |
| `osmosis benchmark submit <config>.toml`     | 提交 `configs/benchmark/` 下的 config。                 |
| `osmosis benchmark runs list`                | 列出 benchmark runs。                                 |
| `osmosis benchmark runs info <run-name>`     | 显示 configuration、progress、agent results 和 metrics。 |
| `osmosis benchmark runs logs <run-name>`     | 显示 lifecycle logs。                                 |
| `osmosis benchmark runs stop <run-name>`     | 停止 pending、queued 或 running run。                   |
| `osmosis benchmark runs download <run-name>` | 下载 summaries、task results、artifacts 或 logs。        |

完整 flag 列表请参见 [命令参考](/zh/cli/command-reference#benchmark)。

## 下载 Run 输出

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis benchmark runs download my-benchmark-run
osmosis benchmark runs download my-benchmark-run --type all -o ./benchmark-outputs/
```

默认下载包含 summary 和 task-result CSV 文件。可选 selector 可以加入 artifacts 和 logs。下载使用固定 run directory；除非设置 `--overwrite`，否则会跳过完整的本地文件，并且可以通过再次运行同一命令继续下载。

## 下一步

<CardGroup cols={2}>
  <Card title="配置文件" icon="file-lines" href="/zh/cli/config-files#benchmark-config">
    配置 tasks、agents、models、judges 和 execution。
  </Card>

  <Card title="Platform Benchmarks" icon="trophy" href="/zh/platform/benchmarks">
    添加 benchmarks、查看 leaderboards 并了解 result eligibility。
  </Card>

  <Card title="命令参考" icon="rectangle-list" href="/zh/cli/command-reference#benchmark">
    查看所有 benchmark commands 和 options。
  </Card>
</CardGroup>
