@gaoding/cli 1.4.2 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,9 +29,10 @@ gd-cli agent send --schema
29
29
  gd-cli tool list
30
30
  gd-cli model list --tool <tool>
31
31
  gd-cli model get <model>
32
+ gd-cli editor apply --schema
32
33
  ```
33
34
 
34
- 选定 Model 后,以 `model get` 返回的 `parameters` 与 `usageDescription` 构造实际输入;其中 `cost` 是当前上架 SKU 的稿豆价格区间,不表示某次调用的实际扣费。`tool call --schema` 只给出整个 Tool 的参数并集。运行 `gd-cli --help` 查看当前命令;运行任一命令的 `--help` 查看参数。
35
+ 选定 Model 后,以 `model get` 返回的 `parameters` 与 `usageDescription` 构造实际输入;其中 `cost` 是当前上架 SKU 的稿豆价格区间,不表示某次调用的实际扣费。`tool call <tool> --schema` 只给出整个 Tool 的参数并集。运行 `gd-cli --help` 查看当前命令;运行任一命令的 `--help` 查看参数。`editor apply --schema` 无需登录或连接编辑器,输出当前版本的 Action 输入契约;与执行模式 `--input` 互斥。
35
36
 
36
37
  CLI 最多每小时检查一次 npm `latest`,发现新版本后每天最多在 stderr 提醒一次;检查失败不影响原命令,`CI=true` 时跳过。普通启动不会检查或修复 Agent Skill。`gd-cli update` 始终实时检查 `latest`,支持更新 npm、pnpm 全局安装并同步 Agent Skill。
37
38
 
@@ -6,6 +6,13 @@ export function registerDamCommands(program, runtime) {
6
6
  const dam = program.command("dam")
7
7
  .description(text(runtime.product, "DAM 素材管理", "Asset management"))
8
8
  .helpCommand(false);
9
+ dam.addHelpText("after", [
10
+ "",
11
+ text(runtime.product, "先通过 repository list、folder list、tag list 或资源查询取得真实 ID,再操作;名称、前端 URL 和旧缓存不能代替 ID。", "Discover real IDs with repository list, folder list, tag list or asset queries before acting; names, frontend URLs and old caches are not IDs."),
12
+ text(runtime.product, "支持的命令以本 help 为准;读取所选子命令的 --help 获取参数、作用范围和输出形式。", "Available commands are listed here; read the selected subcommand's --help for parameters, scope and output mode."),
13
+ text(runtime.product, "写入结果未确认时先查询实际状态,不重复提交。跨资源库查询、受保护路径上传和永久删除须有用户明确授权。", "Inspect actual state before retrying an unconfirmed write. Cross-repository queries, protected-path uploads and permanent deletion require explicit user authorization."),
14
+ ""
15
+ ].join("\n"));
9
16
  const repository = dam.command("repository")
10
17
  .description(text(runtime.product, "DAM 资源库", "Asset repositories"))
11
18
  .helpCommand(false);
@@ -98,6 +105,7 @@ export function registerDamCommands(program, runtime) {
98
105
  .option("--repository-id <id>", text(runtime.product, "所属资源库 ID", "repository ID"))
99
106
  .option("--output-dir <directory>", text(runtime.product, "输出目录", "output directory"))
100
107
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
108
+ download.addHelpText("after", `\n${text(runtime.product, "只下载一个素材,不支持文件夹;写入本机目录,不覆盖已有同名文件。--json 返回 files 中的路径、字节数与摘要。", "Downloads one asset, not a folder, to a local directory without overwriting same-named files. --json returns paths, byte counts and digests in files.")}\n`);
101
109
  bindPreparedAction(download, "organization", async (signal) => {
102
110
  signal.throwIfAborted();
103
111
  const options = download.opts();
@@ -129,6 +137,7 @@ export function registerDamCommands(program, runtime) {
129
137
  .requiredOption("--title <title>", text(runtime.product, "新标题", "new title"))
130
138
  .option("--repository-id <id>", text(runtime.product, "所属资源库 ID", "repository ID"))
131
139
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
140
+ rename.addHelpText("after", `\n${text(runtime.product, "一次重命名一个条目;若已提交但未确认,先查询条目真实名称,不重复提交。", "Renames one entry. If submitted but unconfirmed, inspect its actual name before considering another write.")}\n`);
132
141
  bindPreparedAction(rename, "organization", async (signal) => {
133
142
  signal.throwIfAborted();
134
143
  const options = rename.opts();
@@ -163,6 +172,12 @@ export function registerDamCommands(program, runtime) {
163
172
  .option("--repository-id <source-id>", text(runtime.product, "源资源库 ID", "source repository ID"))
164
173
  .option("--target-repository-id <target-id>", text(runtime.product, "目标资源库 ID", "target repository ID"))
165
174
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
175
+ command.addHelpText("after", [
176
+ "",
177
+ text(runtime.product, "一次只操作一个素材或文件夹;先核对源与目标资源库、条目类型、目标文件夹。", "Operates on one asset or folder; verify source/destination repositories, entry kind and destination folder first."),
178
+ text(runtime.product, "已提交但未确认时查询目标位置并保留诊断 ID,不直接重提。copy 成功也可能不返回 copied_entry_id;查询目标位置取得新 ID,不猜 ID 或再次复制。", "If submitted but unconfirmed, inspect the destination and retain the diagnostic ID. A successful copy may omit copied_entry_id; discover the new ID at the destination without guessing or copying again."),
179
+ ""
180
+ ].join("\n"));
166
181
  bindPreparedAction(command, "organization", async (signal) => {
167
182
  signal.throwIfAborted();
168
183
  const options = command.opts();
@@ -311,6 +326,7 @@ export function registerDamCommands(program, runtime) {
311
326
  .argument("<asset>", text(runtime.product, "素材 ID", "asset ID"))
312
327
  .option("--repository-id <id>", text(runtime.product, "所属资源库 ID", "repository ID"))
313
328
  .option("--permanent", text(runtime.product, "移入回收站后永久删除", "permanently delete after moving to trash"));
329
+ deleteCommand.addHelpText("after", `\n${text(runtime.product, "默认移入回收站;--permanent 不可恢复,仅在用户明确要求永久删除时使用。支持的回收站操作请查 dam --help,不推断未列出的命令。", "Moves to the recycle bin by default; --permanent is irreversible and requires an explicit request. Consult dam --help for available recycle-bin operations rather than assuming unlisted commands exist.")}\n`);
314
330
  bindPreparedAction(deleteCommand, "organization", async (signal) => {
315
331
  signal.throwIfAborted();
316
332
  const options = deleteCommand.opts();
@@ -1,12 +1,32 @@
1
1
  import { bindAction, bindPreparedAction } from "./action-binding.js";
2
+ import { contractSchema } from "../contracts/schema.js";
3
+ import { CliUsageError } from "./errors.js";
2
4
  import { productText as text } from "../product/text.js";
5
+ const editorApplyInputSchema = contractSchema("editor.apply", "input");
3
6
  export function registerEditorCommands(program, runtime) {
4
7
  const editor = program.command("editor")
5
8
  .description(text(runtime.product, "连接并操作 AI+ Editor", "Connect to and operate insMind Editor"))
6
9
  .helpCommand(false);
10
+ editor.addHelpText("after", [
11
+ "",
12
+ text(runtime.product, "操作一个当前 Session、当前 Page 的直属 Shape 和绑定 Connector;单操作者串行执行。", "Operate one current Session and its Page's direct Shapes and bound Connectors, serially with one operator."),
13
+ text(runtime.product, "元素类型与字段以 editor apply --schema 为准;Schema 查询无需登录或连接 Editor。", "Discover element types and fields with editor apply --schema; no login or Editor connection is required."),
14
+ text(runtime.product, "当前不支持嵌套元素、自由/半绑定 Connector、页面或选择修改;UNSUPPORTED_PAGE_CONTENT 时保留原作品并换用空白或专用 Page。", "Nested elements, free/half-bound Connectors, page and selection changes are unsupported. On UNSUPPORTED_PAGE_CONTENT, preserve the work and use a blank or dedicated Page."),
15
+ text(runtime.product, "流程:connect → snapshot → apply → snapshot/screenshot 复查 → save → disconnect。apply 不代替 save。", "Workflow: connect → snapshot → apply → review snapshot/screenshot → save → disconnect. Apply does not replace Save."),
16
+ text(runtime.product, "EDITOR_BUSY 时等待原命令结束;写入超时、取消或断连时,先重新连接同一作品并检查真实状态,不直接重试写入。", "On EDITOR_BUSY, wait for the original command. After a write times out, is cancelled or disconnects, reconnect to the same work and inspect its state before deciding what to do."),
17
+ ""
18
+ ].join("\n"));
7
19
  const connect = leaf(editor.command("connect"))
8
20
  .description(text(runtime.product, "打开并连接一个 AI+ Editor 作品", "Open and connect to an Editor work"))
9
21
  .argument("[target]", text(runtime.product, "作品 ID 或完整 URL", "work ID or complete URL"));
22
+ connect.addHelpText("after", [
23
+ "",
24
+ text(runtime.product, "省略 target 新建线上 Board;数字按作品 ID 打开;完整 HTTP(S) URL 按该 URL 的环境打开。", "Omit target for a new production Board, use a numeric work ID, or provide a supported insMind production Editor URL."),
25
+ text(runtime.product, "会打开浏览器并替换旧 Session;浏览器登录、加载、Board 类型、编辑/保存权限与页面内容检查通过后才成功。CLI 登录不能替代浏览器登录。", "Opens the browser and replaces the old Session. Browser login, loading, Board type, edit/save permission and page-content checks must pass. CLI credentials do not replace browser login."),
26
+ text(runtime.product, "输出 JSON {target},不含连接凭证。连接失败时停止写入,让用户在页面处理登录或权限,再重新连接。", "Returns JSON {target} without connection credentials. On failure, stop writing and let the user resolve browser login or permissions before reconnecting."),
27
+ text(runtime.product, "页面切换作品会断开 Session;EDITOR_NOT_READY、EDITOR_SESSION_NOT_FOUND 或 EDITOR_NOT_CONNECTED 时确认目标后重连,不轮询旧 Session。", "Switching works disconnects the Session. On EDITOR_NOT_READY, EDITOR_SESSION_NOT_FOUND or EDITOR_NOT_CONNECTED, verify the target and reconnect instead of polling the old Session."),
28
+ ""
29
+ ].join("\n"));
10
30
  bindPreparedAction(connect, "none", async (signal) => {
11
31
  signal.throwIfAborted();
12
32
  const target = connect.processedArgs[0];
@@ -19,29 +39,57 @@ export function registerEditorCommands(program, runtime) {
19
39
  });
20
40
  const disconnect = leaf(editor.command("disconnect"))
21
41
  .description(text(runtime.product, "断开当前 Editor 连接", "Disconnect the current Editor"));
42
+ disconnect.addHelpText("after", `\n${text(runtime.product, "输出 JSON {disconnected};断开连接不保存作品,需先显式执行 editor save。", "Returns JSON {disconnected}. Disconnecting does not save the work; run editor save explicitly first.")}\n`);
22
43
  bindAction(disconnect, "none", async (_context, signal) => {
23
44
  writeJson(runtime, await runtime.editor.disconnect({ signal }));
24
45
  });
25
46
  const snapshot = leaf(editor.command("snapshot"))
26
47
  .description(text(runtime.product, "读取当前作品快照", "Read the current work snapshot"));
48
+ snapshot.addHelpText("after", [
49
+ "",
50
+ text(runtime.product, "输出 JSON {elements, selectedIds};selectedIds 只读。元素字段和类型见 editor apply --schema。", "Returns JSON {elements, selectedIds}; selectedIds is read-only. Discover element fields and types with editor apply --schema."),
51
+ text(runtime.product, "修改时以最新 Snapshot 中的完整元素为基础;每次 apply 后重新读取。UNSUPPORTED_PAGE_CONTENT 时停止并保留原作品。", "Base changes on complete elements from the latest Snapshot and read again after every Apply. On UNSUPPORTED_PAGE_CONTENT, stop and preserve the work."),
52
+ ""
53
+ ].join("\n"));
27
54
  bindAction(snapshot, "none", async (_context, signal) => {
28
55
  writeJson(runtime, await runtime.editor.snapshot({ signal }));
29
56
  });
30
57
  const apply = leaf(editor.command("apply"))
31
58
  .description(text(runtime.product, "按顺序应用元素操作", "Apply element operations in order"))
32
- .requiredOption("--input <file|->", text(runtime.product, "从文件或标准输入读取 JSON", "read JSON from a file or stdin"));
59
+ .option("--schema", text(runtime.product, "输出输入 Schema,不执行操作", "output the input Schema without executing an operation"))
60
+ .option("--input <file|->", text(runtime.product, "从文件或标准输入读取 JSON", "read JSON from a file or stdin"));
61
+ apply.addHelpText("after", [
62
+ "",
63
+ text(runtime.product, "--schema 与 --input 必须且只能选择一个。Schema 为本地契约,不连接 Editor;执行成功输出 JSON {appliedCount}。", "Choose exactly one of --schema and --input. Schema reads the local contract without connecting to Editor; successful execution returns JSON {appliedCount}."),
64
+ text(runtime.product, "输入是按序执行的 Action 数组;类型、必填字段与可选值见 --schema。使用简短语义 ID;create ID 必须唯一,Connector 可引用本批次更早创建的 Shape。", "Input is an ordered Action array; discover types, required fields and choices with --schema. Use short semantic IDs. Create IDs must be unique; a Connector may reference a Shape created earlier in the batch."),
65
+ text(runtime.product, "update 提交完整元素而非 patch,不改变 id 或 _type。delete 要求 ID 存在;删除 Shape 同时删除绑定的 Connector。", "Update requires the full element, not a patch, without changing id or _type. Delete requires an existing ID; deleting a Shape also deletes its bound Connectors."),
66
+ text(runtime.product, "Shape 的 x/y 为 Page 左上角坐标,w/h 大于 0;数值必须有限。颜色用 #RRGGBB 或 #RRGGBBAA,仅 stroke 可为 null。Connector 用 fromId/toId 表达有方向的 Shape 关系。", "Shape x/y locate its top-left corner in Page coordinates; w/h must exceed zero and numbers must be finite. Colors use #RRGGBB or #RRGGBBAA; only stroke accepts null. Connector fromId/toId express a directed Shape relationship."),
67
+ text(runtime.product, "整批先预检,再在可回滚事务中应用;INVALID_ACTIONS 时修正输入,APPLY_FAILED 时读 Snapshot 确认回滚。EDITOR_ROLLBACK_FAILED 时停止 apply/save,只读检查并报告。", "The batch is checked before one rollback-capable transaction. Correct INVALID_ACTIONS; on APPLY_FAILED read a Snapshot to confirm rollback. On EDITOR_ROLLBACK_FAILED, stop apply/save, inspect read-only and report."),
68
+ text(runtime.product, "成功不表示已保存或视觉正确;读取新 Snapshot,涉及布局/文字/连线时查看截图,再显式 save。超时、取消或断连后先检查真实状态,不重复提交。", "Success proves neither persistence nor correct rendering. Read a new Snapshot, view a screenshot for layout/text/connectors, then explicitly save. Inspect real state after timeout, cancellation or disconnection instead of resubmitting."),
69
+ ""
70
+ ].join("\n"));
33
71
  bindPreparedAction(apply, "none", async (signal) => {
34
72
  signal.throwIfAborted();
35
- const source = apply.opts().input;
36
- const input = await runtime.jsonInput.read(source, signal);
73
+ const options = apply.opts();
74
+ if (Number(options.schema === true) + Number(options.input !== undefined) !== 1)
75
+ throw new CliUsageError();
76
+ if (options.schema === true) {
77
+ await runtime.telemetry.stage("output", () => { writeJson(runtime, editorApplyInputSchema); });
78
+ return { handled: true };
79
+ }
80
+ const input = await runtime.jsonInput.read(options.input, signal);
37
81
  runtime.validators.editorApplyInput(input);
38
82
  return { handled: false, input };
39
83
  }, async (_context, input, signal) => {
40
84
  writeJson(runtime, await runtime.editor.apply({ input, signal }));
85
+ }, {
86
+ operation: "editor.apply",
87
+ mode: () => apply.opts().schema === true ? "schema" : "execute"
41
88
  });
42
89
  const screenshot = leaf(editor.command("screenshot"))
43
90
  .description(text(runtime.product, "导出当前作品 PNG 截图", "Export a PNG screenshot of the current work"))
44
91
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
92
+ screenshot.addHelpText("after", `\n${text(runtime.product, "将当前作品截图写入本机 PNG;--json 输出 {path},path 为绝对路径。打开实际图片检查文字、布局与连线,不以文件存在代替视觉验收。", "Writes a PNG screenshot locally; --json returns {path} with an absolute path. View the actual image to check text, layout and connectors; file existence is not visual verification.")}\n`);
45
93
  bindAction(screenshot, "none", async (_context, signal) => {
46
94
  const result = await runtime.editor.screenshot({ signal });
47
95
  runtime.presenter.result(result, {
@@ -52,6 +100,13 @@ export function registerEditorCommands(program, runtime) {
52
100
  const save = leaf(editor.command("save"))
53
101
  .description(text(runtime.product, "保存当前 AI+ Editor 作品", "Save the current Editor work"))
54
102
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
103
+ save.addHelpText("after", [
104
+ "",
105
+ text(runtime.product, "等待真实持久化完成;--json 输出 {workId, url}。新 Board 首次保存创建作品 ID;原样交付公开 url,保留环境参数。", "Waits for real persistence; --json returns {workId, url}. A new Board gets its work ID on first save. Deliver the public url unchanged, retaining environment parameters."),
106
+ text(runtime.product, "Save 最长等待 5 分 30 秒,其他 Editor RPC 默认 1 分钟;继续等待原命令,保持串行。成功前不得报告已保存。", "Save waits up to 5 minutes 30 seconds; other Editor RPCs default to one minute. Keep waiting on the original command and run serially. Do not report persistence before success."),
107
+ text(runtime.product, "SAVE_FAILED 时保留 Session 并处理明确原因;超时、取消或断连不表示未保存,先重连同一作品检查真实状态。EDITOR_ROLLBACK_FAILED 时不得继续保存。", "On SAVE_FAILED retain the Session and resolve the stated cause. Timeout, cancellation or disconnection does not prove failure to save; reconnect to the same work and inspect first. Do not save after EDITOR_ROLLBACK_FAILED."),
108
+ ""
109
+ ].join("\n"));
55
110
  bindAction(save, "none", async (_context, signal) => {
56
111
  const result = await runtime.editor.save({ signal });
57
112
  runtime.presenter.result(result, {
@@ -34,6 +34,14 @@ export function registerModelCommands(program, runtime) {
34
34
  .description(text(runtime.product, "查看模型完整信息", "Show complete model information"))
35
35
  .argument("<model>", text(runtime.product, "模型机器标识", "model machine identifier"))
36
36
  .allowExcessArguments(false);
37
+ get.addHelpText("after", [
38
+ "",
39
+ text(runtime.product, "只读查询当前身份可用的 Model,输出 JSON;不提交创作。参数、费用和预估耗时来自实时目录。", "Reads a Model available to the current identity as JSON without submitting creation. Parameters, cost and estimated time come from the live catalog."),
40
+ text(runtime.product, "parameters 是结构化元数据,不是 JSON Schema:遵守 required/type、minimum/maximum/step,SELECT 使用 options[].value 而非 label。", "parameters is structured metadata, not JSON Schema: follow required/type, minimum/maximum/step, and use SELECT options[].value rather than label."),
41
+ text(runtime.product, "Tool 调用须显式提供所有 required 字段;用户未指定时显式使用返回的 default。model 标识放入调用参数顶层,与模型参数并列。", "Tool calls explicitly supply every required field, using a returned default when the user omitted it. Include the returned model identifier at the top level alongside its parameters."),
42
+ text(runtime.product, "usageDescription 说明跨字段组合规则。tool call <tool> --schema 是 Tool 级参数并集,不能代替本 Model 的要求。Agent 只传显式生成约束,不照搬 Tool 的完整必填参数。", "usageDescription explains cross-field combinations. tool call <tool> --schema is a tool-wide union, not this Model's exact requirements. For Agent, pass explicit generation constraints rather than copying every Tool-required parameter."),
43
+ ""
44
+ ].join("\n"));
37
45
  bindAction(get, "organization", async (context, signal) => {
38
46
  const modelName = get.processedArgs[0];
39
47
  if (typeof modelName !== "string" || modelName.trim() === "")
@@ -4,6 +4,14 @@ export function registerUpdateCommand(program, runtime) {
4
4
  const update = program.command("update")
5
5
  .description(text(runtime.product, "更新 GD CLI 与内置 Agent Skill", "Update insMind CLI and its bundled Agent Skill"))
6
6
  .allowExcessArguments(false);
7
+ update.addHelpText("after", [
8
+ "",
9
+ text(runtime.product, `检查 ${runtime.product.npmPackage} 的 npm latest,更新受支持的全局 npm/pnpm 安装;CLI 已最新时仍同步随包 Skill。`, `Checks npm latest for ${runtime.product.npmPackage}, updates supported global npm/pnpm installations and synchronizes the bundled Skill even when the CLI is current.`),
10
+ text(runtime.product, `只授权本包安装脚本:npm --allow-scripts=${runtime.product.npmPackage},pnpm --allow-build=${runtime.product.npmPackage}。`, `Enables lifecycle scripts only for this package: npm --allow-scripts=${runtime.product.npmPackage}, pnpm --allow-build=${runtime.product.npmPackage}.`),
11
+ text(runtime.product, "普通使用只检查/提醒,不自动安装或同步 Skill。宿主管理的安装拒绝自行升级,并返回对应渠道的处理步骤;遵循该渠道,不覆盖其他宿主的 Skill。", "Normal use only checks/notifies; it does not install or synchronize Skills automatically. Host-managed installations reject self-update and return channel-specific instructions; follow that channel without overwriting other hosts' Skills."),
12
+ text(runtime.product, "若 CLI 更新成功但 Skill 验收失败,保留已更新版本,按错误中的下一步修复;不支持的安装来源也以命令返回的指引为准。", "If the CLI updates but Skill verification fails, keep the updated version and follow the error's next steps. Unsupported installation sources also receive channel-specific guidance."),
13
+ ""
14
+ ].join("\n"));
7
15
  bindAction(update, "none", async (_context, signal) => {
8
16
  const result = await runtime.update.run(signal);
9
17
  await runtime.telemetry.stage("output", async () => {
@@ -8,11 +8,6 @@ export const defaultToolDefinitions = [
8
8
  name: "video.generate",
9
9
  title: "视频生成",
10
10
  description: "使用已发布的视频模型,根据文本及可选图片、视频或音频生成视频。"
11
- },
12
- {
13
- name: "text.generate",
14
- title: "文本生成",
15
- description: "使用已发布的文本模型,根据文本和可选图片生成文本。"
16
11
  }
17
12
  ];
18
13
  export class ToolInputError extends Error {
@@ -2,19 +2,16 @@ import { RemoteRequestError } from "../../platform/signed-http-transport.js";
2
2
  export const ROOT_SCENE_CODES = [
3
3
  "image-model-art",
4
4
  "AI-image-generation-art",
5
- "AI-video-generation",
6
- "AI-text-generation"
5
+ "AI-video-generation"
7
6
  ];
8
7
  const rootTools = {
9
8
  "image-model-art": "image.generate",
10
9
  "AI-image-generation-art": "image.generate",
11
- "AI-video-generation": "video.generate",
12
- "AI-text-generation": "text.generate"
10
+ "AI-video-generation": "video.generate"
13
11
  };
14
12
  const toolOrder = {
15
13
  "image.generate": 0,
16
- "video.generate": 1,
17
- "text.generate": 2
14
+ "video.generate": 1
18
15
  };
19
16
  const multiUriKeys = new Set([
20
17
  "image_urls",
@@ -75,11 +75,6 @@ export const insmindProduct = freezeProduct({
75
75
  name: "video.generate",
76
76
  title: "Video generation",
77
77
  description: "Generate videos with published video models using text and optional images, video, or audio."
78
- },
79
- {
80
- name: "text.generate",
81
- title: "Text generation",
82
- description: "Generate text with published text models using text and optional images."
83
78
  }
84
79
  ]
85
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaoding/cli",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "Gaoding command-line interface for agents and people.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -55,8 +55,8 @@
55
55
  "vitest": "4.1.10"
56
56
  },
57
57
  "gaodingRelease": {
58
- "sourceCommit": "d1bad7971a87411d6cc35728f35449915e120f96",
59
- "pipelineId": "185792",
60
- "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/185792"
58
+ "sourceCommit": "20512692303b4ceff9b97871902c5ba126bdb894",
59
+ "pipelineId": "188672",
60
+ "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/188672"
61
61
  }
62
62
  }
@@ -5,11 +5,20 @@ description: Use when creating images, videos or text with GD CLI, operating the
5
5
 
6
6
  # GD CLI
7
7
 
8
+ ## 按需发现当前能力
9
+
10
+ - 首次使用时确认 `gd-cli --version`;不确定入口时读 `gd-cli --help`,沿相关命令组选择命令,执行前读其 `--help`。本 Skill 的示例不代表完整能力清单。
11
+ - 结构化输入先读取命令公开支持的 `--schema`;模型、参数选项、价格与资源 ID 由对应目录或详情查询取得,不从旧示例猜值。发现不支持或查询失败时说明缺口,不静默替换用户明确约束。
12
+ - 同一会话可复用同一路径/版本的 help 和静态 Schema;CLI 变化后重查。动态信息在本次任务选能力或报价时查询,身份/组织变化或明确不匹配时刷新相关结果,不全量扫描无关目录。
13
+ - 发现只说明当前实装 CLI 的能力,不等于升级,也不授予生成、写入或安装权限;未知结果的恢复按错误处理指引执行。
14
+
15
+ ## 读取任务指引
16
+
8
17
  按用户目标只读取对应参考:
9
18
 
10
19
  - 按业务意图选择 Agent / Tool 创作路由、发现 Model 并生成图片、视频或文本:[创作](references/creation.md)
11
20
  - 操作当前 AI+ Editor 作品:[编辑器](references/editor.md)
12
- - 发现资源库、文件夹与标签,查询、上传、下载或单条目管理 DAM 资源:[素材管理](references/dam.md)
21
+ - 发现资源库、文件夹与标签,查询、上传、下载或管理 DAM 资源:[素材管理](references/dam.md)
13
22
  - 登录或选择组织:[登录与组织](references/auth-org.md)
14
23
  - 处理输出、警告、失败、中断或找回丢失结果:[错误处理](references/errors.md)
15
24
  - 更新 CLI 与随包 Agent Skill:[更新](references/update.md)
@@ -17,7 +17,7 @@
17
17
  先判断 Creation Route,再选择或校验 Model。Model 和参数不决定 Agent 或 Tool 路由;两条路由都支持指定 Model 及其参数,`model list` 和 `model get` 是共享的实时发现能力。
18
18
 
19
19
  - Agent:用户要的是业务交付物,或过程需要澄清、规划、多步骤、多产物或继续已有创作。下列十类业务意图通常优先走 Agent;它们只帮助选择 Creation Route,具体 Business Skill 由服务端 Agent 选择。
20
- - Tool:任务是一个无需业务编排的原子单次图片、视频或文本调用,或用户明确要求直接调用 Tool。
20
+ - Tool:任务是一个无需业务编排的原子单次调用,具体能力由 `tool list` 发现;或用户明确要求直接调用可用 Tool。
21
21
 
22
22
  业务意图参考(语义匹配,不是只能逐字命中):
23
23
 
@@ -36,8 +36,6 @@
36
36
 
37
37
  这些参考不在 CLI 选择具体 Business Skill,也不代替服务端实时可用性。业务意图成立但缺少必需素材时,仍使用 Agent 并请用户提供素材;不要因此降级为 Tool。指定 Model、分辨率、比例、时长等参数也不改变路由。
38
38
 
39
- 状态映射:原“商品白底图”Business Skill 已下线,白底图或纯白背景需求按商品精修意图走 Agent;原“小红书人像封面”Business Skill 已下线,相关种草人像封面需求走 Agent 兜底。状态只解释路由,不表示 CLI 指定了服务端 Skill。
40
-
41
39
  典型判断:
42
40
 
43
41
  - “指定 Model 的电商主图套图”仍使用 Agent,因为目标是业务交付物且可能需要多产物编排。
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## 先发现,再操作
4
4
 
5
+ 先读 `gd-cli dam --help` 选择当前支持的操作,使用前读对应子命令的 `--help`;以下是常见路径,不是完整命令或参数清单。
6
+
5
7
  任何资源库范围内的查询或写入都先运行:
6
8
 
7
9
  ```bash
