@collectui/cli 0.2.6 → 0.2.7
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/package.json
CHANGED
package/src/commands/add.mjs
CHANGED
|
@@ -104,7 +104,11 @@ function addViaRegistry({ flags, reporter, lib, rawComponents, root, cliKey, fil
|
|
|
104
104
|
|
|
105
105
|
const command = ["npx", ...args].join(" ");
|
|
106
106
|
if (flags.print) {
|
|
107
|
-
reporter.
|
|
107
|
+
if (reporter.headless) {
|
|
108
|
+
reporter.result({ command, components: names, scopes, env: Object.keys(env), missingScopes: missing });
|
|
109
|
+
} else {
|
|
110
|
+
reporter.info(command);
|
|
111
|
+
}
|
|
108
112
|
return { command };
|
|
109
113
|
}
|
|
110
114
|
|
package/src/commands/login.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export async function loginCmd(flags, rest, reporter) {
|
|
|
13
13
|
skipVerify: Boolean(flags["no-verify"]),
|
|
14
14
|
pat: Boolean(flags.pat),
|
|
15
15
|
});
|
|
16
|
-
//
|
|
16
|
+
// 交互模式:账号已在 success 行里,数量并入 outro 即可,不再画框;
|
|
17
17
|
// --json / headless 才给完整结构(Agent 消费 uid / 库清单 / key 数)
|
|
18
18
|
if (reporter.headless) {
|
|
19
19
|
reporter.result({
|
|
@@ -24,16 +24,12 @@ export async function loginCmd(flags, rest, reporter) {
|
|
|
24
24
|
libraries: (me?.sites ?? []).map((s) => s.slug),
|
|
25
25
|
keys: (me?.keys ?? []).length,
|
|
26
26
|
});
|
|
27
|
-
} else {
|
|
28
|
-
reporter.result({
|
|
29
|
-
libraries: (me?.sites ?? []).length,
|
|
30
|
-
keys: (me?.keys ?? []).length,
|
|
31
|
-
});
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
export function logoutCmd(flags, rest, reporter) {
|
|
36
31
|
logout({ reporter });
|
|
37
|
-
|
|
32
|
+
// info 行 + outro 已把话说完,Result 框只留给 --json
|
|
33
|
+
if (reporter.headless) reporter.result({ loggedOut: true });
|
|
38
34
|
reporter.outro("Logged out.");
|
|
39
35
|
}
|
package/src/commands/setup.mjs
CHANGED
|
@@ -210,7 +210,12 @@ export async function runSetup({ flags, rest = [], reporter, mode }) {
|
|
|
210
210
|
"collectui doctor",
|
|
211
211
|
].filter(Boolean),
|
|
212
212
|
};
|
|
213
|
-
reporter.
|
|
213
|
+
if (reporter.headless) {
|
|
214
|
+
reporter.result(summary);
|
|
215
|
+
} else {
|
|
216
|
+
// TTY 下不画 Result 大框;下一步行动指引是 summary 里唯一对人有用的
|
|
217
|
+
reporter.note("Next steps", summary.next.join("\n"));
|
|
218
|
+
}
|
|
214
219
|
reporter.outro(
|
|
215
220
|
flags["dry-run"]
|
|
216
221
|
? "Dry run complete. Re-run without --dry-run to apply."
|
package/src/commands/skill.mjs
CHANGED
|
@@ -21,6 +21,7 @@ export async function skillCmd(flags, rest, reporter) {
|
|
|
21
21
|
});
|
|
22
22
|
cs.write(target, content, { summary: "install the CollectUI agent skill" });
|
|
23
23
|
await cs.apply();
|
|
24
|
-
reporter.result({ path: target, scope: global ? "global" : "project" });
|
|
24
|
+
if (reporter.headless) reporter.result({ path: target, scope: global ? "global" : "project" });
|
|
25
|
+
else reporter.info(`Skill written to ${target}.`);
|
|
25
26
|
reporter.outro("Skill installed. Claude Code picks it up automatically.");
|
|
26
27
|
}
|
package/src/commands/update.mjs
CHANGED
|
@@ -14,7 +14,7 @@ export async function updateCmd(flags, _rest, reporter) {
|
|
|
14
14
|
throw new CliError("--off and --on are mutually exclusive.", { code: 2 });
|
|
15
15
|
}
|
|
16
16
|
const next = writeConfig({ autoUpdate: !flags.off });
|
|
17
|
-
reporter.result({ autoUpdate: next.autoUpdate !== false });
|
|
17
|
+
if (reporter.headless) reporter.result({ autoUpdate: next.autoUpdate !== false });
|
|
18
18
|
reporter.outro(next.autoUpdate !== false ? "Auto-update enabled." : "Auto-update disabled (still notifies on new versions).");
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
@@ -25,13 +25,13 @@ export async function updateCmd(flags, _rest, reporter) {
|
|
|
25
25
|
const summary = { current: CLI_VERSION, latest, updateAvailable: cmp > 0 };
|
|
26
26
|
|
|
27
27
|
if (cmp <= 0) {
|
|
28
|
-
reporter.result(summary);
|
|
28
|
+
if (reporter.headless) reporter.result(summary);
|
|
29
29
|
reporter.outro(`Already on the latest version (${CLI_VERSION}).`);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
if (flags.check) {
|
|
34
|
-
reporter.result(summary);
|
|
34
|
+
if (reporter.headless) reporter.result(summary);
|
|
35
35
|
reporter.outro(`Update available: ${CLI_VERSION} → ${latest} (re-run without --check to install).`);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -43,6 +43,6 @@ export async function updateCmd(flags, _rest, reporter) {
|
|
|
43
43
|
hint: "Run `npm i -g @collectui/cli` manually to see the npm error; check global-prefix permissions (sudo/nvm).",
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
reporter.result({ ...summary, updated: true });
|
|
46
|
+
if (reporter.headless) reporter.result({ ...summary, updated: true });
|
|
47
47
|
reporter.outro(`Updated to ${latest}. Re-run commands to pick it up.`);
|
|
48
48
|
}
|