@coze-arch/cli 0.0.33-alpha.eeae5b → 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,13 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@coze-arch/cli";
2110
- var version = "0.0.33-alpha.eeae5b";
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",
2118
2117
  "coze-dev": "bin/main"
2119
2118
  };
2120
2119
  var files = [
@@ -2197,7 +2196,6 @@ var publishConfig = {
2197
2196
  };
2198
2197
  var cozePublishConfig = {
2199
2198
  bin: {
2200
- coze: "bin/main",
2201
2199
  "coze-dev": "bin/main"
2202
2200
  }
2203
2201
  };
@@ -2804,7 +2802,7 @@ const executeWarmup = async (options) => {
2804
2802
  }
2805
2803
 
2806
2804
  logger.success('\n✅ All templates warmed up successfully!');
2807
- 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.');
2808
2806
 
2809
2807
  timer.logTotal();
2810
2808
  } catch (error) {
@@ -8686,7 +8684,7 @@ const detectAndValidateTemplate = (cwd) => {
8686
8684
 
8687
8685
  /**
8688
8686
  * Scan routes once without starting polling
8689
- * Used by the standalone `coze routes` command
8687
+ * Used by the standalone `coze-dev routes` command
8690
8688
  *
8691
8689
  * @param cwd - Current working directory
8692
8690
  * @param options - Scanning options (output path, etc.)
@@ -10197,7 +10195,7 @@ const startDevServerStep = ctx => {
10197
10195
  if (skipCommit) {
10198
10196
  logger.info(' git add --all && git commit -m "chore: init env"');
10199
10197
  }
10200
- logger.info(' coze dev');
10198
+ logger.info(' coze-dev dev');
10201
10199
  }
10202
10200
  };
10203
10201
 
@@ -10357,7 +10355,7 @@ const main = async () => {
10357
10355
  const program = new commander.Command();
10358
10356
 
10359
10357
  program
10360
- .name('coze')
10358
+ .name('coze-dev')
10361
10359
  .description(
10362
10360
  'Coze Coding CLI - Project template engine for frontend stacks',
10363
10361
  )
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.33-alpha.eeae5b",
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",
11
10
  "coze-dev": "bin/main"
12
11
  },
13
12
  "files": [
@@ -90,7 +89,6 @@
90
89
  },
91
90
  "cozePublishConfig": {
92
91
  "bin": {
93
- "coze": "bin/main",
94
92
  "coze-dev": "bin/main"
95
93
  }
96
94
  }