@@ -18,7 +20,7 @@ gd-cli dam folder list --repository-id <id> --json
18
20
  gd-cli dam tag list --repository-id <id> --json
19
21
  ```
20
22
 
21
- 文件夹可用 `--parent-id`、`--query`、`--page` 和 `--page-size`;标签可用 `--query`。根文件夹 ID 为 `0`,涉及目标位置时必须显式传 `--target-folder-id 0`,不要把缺省值理解为根目录。
23
+ 文件夹、标签的筛选和分页参数从对应 `--help` 获取。根文件夹 ID 为 `0`,涉及目标位置时必须显式传 `--target-folder-id 0`,不要把缺省值理解为根目录。
22
24
 
23
25
  ## 查询与下载
24
26
 
@@ -29,9 +31,9 @@ gd-cli dam get <asset-id> --json
29
31
  gd-cli dam download <asset-id> --repository-id <id> --output-dir ./downloads --json
30
32
  ```
31
33
 
32
- 跨资源库查询只在用户明确要求时使用 `--all-repositories`。列表或搜索按需增加文件夹、类型、格式、标签、数量和游标筛选。下载只支持一个素材,不支持文件夹下载,也不会覆盖已存在的同名文件。
34
+ 跨资源库查询只在用户明确要求时使用 `--all-repositories`。筛选、下载范围和本地文件处理规则从所选命令的 `--help` 获取,不擅自扩大用户指定的资源范围。
33
35
 
