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

# 管理项目环境

在 self-host 沙箱项目目录运行 env 或其别名 environment。通过 sandbox init -t self-host 生成 .agentkit/sandbox.yaml 并填写该项目的环境及镜像配置，env create 根据配置申请托管 EnvironmentResource。CLI 将资源 ID 写入 .agentkit/environment.yaml。已有旧版 Tool/Runtime 状态的项目可以用 --resource-id 指定已托管资源。

> [!WARNING]
>
> 创建环境会配置云资源，可能使用或创建 IAM 角色并产生费用。删除前核对项目和资源 ID。

下面的 patch.yaml 示例只调整运行时容量。将资源 ID 和修订替换为当前环境返回的值。

```yaml theme={null}
runtime:
  resources:
    cpu_milli: 2000
    memory_mb: 4096
```

## env create

| 选项 | 说明 | 默认值 |
| - | - | - |
| `--force-new` | 在已有本地状态时创建另一个资源 | 未启用 |
| `--client-token <token>` | 幂等标识，重试同一次请求时复用原值 | — |
| `--no-wait` | 服务受理后返回 | — |
| `--timeout <seconds>` | 请求或等待超时秒数 | 900 |
| `-r, --region <region>` | API 调用地域 | — |
| `--json` | 输出 JSON | 未启用 |

```bash theme={null}
agentkit env create --json
```

## env status

| 选项 | 说明 | 默认值 |
| - | - | - |
| `--resource-id <id>` | 指定资源 ID，覆盖项目记录 | — |
| `-r, --region <region>` | API 调用地域 | — |
| `--json` | 输出 JSON | 未启用 |

```bash theme={null}
agentkit env status --json
```

## env list

| 选项 | 说明 | 默认值 |
| - | - | - |
| `--environment-id <id>` | 环境 ID | — |
| `--status <status>` | 按资源状态筛选 | — |
| `--include-deleted` | 包含已删除资源的记录 | 未启用 |
| `--limit <number>` | 每页条数 | 20 |
| `--page <token>` | 下一页游标 | — |
| `--all` | 读取全部分页 | 未启用 |
| `-r, --region <region>` | API 调用地域 | — |
| `--json` | 输出 JSON | 未启用 |

```bash theme={null}
agentkit env list --all --json
```

## env update

| 选项 | 说明 | 默认值 |
| - | - | - |
| `--file <path>` | JSON 或 YAML 更新补丁 | — |
| `--resource-id <id>` | 指定资源 ID，覆盖项目记录 | — |
| `--client-token <token>` | 幂等标识，重试同一次请求时复用原值 | — |
| `--environment-key-env <name>` | 保存方舟 Environment Key 的环境变量名 | — |
| `--wait` | 等待资源操作完成 | 未启用 |
| `--timeout <seconds>` | 请求或等待超时秒数 | 900 |
| `-r, --region <region>` | API 调用地域 | — |
| `--json` | 输出 JSON | 未启用 |

```bash theme={null}
agentkit env update --file patch.yaml --wait
```

## env delete

| 选项 | 说明 | 默认值 |
| - | - | - |
| `--resource-id <id>` | 指定资源 ID，覆盖项目记录 | — |
| `--client-token <token>` | 幂等标识，重试同一次请求时复用原值 | — |
| `-y, --yes` | 跳过交互确认 | 未启用 |
| `--wait` | 等待资源操作完成 | 未启用 |
| `--timeout <seconds>` | 请求或等待超时秒数 | 900 |
| `-r, --region <region>` | API 调用地域 | — |
| `--json` | 输出 JSON | 未启用 |

```bash theme={null}
agentkit env delete --wait
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.