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

# 高代码智能体

高代码路径适合需要自定义逻辑、工具或多智能体编排的场景：你从模板脚手架一个项目，直接编写智能体代码，再由 CLI 在云端构建镜像并部署为运行时。闭环从脚手架开始，经编辑、部署、调用、查看日志，最终回到编辑持续迭代。

> [!NOTE]
>
> 开始前请先配置 AK/SK，或通过 [SSO 登录](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.51.1/zh/commands/auth.md)获取短期 STS 凭证。`launch`、`deploy` 和 `invoke` 会按统一的凭证优先级读取有效凭证。配置方法见[快速开始](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.51.1/zh/quickstart.md)的「鉴权」一节。编写智能体代码的完整说明见 [VeADK 1.0.9 文档](https://docs.veadk.xyz/productions/veadk/archives/1.0.9/zh/index.md)。

**1. 脚手架项目**

从内置模板创建项目。运行 `agentkit init --list-templates` 可先列出全部模板。

```bash lines theme={null}
agentkit init my-agent --template basic
cd my-agent
```

**2. 编辑智能体**

修改脚手架生成的代码，调整智能体的指令、工具与编排逻辑。

> [!NOTE]
>
> 运行时容器必须监听 `0.0.0.0:8000`，以通过就绪探针。模板已默认满足该要求，通常无需改动。

**3. 构建并部署**

执行完整生命周期流程，在云端构建镜像并创建或更新运行时。

```bash lines theme={null}
agentkit launch
```

> [!TIP]
>
> 需要在脚手架与构建之间检查或手改 `agentkit.yaml`、`Dockerfile` 时，可先运行 `agentkit config --show`，再分步执行 `agentkit build` 与 `agentkit deploy`。详见[配置](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.51.1/zh/commands/config.md)、[构建](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.51.1/zh/commands/build.md)与[部署](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.51.1/zh/commands/deploy.md)。

**4. 调用运行时**

按名称调用运行时，验证部署结果。

```bash lines theme={null}
agentkit invoke my-agent -m "你好，介绍一下你自己"
```

**5. 查看与迭代**

运行时行为异常时先看日志；修改代码后重新部署即可发布新版本。

```bash lines theme={null}
agentkit runtime logs my-agent --limit 200
agentkit launch
```

需要回滚或调整资源时，借助版本与更新命令：查看历史用 `agentkit runtime versions my-agent`，发布指定版本用 `agentkit runtime release my-agent --rev <n>`，调整 CPU 与内存用 `agentkit runtime update my-agent --cpu-milli 1000 --memory-mb 2048 --auto-release`。

不再需要该运行时时，将其删除以释放资源：

```bash lines theme={null}
agentkit runtime delete my-agent -y
```

只需配置、无需编写代码时，改用[使用 Harness](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.51.1/zh/workflows/harness)。


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