34
- ## 单条目写入
36
+ ## 写入与授权
35
37
 
36
38
  ```bash
37
39
  gd-cli dam upload ./asset.png --repository-id <id> --folder-id <folder-id> --tag-ids <tag-id> --json
@@ -41,12 +43,11 @@ gd-cli dam move <entry-id> --kind asset --repository-id <source-id> --target-rep
41
43
  gd-cli dam delete <asset-id> --repository-id <id>
42
44
  ```
43
45
 
44
- - `rename`、`move`、`copy` 的 `--kind` 只能是 `asset` 或 `folder`。
45
- - 一次只处理一个素材或文件夹;不拆分或模拟批量操作。
46
+ - 条目类型和单次操作范围以命令 `--help` 为准,不把示例当作完整能力清单,也不擅自扩大写入范围。
46
47
  - 上传受保护路径时,只有用户明确允许才加 `--allow-sensitive-path`;需要等待分析完成时加 `--wait-analysis`。
47
48
  - 复制结果可能没有 `copied_entry_id`,这不表示失败;查询目标文件夹或目标资源库发现新副本,不要猜测新 ID,也不要再次提交 copy。
48
49
  - 移动、复制或重命名若返回“已提交但未确认”,先查询目标位置并报告诊断 ID,不要立即重复提交。
