@coze-arch/cli 0.0.32 → 0.0.34-alpha.da5090

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.
@@ -258,4 +258,4 @@ import { Screen } from '../../../components/Screen';
258
258
 
259
259
  ## 本地开发
260
260
 
261
- `coze dev`:用来首次启动前后端服务,也可以用来重启前后端服务(该命令会先尝试杀掉占用端口的进程,再启动服务)
261
+ `coze-dev dev`:用来首次启动前后端服务,也可以用来重启前后端服务(该命令会先尝试杀掉占用端口的进程,再启动服务)
@@ -6,7 +6,7 @@
6
6
  // start_aigc
7
7
  const config = {
8
8
  description:
9
- 'Native Static(纯静态):`coze init ${COZE_WORKSPACE_PATH} --template native-static`\n' +
9
+ 'Native Static(纯静态):`coze-dev init ${COZE_WORKSPACE_PATH} --template native-static`\n' +
10
10
  '- 适用:纯静态 HTML/CSS/JS 项目、静态网站\n' +
11
11
  '- 使用 Python http.server 作为开发服务器\n' +
12
12
  '- 不需要 Node.js 环境,适合简单静态内容',
@@ -7,7 +7,7 @@
7
7
  ### 启动开发服务器
8
8
 
9
9
  ```bash
10
- coze dev
10
+ coze-dev dev
11
11
  ```
12
12
 
13
13
  启动后,在浏览器中打开 [http://localhost:<%= port %>](http://localhost:<%= port %>) 查看应用。
@@ -17,13 +17,13 @@ coze dev
17
17
  ### 构建生产版本
18
18
 
19
19
  ```bash
20
- coze build
20
+ coze-dev build
21
21
  ```
22
22
 
23
23
  ### 启动生产服务器
24
24
 
25
25
  ```bash
26
- coze start
26
+ coze-dev start
27
27
  ```
28
28
 
29
29
  ## 项目结构
@@ -7,6 +7,6 @@ cd "${COZE_WORKSPACE_PATH}"
7
7
 
8
8
  echo "Installing dependencies..."
9
9
  pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
10
- if command -v coze > /dev/null 2>&1 && coze check-bins --help > /dev/null 2>&1; then
11
- coze check-bins --fix
10
+ if command -v coze-dev > /dev/null 2>&1 && coze-dev check-bins --help > /dev/null 2>&1; then
11
+ coze-dev check-bins --fix
12
12
  fi
@@ -9,7 +9,7 @@ import { appendFileSync, openSync, closeSync, mkdirSync } from 'fs';
9
9
 
10
10
 
11
11
 
12
- const description = `Next.js(复杂项目):\`coze init \${COZE_WORKSPACE_PATH} --template nextjs\`
12
+ const description = `Next.js(复杂项目):\`coze-dev init \${COZE_WORKSPACE_PATH} --template nextjs\`
13
13
  - 适用:全栈应用、复杂多页面等复杂项目
14
14
  - 使用默认nextjs项目规范
15
15
  - **目录规范**: 默认开启src目录(打开--src-dir选项):项目文件(如 app 目录、pages 目录、components 等)初始化到 src/ 目录下。
@@ -7,8 +7,8 @@ cd "${COZE_WORKSPACE_PATH}"
7
7
 
8
8
  echo "Installing dependencies..."
9
9
  pnpm install --prefer-frozen-lockfile --prefer-offline
10
- if command -v coze > /dev/null 2>&1 && coze check-bins --help > /dev/null 2>&1; then
11
- coze check-bins --fix
10
+ if command -v coze-dev > /dev/null 2>&1 && coze-dev check-bins --help > /dev/null 2>&1; then
11
+ coze-dev check-bins --fix
12
12
  fi
13
13
 
14
14
  echo "Preparing Nuxt project..."
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- const description = `Nuxt.js(服务端 + Vue):\`coze init \${COZE_WORKSPACE_PATH} --template nuxt-vue\`
10
+ const description = `Nuxt.js(服务端 + Vue):\`coze-dev init \${COZE_WORKSPACE_PATH} --template nuxt-vue\`
11
11
  - 适用:全栈应用、需要服务端接口能力的 Vue 项目
12
12
  - 特点:
13
13
  - **服务端能力**:内置服务端 API 路由,可直接创建后端接口
@@ -29,7 +29,7 @@ export const paramsSchema = {
29
29
 
30
30
  const config = {
31
31
  description:
32
- 'Pi Agent:`coze init ${COZE_WORKSPACE_PATH} --template pi-agent`\n' +
32
+ 'Pi Agent:`coze-dev init ${COZE_WORKSPACE_PATH} --template pi-agent`\n' +
33
33
  '- 适用:基于 pi-agent-core 的 AI Agent 应用\n' +
34
34
  '- 支持飞书、微信等多渠道接入\n' +
35
35
  '- 内置 Dashboard 管理面板\n' +
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- const description = `Taro(小程序 + H5):\`coze init \${COZE_WORKSPACE_PATH} --template taro\`
11
+ const description = `Taro(小程序 + H5):\`coze-dev init \${COZE_WORKSPACE_PATH} --template taro\`
12
12
  - 适用:微信小程序、H5 跨端应用
13
13
  - 前后端分离架构:Taro 4 + NestJS
14
14
  - 支持微信小程序和 H5 双端构建
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "name": "native-static",
31
- "description": "Native Static(纯静态):`coze init ${COZE_WORKSPACE_PATH} --template native-static`\n- 适用:纯静态 HTML/CSS/JS 项目、静态网站\n- 使用 Python http.server 作为开发服务器\n- 不需要 Node.js 环境,适合简单静态内容",
31
+ "description": "Native Static(纯静态):`coze-dev init ${COZE_WORKSPACE_PATH} --template native-static`\n- 适用:纯静态 HTML/CSS/JS 项目、静态网站\n- 使用 Python http.server 作为开发服务器\n- 不需要 Node.js 环境,适合简单静态内容",
32
32
  "location": "./native-static",
33
33
  "paramsSchema": {
34
34
  "type": "object",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  {
41
41
  "name": "nextjs",
42
- "description": "Next.js(复杂项目):`coze init ${COZE_WORKSPACE_PATH} --template nextjs`\n- 适用:全栈应用、复杂多页面等复杂项目\n- 使用默认nextjs项目规范\n - **目录规范**: 默认开启src目录(打开--src-dir选项):项目文件(如 app 目录、pages 目录、components 等)初始化到 src/ 目录下。\n - **项目理解加速**:初始可以依赖项目下 `package.json` 文件理解项目类型,如果没有或无法理解退化成阅读其他文件。\n - **UI设计与组件规范**:Next.js项目**必须默认**采用 shadcn/ui 风格和规范,`shadcn/ui`组件默认完整的预装在`src/components/ui/`目录下",
42
+ "description": "Next.js(复杂项目):`coze-dev init ${COZE_WORKSPACE_PATH} --template nextjs`\n- 适用:全栈应用、复杂多页面等复杂项目\n- 使用默认nextjs项目规范\n - **目录规范**: 默认开启src目录(打开--src-dir选项):项目文件(如 app 目录、pages 目录、components 等)初始化到 src/ 目录下。\n - **项目理解加速**:初始可以依赖项目下 `package.json` 文件理解项目类型,如果没有或无法理解退化成阅读其他文件。\n - **UI设计与组件规范**:Next.js项目**必须默认**采用 shadcn/ui 风格和规范,`shadcn/ui`组件默认完整的预装在`src/components/ui/`目录下",
43
43
  "location": "./nextjs",
44
44
  "paramsSchema": {
45
45
  "type": "object",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  {
66
66
  "name": "nuxt-vue",
67
- "description": "Nuxt.js(服务端 + Vue):`coze init ${COZE_WORKSPACE_PATH} --template nuxt-vue`\n- 适用:全栈应用、需要服务端接口能力的 Vue 项目\n- 特点:\n - **服务端能力**:内置服务端 API 路由,可直接创建后端接口\n - **Vue 3**:基于最新的 Vue 3 Composition API\n - **Vite**:使用 Vite 作为构建工具,开发体验极佳\n - **TypeScript**:完整的 TypeScript 支持\n - **文件路由**:基于文件系统的自动路由\n - **项目理解加速**:可依赖项目下 `package.json` 和 `nuxt.config.ts` 理解项目配置",
67
+ "description": "Nuxt.js(服务端 + Vue):`coze-dev init ${COZE_WORKSPACE_PATH} --template nuxt-vue`\n- 适用:全栈应用、需要服务端接口能力的 Vue 项目\n- 特点:\n - **服务端能力**:内置服务端 API 路由,可直接创建后端接口\n - **Vue 3**:基于最新的 Vue 3 Composition API\n - **Vite**:使用 Vite 作为构建工具,开发体验极佳\n - **TypeScript**:完整的 TypeScript 支持\n - **文件路由**:基于文件系统的自动路由\n - **项目理解加速**:可依赖项目下 `package.json` 和 `nuxt.config.ts` 理解项目配置",
68
68
  "location": "./nuxt-vue",
69
69
  "paramsSchema": {
70
70
  "type": "object",
@@ -96,7 +96,7 @@
96
96
  },
97
97
  {
98
98
  "name": "pi-agent",
99
- "description": "Pi Agent:`coze init ${COZE_WORKSPACE_PATH} --template pi-agent`\n- 适用:基于 pi-agent-core 的 AI Agent 应用\n- 支持飞书、微信等多渠道接入\n- 内置 Dashboard 管理面板\n- 使用 TypeScript + Express + Vite",
99
+ "description": "Pi Agent:`coze-dev init ${COZE_WORKSPACE_PATH} --template pi-agent`\n- 适用:基于 pi-agent-core 的 AI Agent 应用\n- 支持飞书、微信等多渠道接入\n- 内置 Dashboard 管理面板\n- 使用 TypeScript + Express + Vite",
100
100
  "location": "./pi-agent",
101
101
  "paramsSchema": {
102
102
  "type": "object",
@@ -120,7 +120,7 @@
120
120
  },
121
121
  {
122
122
  "name": "taro",
123
- "description": "Taro(小程序 + H5):`coze init ${COZE_WORKSPACE_PATH} --template taro`\n- 适用:微信小程序、H5 跨端应用\n- 前后端分离架构:Taro 4 + NestJS\n- 支持微信小程序和 H5 双端构建\n- 使用 TailwindCSS + weapp-tailwindcss 实现跨端样式",
123
+ "description": "Taro(小程序 + H5):`coze-dev init ${COZE_WORKSPACE_PATH} --template taro`\n- 适用:微信小程序、H5 跨端应用\n- 前后端分离架构:Taro 4 + NestJS\n- 支持微信小程序和 H5 双端构建\n- 使用 TailwindCSS + weapp-tailwindcss 实现跨端样式",
124
124
  "location": "./taro",
125
125
  "paramsSchema": {
126
126
  "type": "object",
@@ -152,7 +152,7 @@
152
152
  },
153
153
  {
154
154
  "name": "vite",
155
- "description": "Vite(简单项目):`coze init ${COZE_WORKSPACE_PATH} --template vite`\n- 适用:轻量级 SPA、纯前端交互、仪表盘等轻量级项目。",
155
+ "description": "Vite(简单项目):`coze-dev init ${COZE_WORKSPACE_PATH} --template vite`\n- 适用:轻量级 SPA、纯前端交互、仪表盘等轻量级项目。",
156
156
  "location": "./vite",
157
157
  "paramsSchema": {
158
158
  "type": "object",
@@ -13,7 +13,7 @@
13
13
  ### 启动开发服务器
14
14
 
15
15
  ```bash
16
- coze dev
16
+ coze-dev dev
17
17
  ```
18
18
 
19
19
  启动后,在浏览器中打开 [http://localhost:<%= port %>](http://localhost:<%= port %>) 查看应用。
@@ -23,7 +23,7 @@ coze dev
23
23
  ### 构建生产版本
24
24
 
25
25
  ```bash
26
- coze build
26
+ coze-dev build
27
27
  ```
28
28
 
29
29
  构建产物位于 `dist/` 目录,可直接部署到静态托管服务。
@@ -31,7 +31,7 @@ coze build
31
31
  ### 预览生产版本
32
32
 
33
33
  ```bash
34
- coze start
34
+ coze-dev start
35
35
  ```
36
36
 
37
37
  在本地启动一个静态服务器,预览生产构建的效果。
@@ -66,15 +66,15 @@ coze start
66
66
 
67
67
  **工作原理:**
68
68
 
69
- - **开发模式** (`coze dev`):
69
+ - **开发模式** (`coze-dev dev`):
70
70
  - 运行 `server/server.ts` 启动 Express 服务器
71
71
  - Vite 以 middleware 模式集成到 Express
72
72
  - 前端支持 HMR(热模块替换)
73
73
  - 后端 API 和前端在同一进程,端口 <%= port %>
74
74
 
75
- - **生产模式** (`coze start`):
76
- - `coze build` 构建前端 → `dist/` 目录
77
- - `coze build` 构建后端 → `dist-server/index.js` (CommonJS 格式)
75
+ - **生产模式** (`coze-dev start`):
76
+ - `coze-dev build` 构建前端 → `dist/` 目录
77
+ - `coze-dev build` 构建后端 → `dist-server/index.js` (CommonJS 格式)
78
78
  - 运行 `dist-server/index.js` 启动生产服务器
79
79
  - Express 服务静态文件 + API 路由
80
80
  - 单一 Node.js 进程,轻量高效
@@ -386,7 +386,7 @@ console.log(apiUrl); // https://api.example.com
386
386
  2. **使用 TypeScript** 进行类型安全开发,避免使用 `any`
387
387
  3. **使用 Tailwind CSS** 进行样式开发,支持响应式和暗色模式
388
388
  4. **环境变量必须以 `VITE_` 开头** 才能在客户端代码中访问
389
- 5. **开发时使用 `coze dev`**,支持热更新和快速刷新
389
+ 5. **开发时使用 `coze-dev dev`**,支持热更新和快速刷新
390
390
  6. **API 路由以 `/api` 开头**,避免与前端路由冲突
391
391
  7. **单进程架构**:开发和生产环境都是前后端在同一进程中运行
392
392
 
@@ -412,7 +412,7 @@ const pool = new Pool({ connectionString: process.env.DATABASE_URL });
412
412
 
413
413
  **Q: 如何部署?**
414
414
 
415
- 1. 运行 `coze build` 构建前后端
415
+ 1. 运行 `coze-dev build` 构建前后端
416
416
  2. 将整个项目上传到服务器
417
417
  3. 运行 `pnpm install --prod`
418
- 4. 运行 `coze start` 启动服务
418
+ 4. 运行 `coze-dev start` 启动服务
@@ -7,6 +7,6 @@ cd "${COZE_WORKSPACE_PATH}"
7
7
 
8
8
  echo "Installing dependencies..."
9
9
  pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
10
- if command -v coze > /dev/null 2>&1 && coze check-bins --help > /dev/null 2>&1; then
11
- coze check-bins --fix
10
+ if command -v coze-dev > /dev/null 2>&1 && coze-dev check-bins --help > /dev/null 2>&1; then
11
+ coze-dev check-bins --fix
12
12
  fi
@@ -40,7 +40,7 @@ export const paramsSchema = {
40
40
  additionalProperties: false,
41
41
  };
42
42
 
43
- const description = `Vite(简单项目):\`coze init \${COZE_WORKSPACE_PATH} --template vite\`
43
+ const description = `Vite(简单项目):\`coze-dev init \${COZE_WORKSPACE_PATH} --template vite\`
44
44
  - 适用:轻量级 SPA、纯前端交互、仪表盘等轻量级项目。`;
45
45
 
46
46
  const config = {
package/lib/cli.js CHANGED
@@ -125,10 +125,10 @@ const generateTemplatesHelpText = () => {
125
125
  lines.push(`\n ${'='.repeat(76)}`);
126
126
  lines.push('\n Usage:');
127
127
  lines.push(
128
- ' coze init <directory> -t <template-name> [--param value ...]',
128
+ ' coze-dev init <directory> -t <template-name> [--param value ...]',
129
129
  );
130
130
  lines.push('\n Example:');
131
- lines.push(' coze init my-app -t nextjs --appName my-app --port 3000');
131
+ lines.push(' coze-dev init my-app -t nextjs --appName my-app --port 3000');
132
132
  lines.push('');
133
133
 
134
134
  return lines.join('\n');
@@ -2107,14 +2107,14 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@coze-arch/cli";
2110
- var version = "0.0.32";
2110
+ var version = "0.0.34-alpha.da5090";
2111
2111
  var description = "coze coding devtools cli";
2112
2112
  var license = "MIT";
2113
2113
  var author = "fanwenjie.fe@bytedance.com";
2114
2114
  var maintainers = [
2115
2115
  ];
2116
2116
  var bin = {
2117
- coze: "bin/main"
2117
+ "coze-dev": "bin/main"
2118
2118
  };
2119
2119
  var files = [
2120
2120
  "lib",
@@ -2154,7 +2154,7 @@ var dependencies = {
2154
2154
  ejs: "^3.1.10",
2155
2155
  "fast-glob": "^3.3.3",
2156
2156
  "js-yaml": "^4.2.0",
2157
- minimist: "^1.2.5",
2157
+ minimist: "^1.2.8",
2158
2158
  shelljs: "^0.10.0"
2159
2159
  };
2160
2160
  var devDependencies = {
@@ -2170,7 +2170,7 @@ var devDependencies = {
2170
2170
  "@emnapi/runtime": "^1.11.1",
2171
2171
  "@inquirer/prompts": "^3.2.0",
2172
2172
  "@rollup/plugin-commonjs": "^28.0.2",
2173
- "@rollup/plugin-json": "~6.0.0",
2173
+ "@rollup/plugin-json": "~6.1.0",
2174
2174
  "@rollup/plugin-node-resolve": "^15.3.0",
2175
2175
  "@rollup/plugin-sucrase": "^5.1.0",
2176
2176
  "@types/debug": "^4.1.13",
@@ -2183,11 +2183,11 @@ var devDependencies = {
2183
2183
  "@vitest/coverage-v8": "~4.1.10",
2184
2184
  knip: "^5.30.1",
2185
2185
  minimatch: "^10.2.5",
2186
- playwright: "~1.60.0",
2186
+ playwright: "~1.61.1",
2187
2187
  rollup: "^4.60.1",
2188
2188
  sucrase: "^3.35.1",
2189
2189
  "tree-kill": "^1.2.2",
2190
- tsx: "^4.22.4",
2190
+ tsx: "^4.23.11",
2191
2191
  vitest: "~4.1.10"
2192
2192
  };
2193
2193
  var publishConfig = {
@@ -2196,7 +2196,7 @@ var publishConfig = {
2196
2196
  };
2197
2197
  var cozePublishConfig = {
2198
2198
  bin: {
2199
- coze: "bin/main"
2199
+ "coze-dev": "bin/main"
2200
2200
  }
2201
2201
  };
2202
2202
  var packageJson = {
@@ -2431,7 +2431,12 @@ class Logger {
2431
2431
 
2432
2432
  const envLevel = _optionalChain$q([process, 'access', _ => _.env, 'access', _2 => _2.LOG_LEVEL, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]);
2433
2433
  if (envLevel && envLevel in LOG_LEVEL_MAP) {
2434
- return LOG_LEVEL_MAP[envLevel];
2434
+ // envLevel 已通过 `in` 检查确认为 LOG_LEVEL_MAP 的键;
2435
+ // 显式判空以满足 noUncheckedIndexedAccess,运行时行为不变
2436
+ const mappedLevel = LOG_LEVEL_MAP[envLevel];
2437
+ if (mappedLevel !== undefined) {
2438
+ return mappedLevel;
2439
+ }
2435
2440
  }
2436
2441
 
2437
2442
  return LogLevel.INFO;
@@ -2797,7 +2802,7 @@ const executeWarmup = async (options) => {
2797
2802
  }
2798
2803
 
2799
2804
  logger.success('\n✅ All templates warmed up successfully!');
2800
- logger.info('\nNext time you run `coze init`, it will be much faster as node_modules are pre-installed.');
2805
+ logger.info('\nNext time you run `coze-dev init`, it will be much faster as node_modules are pre-installed.');
2801
2806
 
2802
2807
  timer.logTotal();
2803
2808
  } catch (error) {
@@ -3249,8 +3254,7 @@ const registerCommand$5 = program => {
3249
3254
  });
3250
3255
  };
3251
3256
 
3252
- function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* eslint-disable @typescript-eslint/no-explicit-any */
3253
- // Safe JSON parsing utilities with type safety and error handling
3257
+ function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// Safe JSON parsing utilities with type safety and error handling
3254
3258
  // Provides fallback values, validation, and error monitoring capabilities
3255
3259
 
3256
3260
  /**
@@ -3286,6 +3290,7 @@ function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[
3286
3290
 
3287
3291
 
3288
3292
 
3293
+
3289
3294
 
3290
3295
 
3291
3296
  /**
@@ -8021,7 +8026,12 @@ const extractParams$1 = (routePath) => {
8021
8026
  patterns.forEach(pattern => {
8022
8027
  const matches = routePath.matchAll(pattern);
8023
8028
  for (const match of matches) {
8024
- params.push(match[1]);
8029
+ // 每个 pattern 都含单一捕获组 (\w+),匹配成功时 match[1] 必然存在;
8030
+ // 显式判空以满足 noUncheckedIndexedAccess,不改变原有运行时行为
8031
+ const param = match[1];
8032
+ if (param !== undefined) {
8033
+ params.push(param);
8034
+ }
8025
8035
  }
8026
8036
  });
8027
8037
 
@@ -8232,7 +8242,12 @@ const extractParams = (routePath) => {
8232
8242
  patterns.forEach(pattern => {
8233
8243
  const matches = routePath.matchAll(pattern);
8234
8244
  for (const match of matches) {
8235
- paramsSet.add(match[1]);
8245
+ // 每个 pattern 都含单一捕获组 (\w+),匹配成功时 match[1] 必然存在;
8246
+ // 显式判空以满足 noUncheckedIndexedAccess,不改变原有运行时行为
8247
+ const param = match[1];
8248
+ if (param !== undefined) {
8249
+ paramsSet.add(param);
8250
+ }
8236
8251
  }
8237
8252
  });
8238
8253
 
@@ -8669,7 +8684,7 @@ const detectAndValidateTemplate = (cwd) => {
8669
8684
 
8670
8685
  /**
8671
8686
  * Scan routes once without starting polling
8672
- * Used by the standalone `coze routes` command
8687
+ * Used by the standalone `coze-dev routes` command
8673
8688
  *
8674
8689
  * @param cwd - Current working directory
8675
8690
  * @param options - Scanning options (output path, etc.)
@@ -9946,12 +9961,14 @@ const commitChanges = (projectPath) => {
9946
9961
  const runDev = (projectPath) => {
9947
9962
  // 获取当前 CLI 的可执行文件路径
9948
9963
  // process.argv[0] 是 node,process.argv[1] 是 CLI 入口文件
9949
- const cliPath = process.argv[1];
9964
+ // 二者在 CLI 运行时必然存在,兜底空串仅为满足类型收窄,运行时不会命中
9965
+ const nodeBin = _nullishCoalesce(process.argv[0], () => ( ''));
9966
+ const cliPath = _nullishCoalesce(process.argv[1], () => ( ''));
9950
9967
 
9951
9968
  try {
9952
9969
  // 使用通用的后台执行函数启动开发服务器
9953
9970
  // 调用 CLI 自己的 dev 命令
9954
- const pid = spawnDetached(process.argv[0], [cliPath, 'dev'], {
9971
+ const pid = spawnDetached(nodeBin, [cliPath, 'dev'], {
9955
9972
  cwd: projectPath,
9956
9973
  verbose: false, // 不输出额外的进程信息,由 logger 统一处理
9957
9974
  });
@@ -10178,7 +10195,7 @@ const startDevServerStep = ctx => {
10178
10195
  if (skipCommit) {
10179
10196
  logger.info(' git add --all && git commit -m "chore: init env"');
10180
10197
  }
10181
- logger.info(' coze dev');
10198
+ logger.info(' coze-dev dev');
10182
10199
  }
10183
10200
  };
10184
10201
 
@@ -10338,7 +10355,7 @@ const main = async () => {
10338
10355
  const program = new commander.Command();
10339
10356
 
10340
10357
  program
10341
- .name('coze')
10358
+ .name('coze-dev')
10342
10359
  .description(
10343
10360
  'Coze Coding CLI - Project template engine for frontend stacks',
10344
10361
  )
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.32",
3
+ "version": "0.0.34-alpha.da5090",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",
7
7
  "author": "fanwenjie.fe@bytedance.com",
8
8
  "maintainers": [],
9
9
  "bin": {
10
- "coze": "bin/main"
10
+ "coze-dev": "bin/main"
11
11
  },
12
12
  "files": [
13
13
  "lib",
@@ -47,7 +47,7 @@
47
47
  "ejs": "^3.1.10",
48
48
  "fast-glob": "^3.3.3",
49
49
  "js-yaml": "^4.2.0",
50
- "minimist": "^1.2.5",
50
+ "minimist": "^1.2.8",
51
51
  "shelljs": "^0.10.0"
52
52
  },
53
53
  "devDependencies": {
@@ -63,7 +63,7 @@
63
63
  "@emnapi/runtime": "^1.11.1",
64
64
  "@inquirer/prompts": "^3.2.0",
65
65
  "@rollup/plugin-commonjs": "^28.0.2",
66
- "@rollup/plugin-json": "~6.0.0",
66
+ "@rollup/plugin-json": "~6.1.0",
67
67
  "@rollup/plugin-node-resolve": "^15.3.0",
68
68
  "@rollup/plugin-sucrase": "^5.1.0",
69
69
  "@types/debug": "^4.1.13",
@@ -76,11 +76,11 @@
76
76
  "@vitest/coverage-v8": "~4.1.10",
77
77
  "knip": "^5.30.1",
78
78
  "minimatch": "^10.2.5",
79
- "playwright": "~1.60.0",
79
+ "playwright": "~1.61.1",
80
80
  "rollup": "^4.60.1",
81
81
  "sucrase": "^3.35.1",
82
82
  "tree-kill": "^1.2.2",
83
- "tsx": "^4.22.4",
83
+ "tsx": "^4.23.11",
84
84
  "vitest": "~4.1.10"
85
85
  },
86
86
  "publishConfig": {
@@ -89,7 +89,7 @@
89
89
  },
90
90
  "cozePublishConfig": {
91
91
  "bin": {
92
- "coze": "bin/main"
92
+ "coze-dev": "bin/main"
93
93
  }
94
94
  }
95
95
  }