@collectui/cli 0.2.3 → 0.2.4

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.3",
3
+ "version": "0.2.4",
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",
package/src/cli.mjs CHANGED
@@ -15,6 +15,7 @@ import { collectSecrets, readConfig, resolveToken } from "./config.mjs";
15
15
  import { CliError, usageError } from "./errors.mjs";
16
16
  import { createReporter } from "./report.mjs";
17
17
  import { startBackgroundUpdate } from "./update.mjs";
18
+ import { showBanner } from "./banner.mjs";
18
19
  import { loginCmd, logoutCmd } from "./commands/login.mjs";
19
20
  import { whoamiCmd } from "./commands/whoami.mjs";
20
21
  import { libsCmd } from "./commands/libs.mjs";
@@ -163,8 +164,12 @@ async function main() {
163
164
  const reporter = makeReporter(flags, token);
164
165
  if (token) reporter.addSecrets([token]);
165
166
 
166
- // 自更新:交互 TTY 下后台检查/自动更(headless/CI 由门控静默跳过)
167
- startBackgroundUpdate(reporter, { config: readConfig() });
167
+ showBanner(reporter); // 开机画面:任何子命令(headless/--version/help 已在前面分流)
168
+ // 自更新:交互 TTY 下后台检查/自动更(headless/CI 由门控静默跳过);
169
+ // 手动 update 命令自身不触发(避免与前台安装并发写全局目录)
170
+ if (name !== "update" && name !== "upgrade") {
171
+ startBackgroundUpdate(reporter, { config: readConfig() });
172
+ }
168
173
 
169
174
  await command.run(flags, rest, reporter);
170
175
  }
@@ -10,7 +10,6 @@ import { fetchMe } from "../dash.mjs";
10
10
  import { planMcpConfig, describeEntries } from "../mcp.mjs";
11
11
  import { detectPackageManager, planProjectConfig } from "../project.mjs";
12
12
  import { planManifest, planScaffold } from "../scaffold.mjs";
13
- import { showBanner } from "../banner.mjs";
14
13
  import { selectLibs } from "./common.mjs";
15
14
 
16
15
  const DEFAULT_CLIENTS = ["claude", "cursor", "vscode"];
@@ -61,7 +60,6 @@ function isNonEmptyDir(dir) {
61
60
  */
62
61
  export async function runSetup({ flags, rest = [], reporter, mode }) {
63
62
  reporter.intro(`CollectUI CLI · ${mode}`);
64
- if (mode === "init") showBanner(reporter);
65
63
 
66
64
  let token = resolveToken(flags);
67
65
  if (!token) {
package/src/login.mjs CHANGED
@@ -2,7 +2,6 @@ import { spawn } from "node:child_process";
2
2
  import { randomBytes } from "node:crypto";
3
3
  import { createServer } from "node:http";
4
4
  import * as p from "@clack/prompts";
5
- import { showBanner } from "./banner.mjs";
6
5
  import { clearConfig, configFile, dashUrl, writeConfig } from "./config.mjs";
7
6
  import { authError } from "./errors.mjs";
8
7
  import { jsonRequest } from "./http.mjs";
@@ -52,7 +51,6 @@ export async function login({
52
51
  pat = false,
53
52
  }) {
54
53
  reporter.intro("CollectUI CLI · login");
55
- showBanner(reporter);
56
54
 
57
55
  let token = providedToken || process.env.COLLECTUI_TOKEN || process.env.DASH_PAT || "";
58
56
  token = token.trim();