49
50
  - 删除默认移入回收站;只有用户明确要求永久删除时才加 `--permanent`。
50
- - 回收站列表和恢复暂不可用,不要尝试不存在的 `dam recycle` 命令。
51
+ - 回收站等未在示例中展示的操作先查 `gd-cli dam --help`;未发现所需能力时说明限制,不猜测命令。
51
52
 
52
53
  写操作前确认资源库、条目 ID、类型和目标位置。优先从本轮 JSON 输出取得 ID,不从本地登录状态或旧输出替用户猜测。
@@ -1,86 +1,33 @@
1
1
  # AI+ Editor
2
2
 
3
- ## 使用边界
3
+ ## 发现能力与使用边界
4
4
 
5
- 使用 `gd-cli editor` 读取和操作浏览器中当前一个 AI+ Editor 作品。当前版本只支持一个 Editor Session、当前 Page 的直属 Shape 和 Connector,以及单操作者串行操作。
5
+ 首次进入此任务分支,读取当前安装版本的帮助;构造 Action 前查询输入 Schema:
6
6
 
7
- 支持的 Shape:
8
-
9
- - `rectangle`
10
- - `rounded-rectangle`
11
- - `triangle-up`
12
- - `ellipse`
13
- - `diamond`
7
+ ```bash
8
+ gd-cli editor --help
9
+ gd-cli editor apply --help
10
+ gd-cli editor apply --schema
11
+ ```
14
12
 
