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

# sf env

> List agent RL environments

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env ls
sf env show alice/calculator-tasks@1.0.0
sf env push ./my-env --name calculator-tasks --version 1.0.0
```

Agent RL 环境：agent 用来练习的任务集。`sf env ls` 列出你能引用的——公开的加上你自己的。

`sf env show` 打印某个环境的 manifest：协议、verifier、工具，以及是否需要沙箱。
它**不**打印任务，任何命令都不打印。一份 taskset 编码了一家企业认为什么算难，
所以作业只能引用环境，永远拿不到副本。

要自己写一个，见 [Agent 环境](/zh-Hans/extend/environments)。

## 注册一个已经在跑的服务

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env runner register http://envbox-3.corp:8080 \
  --name shared-sim --version 1.0.0 \
  --rubric alice/task-completion
```

验证一个正在运行的 OpenEnv 服务并把它注册成环境，不需要管理员介入。
平台既不启动它也不代理它——它只决定作业能不能够到那台主机，然后把 URL 交给 trainer。

## `sf env`

List agent RL environments

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env <subcommand>
```

| 命令              | 说明                                                                 |
| --------------- | ------------------------------------------------------------------ |
| `sf env ls`     | List the visible environments                                      |
| `sf env push`   | Push a new version of an environment                               |
| `sf env runner` | Register an environment that already runs on a machine of your own |
| `sf env show`   | What an environment declares                                       |

### `sf env ls`

List the visible environments

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env ls
```

除 `--help` 外没有其他选项。

### `sf env push`

Push a new version of an environment

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env push <DIRECTORY> [options]
```

| 参数          | 说明                                                                            |
| ----------- | ----------------------------------------------------------------------------- |
| `DIRECTORY` | Holds manifest.json and tasks.jsonl; everything under it is uploaded (**必填**) |

| 选项                | 说明                                                              |
| ----------------- | --------------------------------------------------------------- |
| `--name`, `-n`    | \<owner>/\<name>, or a bare name in your own namespace (**必填**) |
| `--version`, `-v` | **必填**                                                          |
| `--public`        | Only applies when the environment is first created              |

### `sf env runner`

Register an environment that already runs on a machine of your own

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env runner <subcommand>
```

| 命令                       | 说明                                                   |
| ------------------------ | ---------------------------------------------------- |
| `sf env runner register` | Register a running OpenEnv service as an environment |

#### `sf env runner register`

Register a running OpenEnv service as an environment

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env runner register [ENDPOINT] [options]
```

| 参数         | 说明                                                                                                 |
| ---------- | -------------------------------------------------------------------------------------------------- |
| `ENDPOINT` | Where the environment already answers, e.g. [http://envbox-3.corp:8080](http://envbox-3.corp:8080) |

| 选项                | 说明                                                                                                      |
| ----------------- | ------------------------------------------------------------------------------------------------------- |
| `--fleet`         | Register it on a fleet instead of a fixed address; the platform picks a machine from it when a job runs |
| `--name`, `-n`    | \<owner>/\<name>, or a bare name in your own namespace (**必填**)                                         |
| `--version`, `-v` | **必填**                                                                                                  |
| `--rubric`        | Score with a platform Rubric instead of the environment's own reward                                    |
| `--description`   | What this environment is for                                                                            |
| `--public`        | Only applies when the environment is first created                                                      |

### `sf env show`

What an environment declares

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf env show <REFERENCE>
```

| 参数          | 说明     |
| ----------- | ------ |
| `REFERENCE` | **必填** |

除 `--help` 外没有其他选项。
