@house365/comate 0.9.22 → 0.9.23
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/bin/cli.mjs +28 -0
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -68,6 +68,23 @@ const SKILLS_PASSTHROUGH = new Set([
|
|
|
68
68
|
'experimental_sync',
|
|
69
69
|
]);
|
|
70
70
|
|
|
71
|
+
// Flags accepted on a bare `comate [flags]` invocation — these forward to the
|
|
72
|
+
// implicit `skills add`. Anything else starting with `-` is a typo (e.g.
|
|
73
|
+
// `--vasdasd`) and must hit help instead of silently installing everything.
|
|
74
|
+
// --version/-v and --help/-h are intercepted earlier, so they need not be here.
|
|
75
|
+
const ADD_FLAGS = new Set([
|
|
76
|
+
'-g', '--global',
|
|
77
|
+
'-a', '--agent',
|
|
78
|
+
'-s', '--skill',
|
|
79
|
+
'-l', '--list',
|
|
80
|
+
'-y', '--yes',
|
|
81
|
+
'--copy',
|
|
82
|
+
'--metadata',
|
|
83
|
+
'--subagent',
|
|
84
|
+
'--all',
|
|
85
|
+
'--full-depth',
|
|
86
|
+
]);
|
|
87
|
+
|
|
71
88
|
const HELP_TEXT = `comate — SDD (规约驱动开发) 的 AI 开发编排器
|
|
72
89
|
|
|
73
90
|
用法:
|
|
@@ -142,6 +159,17 @@ if (args.length && !args[0].startsWith('-')) {
|
|
|
142
159
|
printHelp(console.error);
|
|
143
160
|
process.exit(1);
|
|
144
161
|
}
|
|
162
|
+
} else if (args[0]?.startsWith('-')) {
|
|
163
|
+
// Bare-flags mode: every arg is forwarded to the implicit `skills add`. Any
|
|
164
|
+
// dash-prefixed arg that isn't a known install flag is a typo (e.g.
|
|
165
|
+
// --vasdasd). Without this it fell through and silently installed everything.
|
|
166
|
+
// Flag values (e.g. `-a claude-code`) don't start with `-`, so they're safe.
|
|
167
|
+
const bad = args.find((a) => a.startsWith('-') && !ADD_FLAGS.has(a));
|
|
168
|
+
if (bad) {
|
|
169
|
+
console.error(`comate: 未知选项 '${bad}'\n`);
|
|
170
|
+
printHelp(console.error);
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
145
173
|
}
|
|
146
174
|
|
|
147
175
|
// No args, or only flags (-g, --list, …) = install every comate skill from this
|