15
- Connector 必须从一个 Shape 绑定到另一个 Shape,`lineType` 只支持 `straight` 和 `elbowed`。当前不支持 Group、图片、视频、独立文本、嵌套元素、自由 Connector、半绑定 Connector、Connector label、端点坐标、选择修改或页面管理。
13
+ 支持的元素、Action、字段和可选值以当前 Schema 为准;操作范围、坐标/颜色语义、等待与错误处理以对应子命令 help 为准。Schema 查询无需登录或连接 Editor。不从旧示例推断能力,也不猜测不存在的字段或命令。
16
14
 
17
- 当前 Page 只要包含不支持的直属元素,`snapshot`、`apply` 和 `screenshot` 都会返回 `UNSUPPORTED_PAGE_CONTENT`。此时停止操作,让用户换用空白或专用 Page;保留原作品内容。
15
+ 保持单操作者串行操作。页面包含不支持的内容时停止,让用户换用空白或专用 Page;保留原作品内容。
18
16
 
19
17
  ## 标准流程
20
18
 
21
- 按以下闭环执行,完成标准是保存后得到 `workId` 和公开作品 URL:
22
-
23
- 1. 建立 Session。target 省略时在线上新建 Board;纯数字按线上作品 ID 打开;完整 HTTP/HTTPS URL 按该 URL 的环境打开:
24
-
25
- ```bash
26
- gd-cli editor connect
27
- gd-cli editor connect 37428738696269847
28
- gd-cli editor connect "http://my.gaoding.art:3000/?mode=create&type=board"
29
- ```
30
-
31
- 三种形式只选与目标匹配的一种。`connect` 只有在页面已连接,且浏览器 AI+ 登录、作品加载、Board 类型、编辑/保存权限和内容检查全部通过后才成功。连接失败时停止作图。
32
-
33
- 2. 读取当前 Page:
34
-
35
- ```bash
36
- gd-cli editor snapshot
37
- ```
38
-
39
- 3. 根据 Snapshot 生成完整、有序的 Action JSON 数组,通过文件或 stdin 应用:
40
-
41
- ```bash
42
- gd-cli editor apply --input actions.json
43
- # 或
44
- gd-cli editor apply --input -
45
- ```
46
-
47
- 4. 每次 Apply 后都重新读取结构。只要涉及布局、文字或 Connector,再获取截图并打开实际 PNG 复查:
48
-
49
- ```bash
50
- gd-cli editor snapshot
51
- gd-cli editor screenshot --json
52
- ```
53
-
54
- `screenshot --json` 返回 `{ "path": "<绝对 PNG 路径>" }`。使用本地图片查看能力检查图片;文件存在或 Action 已提交都不代表渲染正确。
55
-
56
- 5. 结构和视觉复查均通过后显式保存:
57
-
58
- ```bash
59
- gd-cli editor save --json
60
- ```
61
-
62
- 成功 stdout 形如:
19
+ 完成标准是结构与视觉复查通过,且显式保存成功并得到公开作品 URL:
63
20
 
