manage-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesemanage-agent
管理Agent
Drive to manage agent-manager resources end-to-end. Locks the non-obvious patterns of the CLI into a predictable shape so calls don't silently fail or return half-empty envelopes.
amctlYour approach: Show a short plan before starting. Use ✓ for success, ✗ for failure. When something fails, diagnose the likely cause and propose a fix before trying another approach.
Flag shape is owned by , not this skill. Skills can't stay in lockstep with CLI versions; always reflects the installed binary. This document carries the things won't tell you: when to call which verb, what its output really means, and where the CLI's surface is misleading.
amctl <verb> --help--help--help通过端到端管理agent-manager资源。将CLI中不直观的使用模式标准化,避免调用静默失败或返回不完整的响应包。
amctl处理方式: 开始操作前先展示简短计划。用✓表示成功,✗表示失败。当操作失败时,先诊断可能的原因并提出修复方案,再尝试其他方法。
参数格式以为准,而非本技能文档。 技能无法与CLI版本保持同步;始终反映已安装的二进制文件的最新信息。本文档包含不会提及的内容:何时调用哪个命令、输出的实际含义,以及CLI界面存在误导性的地方。
amctl <verb> --help--help--helpReference files
参考文件
- — symptom → cause → fix table for non-obvious CLI behavior (empty envelopes, misleading statuses, async deletes, crash-loop signatures, shell traps). Load when an
references/troubleshooting.mdcall surprises you.amctl - — diagnostic flow for "build is Completed but the agent isn't really running" (build → logs → metrics → traces). Load when verifying a fresh deploy or chasing a runtime-only failure.
references/triage.md
- —— 针对CLI非直观行为(空响应包、误导性状态、异步删除、崩溃循环特征、Shell陷阱)的「症状→原因→修复」对照表。当
references/troubleshooting.md调用出现异常时加载此文件。amctl - —— 针对「构建已完成但Agent并未真正运行」问题的诊断流程(构建→日志→指标→追踪)。在验证新部署或排查仅运行时出现的故障时加载此文件。
references/triage.md
Install
安装
If returns a path, skip.
command -v amctlOtherwise: ask the user whether they want to install it themselves or have you do it.
"isn't installed. Would you like me to install it for you, or would you prefer to do it yourself?"amctl
If they want you to install it:
Run the bundled wrapper. It checks idempotency, execs the upstream installer, and prints a one-line status with the PATH outcome.
bash
bash <absolute-path-to-skill>/scripts/install-amctl.shAfter the installer finishes, stop and tell the user: open a new terminal so the updated is picked up, then run:
PATHbash
amctl login --url <instance-url>amctl loginOnce the user confirms login, verify with — NOT . only reflects the instance URL and looks identical for an unauthed half-configured context as for a logged-in one. The real auth canary is any project-scoped call: failure surfaces as .
amctl project list --jsonamctl context showcontext showerror.code: NO_ORG如果返回路径,则跳过安装。
command -v amctl否则:询问用户是希望自行安装还是由助手代为安装。
"尚未安装。您希望我帮您安装,还是您自行安装?"amctl
若用户希望助手代为安装:
运行捆绑的包装脚本。它会检查幂等性、执行上游安装程序,并打印包含PATH结果的单行状态信息。
bash
bash <absolute-path-to-skill>/scripts/install-amctl.sh安装完成后,务必告知用户:打开新终端以加载更新后的,然后运行:
PATHbash
amctl login --url <instance-url>amctl login用户确认登录后,用验证登录状态——不要使用。仅显示实例URL,未授权的半配置上下文与已登录的上下文显示内容完全相同。真正的授权验证方法是调用任何项目范围的命令:失败时会返回。
amctl project list --jsonamctl context showcontext showerror.code: NO_ORGIron rules
铁则
- Always pass . Errors come back as a structured envelope (
--json,error.code,error.message). Success envelopes always carryerror.additionalData.detailsplus context (data,instance,org, sometimesproject,environment). Exception:agentis raw text.agent build logs - Run before every call you haven't made this session, and always before
amctl <verb> --help/create. Flag sets evolve. Never infer flag absence from this doc, prior conversation, or a sibling agent's example.update - Always pass explicitly on project-scoped commands. Be aware
--project <name>exists and a user may have linked a directory (checkamctl context link), but do not link/unlink yourself — keep every command self-describing.amctl context show - Runtime commands (,
logs,metrics,traces,trace) requiretraces export. Use--env <name>for local dev.--env default - Builds are identified by (e.g.
buildName), NOThotel-booking-agent-1778760196718(UUID). Build commands take the agent name as a positional arg, notbuildId.--agent - does not show deployment health. Its
amctl agent getfield is usually empty. Verify liveness withstatusoragent logs. Seeagent metrics.references/triage.md - Validation errors come batched in . Read the full list, fix everything, retry — don't fix one at a time.
error.additionalData.details
- 始终传递参数。 错误会以结构化响应包返回(
--json、error.code、error.message)。成功响应包始终包含error.additionalData.details及上下文信息(data、instance、org,有时还有project、environment)。例外情况:agent返回原始文本。agent build logs - 在会话中首次调用某个命令前,以及执行/
create命令前,务必运行update。 参数集会不断演进。切勿根据本文档、之前的对话或其他Agent的示例推断参数是否存在。amctl <verb> --help - 在项目范围的命令中,始终显式传递参数。 注意
--project <name>命令的存在,用户可能已将某个目录关联到项目(可通过amctl context link检查),但助手不要自行执行关联/取消关联操作——确保每个命令都是自描述的。amctl context show - 运行时命令(、
logs、metrics、traces、trace)需要traces export参数。 本地开发环境使用--env <name>。--env default - 构建通过标识(例如
buildName),而非hotel-booking-agent-1778760196718(UUID)。构建命令将Agent名称作为位置参数,而非buildId参数。--agent - 不显示部署健康状态。 其
amctl agent get字段通常为空。通过status或agent logs验证Agent是否存活。详情请见agent metrics。references/triage.md - 验证错误会批量返回在中。读取完整的错误列表,一次性修复所有问题后重试——不要逐个修复。
error.additionalData.details
Verb map
命令映射
What exists, what it's for, and where lives. For exact flags on any row, run .
--helpamctl <verb> --help| Verb | Use to | Notes |
|---|---|---|
| Inspect current instance / org / linked project. | Auth-blind: shows URL even when unauthed. Not a login check. |
| Bind a directory to a project / agent. | See iron rule 3. |
| Discover projects, confirm auth works. | |
| Manage projects. | |
| Discover agents, read agent config. | |
| Create + auto-build + auto-deploy in one call. | Required flags vary by |
| Re-deploy a built image, optionally with new env. | |
| Remove an agent. | Async — |
| Enumerate builds, newest first. | Entries carry both |
| Status / percent / step list for one build. | |
| Trigger a fresh build without recreating the agent. | Optional commit pin. |
| Raw text build log (image pull, buildpack, workload CR apply). | NOT JSON. May be empty for 10–30s after a fresh build — retry. |
| Runtime pod logs. | Requires |
| CPU / memory time-series for the running pod. | Requires |
| List OTel traces from the agent's spans. | Requires |
| Span detail for a single | Add |
| Bulk dump full span data for every trace in a window. | |
列出所有可用命令、用途以及的位置。如需查看某行命令的具体参数,请运行。
--helpamctl <verb> --help| 命令 | 用途 | 说明 |
|---|---|---|
| 检查当前实例/组织/关联的项目。 | 不验证授权:即使未授权也会显示URL。不能作为登录检查。 |
| 将目录与项目/Agent绑定。 | 参见铁则3。 |
| 发现项目,确认授权是否有效。 | |
| 管理项目。 | |
| 发现Agent,读取Agent配置。 | |
| 一键完成创建+自动构建+自动部署。 | 必填参数因 |
| 重新部署已构建的镜像,可选择配置新环境变量。 | 使用 |
| 删除Agent。 | 异步操作——返回 |
| 列出所有构建记录,按时间倒序排列。 | 每条记录包含 |
| 查看单个构建的状态/进度/步骤列表。 | |
| 触发新的构建,无需重新创建Agent。 | 可选提交版本固定参数。 |
| 原始文本格式的构建日志(镜像拉取、buildpack、工作负载CR应用)。 | 不是JSON格式。新构建后10-30秒内日志可能为空——请重试。 |
| 运行时Pod日志。 | 需要 |
| 运行中Pod的CPU/内存时间序列数据。 | 需要 |
| 列出Agent链路的OTel追踪数据。 | 需要 |
| 单个 | 添加 |
| 批量导出指定时间窗口内所有链路的完整数据。 | |
End-to-end recipe
端到端流程
The flow for "create an agent and confirm it's actually serving traffic." For exact flags at each step, run against your installed binary.
amctl <verb> --helpExample plan to announce before you start:
text
I'll create the agent and confirm it's actually serving traffic.
Here's what I'll do:
✦ Confirm amctl is installed and you're logged in
✦ Run `amctl agent create --help` to lock onto the current flag set
✦ Create the agent (auto-builds + auto-deploys to `default`)
✦ Poll the build until Completed or Failed
✦ Confirm liveness via logs / metrics
✦ Pull a recent trace once there's traffic- Create. Run to see the current required flag set for your
amctl agent create --help/--subtype/--build-typecombination, then call--provisioning. The create call auto-builds and auto-deploys to the lowest environment (amctl agent create <name> --project <p> ... --jsonlocally).default - Poll the build. returns newest-first; pull
amctl agent build list <agent> --project <p> --json. Polldata.builds[0].buildNameuntilamctl agent build get <agent> <buildName> --project <p> --jsonisdata.statusorCompleted. In zsh, name the loop variable anything exceptFailed— zsh reservesstatusas a read-only alias for$status.$? - Confirm liveness. won't tell you. Tail
agent getand look for app-level output past the otel-tracing init container, or checkamctl agent logs <agent> --project <p> --env default --since 5m --jsonfor ≥1amctl agent metrics ...sample. If you see neither after ~3 min, run the full diagnostic inmemoryUsage.references/triage.md - Watch traces once there's traffic. . Empty list = agent hasn't run, window too narrow, or auto-instrumentation was disabled at create. Drill into a specific trace with
amctl agent traces <agent> --project <p> --env default --since 1h --json.amctl agent trace <agent> <traceId> ...
When anything in this flow returns a surprising envelope, check before reaching for a workaround.
references/troubleshooting.md创建Agent并确认其实际提供服务的流程。每个步骤的具体参数,请针对已安装的二进制文件运行查看。
amctl <verb> --help开始操作前需告知用户的示例计划:
text
我将创建Agent并确认其实际提供服务。具体步骤如下:
✦ 确认amctl已安装且您已登录
✦ 运行`amctl agent create --help`锁定当前参数集
✦ 创建Agent(自动构建并自动部署到`default`环境)
✦ 轮询构建状态直至完成或失败
✦ 通过日志/指标确认Agent存活
✦ 有流量后拉取最新追踪数据- 创建Agent。 根据您的/
--subtype/--build-type组合,运行--provisioning查看当前必填参数集,然后调用amctl agent create --help。创建命令会自动构建并部署到最低环境(本地为amctl agent create <name> --project <p> ... --json)。default - 轮询构建状态。 返回按时间倒序的构建记录;提取
amctl agent build list <agent> --project <p> --json。轮询data.builds[0].buildName直至amctl agent build get <agent> <buildName> --project <p> --json变为data.status或Completed。在zsh中,循环变量不要命名为Failed——zsh将status作为$status的只读别名。$? - 确认Agent存活。 无法告知您状态。通过
agent get查看日志,寻找otel-tracing初始化容器之后的应用级输出,或通过amctl agent logs <agent> --project <p> --env default --since 5m --json查看是否有≥1条amctl agent metrics ...样本。如果3分钟后仍未看到任何内容,请运行memoryUsage中的完整诊断流程。references/triage.md - 有流量后查看追踪数据。 运行。空列表表示Agent未运行、时间窗口过窄或创建时禁用了自动 instrumentation。可通过
amctl agent traces <agent> --project <p> --env default --since 1h --json查看具体链路详情。amctl agent trace <agent> <traceId> ...
当流程中任何步骤返回异常响应包时,请先查看,再尝试其他解决方法。
references/troubleshooting.md