fix: CLI缺少参数友好提示、config.yaml注释模板、skill目录结构规范

This commit is contained in:
2026-06-08 23:06:31 +08:00
parent c924e17253
commit 03b0c60fb6
5 changed files with 69 additions and 14 deletions

View File

@@ -149,6 +149,13 @@ function handleError(e: unknown): never {
printError(new UsageError(`未知命令: ${args.replace(/`/g, "")}`, {
hint: "运行 rune help 查看所有命令",
}));
} else if (e instanceof Error && e.message.includes("missing required args")) {
const match = e.message.match(/command `(\w+)/);
const cmd = match ? match[1] : "未知命令";
printError(new UsageError(`命令 '${cmd}' 缺少必填参数`, {
usage: `rune ${cmd} <change-name>`,
hint: `运行 rune help ${cmd} 查看用法`,
}));
} else {
printError(new InternalError());
}