64
- ```json
65
- {
66
- "workId": "37428738696269847",
67
- "url": "https://www.gaoding.art/editor/canvas?mode=user&type=board&id=37428738696269847"
68
- }
69
- ```
70
-
71
- 只有该命令成功才可以声明作品已保存。新 Board 在第一次显式保存时创建作品 ID;把返回的公开 `url` 交给用户,并保留其中的环境参数。
72
-
73
- 保存会等待 AI+ Editor 的真实持久化完成,可能明显慢于其他 Editor 命令;Bridge 为 Save 保留最长 5 分 30 秒。保持命令运行直到返回,不因短暂无输出而中断或并发发起其他 Editor 命令。
74
-
75
- 6. 保存成功后断开 Session:
76
-
77
- ```bash
78
- gd-cli editor disconnect
79
- ```
21
+ 1. 查询 `gd-cli editor connect --help`,按用户目标选择 `gd-cli editor connect [target]`。不为恢复已有作品而省略目标新建 Board。只有浏览器登录、加载、编辑/保存权限和内容检查通过后才成功;连接失败时停止作图。
22
+ 2. 读取 `gd-cli editor snapshot`。以最新 Snapshot 中的完整元素为基础,只改变目标字段;Update 提交完整元素,不能提交 patch。
23
+ 3. 根据 Schema 和 Snapshot 构造完整、有序的 Action JSON 数组,执行 `gd-cli editor apply --input actions.json`,或用 `--input -` 从 stdin 读取。使用简短语义 ID;Connector 的方向和目标必须符合业务关系。
24
+ 4. 每次 Apply 后重新读取 Snapshot。涉及布局、文字或 Connector 时,执行 `gd-cli editor screenshot --json` 并打开返回的绝对 `path` 对应的实际 PNG。文件存在或 Action 已提交都不代表渲染正确。
25
+ 5. 结构和视觉复查均通过后,执行 `gd-cli editor save --json`,继续等待原命令完成,不因短暂无输出而中断或并发操作。只有保存成功才可声明作品已保存;把返回的 `workId` 和公开 `url` 交给用户,并保留 URL 中的环境参数。等待时限查 `editor save --help`。
26
+ 6. 保存成功后执行 `gd-cli editor disconnect`;断开连接不代替保存。
80
27
 
