SuperAPI AI 工具集

dce

部署与运维

查看项目

更新于 10-15 20:32

技能介绍

用途:当用户要求操作 dce、检查其 API 命令,或为某个 API 任务寻找正确的生成命令时使用该技能。

工作流程:先用 dce search "<intent>" --json 搜索候选命令,必要时加 --limit;搜索仅是候选发现。执行不熟悉的命令前,用 dce commands show <path...> --json 查看确切命令。若命令详情中 auth.required=true,先运行 dce auth status -o json 并查看 hostname 与其来源。主机解析顺序为 --hostname > $DCE_HOST > 已选主机(dce auth use <host>)> http.default_hostname > hosts.yml 中唯一主机;都不适用时应停止并请用户认证或选择主机。只有 flags、body、认证、HTTP 路径、变更类型、dry_run 和输出提示都明确后才执行。当变更不是只读时,若 dry_run.mode 为 http_preview,可用 --<dry_run.flag> 预览;若无法预览,须先获得用户明确确认。

通用命令:dce commands --json(完整目录)、dce commands --include-hidden --json(含隐藏命令)、dce commands show <path...> --json(单命令权威来源)、dce commands schema --json(目录 schema 版本、surface 与 dry-run 结果结构)、dce search "<intent>" --json(排序候选)、dce auth status -o json(解析出的 hostname、来源、已选主机及所有登录主机)。维护命令:dce --version 或 dce -v 打印 CLI 版本。

规则:不要凭命令名猜测 flags 或请求体结构;不要直接执行搜索结果,先用 commands show 确认;unknown 不可当作只读。优先用 -o json 输出;用它或 -o yaml 时依据 error.code 与进程退出码分支,error.message、error.hint 是安全的人工提示,error.http.status 是唯一可选 HTTP 上下文。配置的 stream 暂停视为成功(退出码 0),应检查暂停事件映射的收集输出字段。收集流时选一种模式:-o json 单文档、默认输出模式下 --stream(当存在 catalog output.streaming.policy.live)、或 -o raw 线路事件。JSON 请求体按 commands show 的 body 要求使用 --file、--set 或 --set-str。存在 body.runtime_schema 时正常执行会先获取并校验该 schema,http_preview 干跑保持无网络并跳过预检。敏感 flag 优先用 flags[].input_modes 中的安全模式:--<flag>-env、--<flag>-file 或 --<flag>-stdin。

模块可用性:目录列出的是构建时包含的所有模块,不代表目标主机已安装。模块路径级别的 404(路由本身不存在)含义模糊:模块未安装或路径/版本错误。此时先运行 dce global-management about list-g-product-versions -o json(global-management 是始终存在的基础模块)。若不在列表中,说明主机未安装该模块,不要重试、不要尝试同模块兄弟命令、不要声称该能力存在;若在列表中,则 404 不是模块缺失,应重新核对确切路径与参数,不要报告模块缺失。资源级 404(可用模块上的具体 ID/名称)表示该对象不存在,正常处理。

参考文档:references/catalog.md 提供命令发现协议与目录字段含义;references/modules/ 下各模块文件(ai-lab、billing-center、business-cockpit、container-management、elasticsearch、global-management、insight、kafka、llm-studio、microservice-engine、minio、mongodb、mysql、operations-management、postgresql、rabbitmq、redis、rocketmq、seaweedfs、virtual-machines、workbench)提供对应模块命令索引。