@collectui/cli 0.2.5 → 0.2.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collectui/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "One CLI for every shadcn library on CollectUI Dash — login once, configure registries & MCP, scaffold agent-ready projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,11 +13,23 @@ export async function loginCmd(flags, rest, reporter) {
13
13
  skipVerify: Boolean(flags["no-verify"]),
14
14
  pat: Boolean(flags.pat),
15
15
  });
16
- reporter.result({
17
- account: me?.account ?? null,
18
- libraries: (me?.sites ?? []).map((s) => s.slug),
19
- keys: (me?.keys ?? []).length,
20
- });
16
+ // 交互模式:只显示人要看的(账号已在 success 行里,这里补数量与下一步);
17
+ // --json / headless 才给完整结构(Agent 消费 uid / 库清单 / key 数)
18
+ if (reporter.headless) {
19
+ reporter.result({
20
+ account: {
21
+ uid: me?.account?.uid ?? null,
22
+ username: me?.account?.username ?? null,
23
+ },
24
+ libraries: (me?.sites ?? []).map((s) => s.slug),
25
+ keys: (me?.keys ?? []).length,
26
+ });
27
+ } else {
28
+ reporter.result({
29
+ libraries: (me?.sites ?? []).length,
30
+ keys: (me?.keys ?? []).length,
31
+ });
32
+ }
21
33
  }
22
34
 
23
35
  export function logoutCmd(flags, rest, reporter) {
package/src/login.mjs CHANGED
@@ -26,7 +26,7 @@ export function saveSession(token, me, { reporter } = {}) {
26
26
  });
27
27
  reporter?.success(
28
28
  account?.username
29
- ? `Logged in as ${account.username} (${account.uid}).`
29
+ ? `Logged in as ${account.username}.`
30
30
  : "Logged in. Token saved locally."
31
31
  );
32
32
  return account;