81
28
  `connect` 会替换旧 Session 并打开作品页面。连接前置检查失败会清理本次 Session,但保留浏览器页面;用户在页面中完成登录或处理访问权限后,再重新执行 `connect`。GD CLI 的 AK/SK 登录不能替代浏览器 AI+ 登录,账号密码应由用户在浏览器登录界面输入。
82
29
 
83
- 如果 AI+ 在同一个 SPA 页面再次加载或切换作品,当前 Session 会主动断开以避免误写;此时重新执行 `gd-cli editor connect [target]`。
30
+ 页面重新加载或切换作品导致 Session 断开时,重新连接预期作品并读取最新 Snapshot 后再操作。
84
31
 
85
32
  ## 复查作品
86
33
 
@@ -100,155 +47,19 @@ Connector 必须从一个 Shape 绑定到另一个 Shape,`lineType` 只支持
100
47
 
101
48
  修正后再次执行 `snapshot`;涉及视觉变化时再次执行 `screenshot --json` 并打开图片。存在问题就继续修正;没有可执行问题时结束复查并保存。
102
49
 
103
- ## Snapshot 契约
104
-
105
- ```ts
106
- type FocusedPageSnapshot = {
107
- elements: Array<FocusedShape | FocusedConnector>;
108
- selectedIds: string[];
109
- };
110
-
111
- type FocusedShape = {
112
- _type: "shape";
113
- id: string;
114
- shapeType:
115
- | "rectangle"
116
- | "rounded-rectangle"
117
- | "triangle-up"
118
- | "ellipse"
119
- | "diamond";
120
- x: number;
121
- y: number;
122
- w: number;
123
- h: number;
124
- text?: string;
125
- fill: string;
126
- stroke: string | null;
127
- };
128
-
129
- type FocusedConnector = {
130
- _type: "connector";
131
- id: string;
132
- fromId: string;
133
- toId: string;
134
- lineType: "straight" | "elbowed";
135
- color: string;
136
- };
137
- ```
138
-
139
- `x`、`y` 是 Shape 左上角的 Page 坐标,`w`、`h` 是尺寸。`selectedIds` 只读。
140
-
141
- 只使用简短、有语义的 `id`,例如 `start`、`review`、`start-to-review`。Bridge 会把这些 ID 映射到 Editor 内部标识。Connector 用 `fromId`、`toId` 表达有方向的 Shape 关系。
142
-
143
- ## Action 契约
144
-
145
- ```ts
146
- type FocusedEditorAction =
147
- | { _type: "create"; element: FocusedShape | FocusedConnector }
148
- | { _type: "update"; element: FocusedShape | FocusedConnector }
149
- | { _type: "delete"; id: string };
150
- ```
151
-
152
- - 输入必须是 JSON 数组,Action 按数组顺序执行。
153
- - Create 的 `id` 必须唯一;Connector 可以引用本数组中更早创建的 Shape。
154
- - Update 必须提交完整元素,不能提交 patch,也不能改变 `id` 或 `_type`。
155
- - Delete 的 `id` 必须存在;删除 Shape 会同时删除绑定到它的 Connector。
156
- - 对象不接受额外字段。所有数值必须有限,`w`、`h` 必须大于 0。
157
- - `fill`、`stroke` 和 `color` 使用 `#RRGGBB` 或 `#RRGGBBAA`;只有 Shape 的 `stroke` 可以为 `null`。
158
- - 整批 Action 会先预检,再在一个可回滚事务中应用。任何一项无效时整批不写入;修正输入后再提交。
159
-
160
- ## 完整示例
161
-
162
- 以下数组创建从左到右的 `Start -> Review? -> Done` 流程图:
163
-
164
- ```json
165
- [
166
- {
167
- "_type": "create",
168
- "element": {
169
- "_type": "shape",
170
- "id": "start",
171
- "shapeType": "rounded-rectangle",
172
- "x": 80,
173
- "y": 160,
174
- "w": 180,
175
- "h": 80,
176
- "text": "Start",
177
- "fill": "#ffffff",
178
- "stroke": "#222222"
179
- }
180
- },
181
- {
182
- "_type": "create",
183
- "element": {
184
- "_type": "shape",
185
- "id": "review",
186
- "shapeType": "diamond",
187
- "x": 360,
188
- "y": 140,
189
- "w": 140,
190
- "h": 120,
191
- "text": "Review?",
192
- "fill": "#f2f6ff",
193
- "stroke": "#222222"
194
- }
195
- },
196
- {
197
- "_type": "create",
198
- "element": {
199
- "_type": "shape",
200
- "id": "done",
201
- "shapeType": "rounded-rectangle",
202
- "x": 600,
203
- "y": 160,
204
- "w": 180,
205
- "h": 80,
206
- "text": "Done",
207
- "fill": "#e8f7ed",
208
- "stroke": "#222222"
209
- }
210
- },
211
- {
212
- "_type": "create",
213
- "element": {
214
- "_type": "connector",
215
- "id": "start-to-review",
216
- "fromId": "start",
217
- "toId": "review",
218
- "lineType": "straight",
219
- "color": "#222222"
220
- }
221
- },
222
- {
223
- "_type": "create",
224
- "element": {
225
- "_type": "connector",
226
- "id": "review-to-done",
227
- "fromId": "review",
228
- "toId": "done",
229
- "lineType": "straight",
230
- "color": "#222222"
231
- }
232
- }
233
- ]
234
- ```
235
-
236
- 修改现有元素时,以最新 Snapshot 中的完整对象为基础,只改变目标字段后提交完整 Update。
237
-
238
50
  ## 失败处理
