Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions docs/en/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Also available as the alias `ar rt`.
- [apply](#apply) — cloud-build when configured, then create-or-update from YAML.
- [cloud-build](#cloud-build) — build images from YAML without deploying.
- [render](#render) — dry-run validate + render to SDK input.
- [export](#export) — export one existing runtime as apply-ready YAML.
- [get](#get) — fetch one runtime by name.
- [list](#list) — list runtimes; filter by `--created-by-cli` or `--workspace`.
- [delete](#delete) — delete a runtime (waits by default).
Expand Down Expand Up @@ -157,6 +158,43 @@ before `apply`.

---

## export

```
ar runtime export NAME [-f FILE] [--include-secrets]
```

Export an existing Agent Runtime and its endpoints as `ar runtime apply` YAML.
The command writes YAML to stdout by default, or to `--file` when provided. It
exports only fields supported by the CLI YAML schema and intentionally omits
server-owned state such as IDs, ARNs, versions, status, and timestamps.
`cloudBuild` cannot be reconstructed from a remote runtime because it depends on
local source/build settings.
Registry authentication secrets such as passwords are omitted by default. Use
`--include-secrets` only when you explicitly need a full-fidelity export, and
review the YAML before committing or sharing it.

### Options

| Flag | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `-f`, `--file` | path | no | | Write YAML to a file instead of stdout. |
| `--include-secrets` | flag | no | `false` | Include sensitive registry authentication fields in exported YAML. |

### Examples

```bash
# Export to stdout.
ar runtime export my-agent

# Export, edit metadata.name, then create a copy.
ar runtime export my-agent -f copied-runtime.yaml
# edit copied-runtime.yaml: metadata.name: my-agent-copy
ar runtime apply -f copied-runtime.yaml
```

---

## get

```
Expand Down
35 changes: 35 additions & 0 deletions docs/zh/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ YAML;用户不写时 CLI 会自动注入一个名为 `default` 的 endpoint(
- [apply](#apply) — 配置后先云上构建,再从 YAML create-or-update。
- [cloud-build](#cloud-build) — 只按 YAML 构建镜像,不部署 runtime。
- [render](#render) — 校验 + 渲染为 SDK 输入(不调用服务端)。
- [export](#export) — 将存量 runtime 导出为可 apply 的 YAML。
- [get](#get) — 按名字获取单个 runtime。
- [list](#list) — 列出 runtime;可用 `--created-by-cli` 或 `--workspace` 过滤。
- [delete](#delete) — 删除 runtime(默认等待)。
Expand Down Expand Up @@ -148,6 +149,40 @@ ar runtime render -f FILE

---

## export

```
ar runtime export NAME [-f FILE] [--include-secrets]
```

读取一个存量 Agent Runtime 及其 endpoints,并导出为 `ar runtime apply` 可消费的
YAML。默认输出到 stdout;传入 `--file` 时写入文件。命令只导出当前 CLI YAML
schema 支持的字段,会刻意省略 ID、ARN、version、status、时间戳等服务端状态字段。
`cloudBuild` 依赖本地源码目录和构建参数,无法从远端 runtime 反推,因此不会导出。
镜像仓库认证密码等敏感字段默认不导出。只有明确需要完整导出时才使用
`--include-secrets`,提交或共享前请先检查 YAML。

### Options

| Flag | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `-f`, `--file` | path | no | | 将 YAML 写入文件,而不是 stdout。 |
| `--include-secrets` | flag | no | `false` | 在导出 YAML 中包含敏感的镜像仓库认证字段。 |

### Examples

```bash
# 导出到 stdout
ar runtime export my-agent

# 导出后修改 metadata.name,再创建一份副本
ar runtime export my-agent -f copied-runtime.yaml
# 编辑 copied-runtime.yaml:metadata.name: my-agent-copy
ar runtime apply -f copied-runtime.yaml
```

---

## get

```
Expand Down
9 changes: 5 additions & 4 deletions src/agentrun_cli/_utils/cloud_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,14 @@ def _artifact_name() -> str:

def _go_platform() -> str:
"""Convert a Python platform name to a Go release platform name."""
if sys.platform == "win32":
platform_name = str(sys.platform)
if platform_name == "win32":
return "windows"
if sys.platform == "darwin":
if platform_name == "darwin":
return "darwin"
if sys.platform.startswith("linux"):
if platform_name.startswith("linux"):
return "linux"
raise CloudBuildError(f"unsupported platform: {sys.platform}")
raise CloudBuildError(f"unsupported platform: {platform_name}")


def _go_arch() -> str:
Expand Down
2 changes: 2 additions & 0 deletions src/agentrun_cli/commands/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
from agentrun_cli.commands.runtime import crud_cmd as _crud_mod # noqa: E402
from agentrun_cli.commands.runtime import delete_cmd as _delete_mod # noqa: E402
from agentrun_cli.commands.runtime import export_cmd as _export_mod # noqa: E402
from agentrun_cli.commands.runtime import render_cmd as _render_mod # noqa: E402
from agentrun_cli.commands.runtime import status_cmd as _status_mod # noqa: E402

Expand All @@ -35,6 +36,7 @@ def runtime_group():
runtime_group.add_command(_apply_mod.apply_cmd)
runtime_group.add_command(_cloud_build_mod.cloud_build_cmd)
runtime_group.add_command(_render_mod.render_cmd)
runtime_group.add_command(_export_mod.export_cmd)
runtime_group.add_command(_crud_mod.get_cmd)
runtime_group.add_command(_crud_mod.list_cmd)
runtime_group.add_command(_delete_mod.delete_cmd)
Expand Down
Loading
Loading