239
51
 
240
52
  - `LOGIN_REQUIRED`:停止作图,让用户在已打开的 AI+ 页面登录,然后重新执行 `connect`;浏览器登录不能用 `gd-cli auth` 代替。
241
53
  - `EDITOR_NOT_READY`:停止并检查页面是否完成加载;重新执行 `connect`,成功前不调用写操作。
242
54
  - `WORK_NOT_EDITABLE`:停止;当前用户没有该作品的编辑或保存能力。
243
- - `EDITOR_SESSION_NOT_FOUND`:重新执行 `gd-cli editor connect [target]`,然后读取 Snapshot。
244
- - `EDITOR_NOT_CONNECTED`:页面连接已丢失;重新连接目标作品,不轮询旧 Session。
55
+ - `EDITOR_SESSION_NOT_FOUND` 或 `EDITOR_NOT_CONNECTED`:重新连接目标作品并读取 Snapshot,不轮询旧 Session。
245
56
  - `UNSUPPORTED_PAGE_CONTENT`:停止,让用户改用空白或专用 Page。
246
- - `INVALID_ACTIONS`:根据本契约和最新 Snapshot 修正 Action,不原样重试。
57
+ - `INVALID_ACTIONS`:根据当前 Schema、help 和最新 Snapshot 修正 Action,不原样重试。
247
58
  - `APPLY_FAILED`:运行时异常已触发批次回滚;重新读取 Snapshot,确认作品处于 Apply 前状态后再决定下一步。
248
59
  - `EDITOR_ROLLBACK_FAILED`:无法确认恢复到 Apply 前状态。停止所有 `apply` 和 `save`,只读取 Snapshot 或截图并报告。
249
60
  - `SAVE_FAILED`:保留当前 Session,处理明确失败原因后可再次执行 `save --json`;成功前不报告已保存。
250
61
  - `EDITOR_BUSY`:等待当前命令结束后再发下一条,保持串行。
251
- - `EDITOR_RPC_TIMEOUT`:页面是否执行完成未知,Bridge 会关闭。普通 Editor RPC 默认等待 1 分钟,Save 最长等待 5 分 30 秒。读取类操作可重新连接同一作品后重试;`apply` 或 `save` 属于不确定写入,先重新连接同一作品并检查真实状态,再决定后续动作。无法检查原作品时停止并报告,不自动重试该写入。
252
- - `PROTOCOL_VERSION_MISMATCH`:停止并升级 GD CLI,或使用协议匹配的 AI+ Editor。
62
+ - `EDITOR_RPC_TIMEOUT`:页面是否执行完成未知,Bridge 会关闭。读取类操作可重新连接同一作品后重试;`apply` 或 `save` 属于不确定写入,先重新连接同一作品并检查真实状态,再决定后续动作。无法检查原作品时停止并报告,不自动重试该写入。
63
+ - `PROTOCOL_VERSION_MISMATCH`:停止,按[更新指引](update.md)处理安装渠道,或使用协议匹配的 AI+ Editor;不绕过宿主管理。
253
64
 
254
65
  任何写操作在超时、取消或连接中断后都可能已经提交。恢复时先观察真实状态,避免重复创建、重复 Apply 或重复 Save。
@@ -11,7 +11,7 @@
11
11
  "data": {
12
12
  "model": "<model>",
13
13
  "arguments": {
14
- "resolution": "2K"
14
+ "<parameter>": "<value from model detail and user request>"
15
15
  }
16
16
  }
17
17
  }
@@ -1,15 +1,16 @@
1
1
  # 更新
2
2
 
3
- 执行:
3
+ 用户要求升级或同意处理兼容性问题时,先查询当前安装渠道的更新语义,再执行更新:
4
4
 
5
5
  ```bash
6
+ gd-cli update --help
6
7
  gd-cli update
7
8
  ```
8
9
 
9
- 该命令检查 `@gaoding/cli` 的 npm `latest`,更新受支持的 npm 或 pnpm 全局安装,并确保随包 `gd-cli` Agent Skill 已同步;CLI 已是最新版本时仍会同步 Agent Skill。npm 更新只通过 `--allow-scripts=@gaoding/cli` 为本包启用安装脚本,pnpm 更新只通过 `--allow-build=@gaoding/cli` 为本包启用 build lifecycle。
10
+ 参数、安装来源、lifecycle 开关和 Skill 同步行为以 `update --help` 及命令返回为准;不要复制旧版本的安装命令。
10
11
 
11
- 正常使用 CLI 时,版本可用性最多每小时检查一次;存在新版本时,同一本地自然日最多在 stderr 提醒一次。看到提示后执行 `gd-cli update`。自动检查不会更新 CLI,也不会检查或修复 Agent Skill;`CI=true` 时跳过。
12
+ 普通版本提示不等于已经升级,也不表示 Skill 已同步;能力发现基于本机实装版本,不为查询能力自行升级。
12
13
 
13
- 如果 `gd-cli update` 提示当前安装由 WorkBuddy 连接器管理,请在 WorkBuddy 中更新「稿定」连接器。不要尝试绕过该安装渠道单独升级 CLI 或同步 Agent Skill;连接器会一起管理并验收匹配版本的 CLI 与 Skill。
14
+ 安装由 WorkBuddy 等宿主管理时,按命令返回的渠道指引处理。不要绕过托管升级、覆盖宿主 Skill 或借其他宿主的全局安装修复;CLI 与 Skill 不必具有相同版本号,兼容性由该渠道的最低版本和验收保证。
14
15
 
15
- 命令不接收参数或 `--json`。不支持自动更新的安装来源会给出明确的 npm、pnpm 全局安装命令。若 CLI 已更新但 Agent Skill 验收失败,保留已更新版本,按 stderr 的下一步修复后重新执行 `gd-cli update`。
16
+ 若 CLI 已更新但 Agent Skill 验收失败,保留已更新版本,按 stderr 的下一步修复后重新执行更新;不要把失败报告成完整成功。