@coze/cli 0.1.0-alpha.5276dd → 0.1.0-alpha.b50527

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -23,7 +23,7 @@ coze space list
23
23
  coze space use <space_id>
24
24
 
25
25
  # 4. Start using Coze Coding
26
- coze code project create -m "Build an intelligent assistant" --type web
26
+ coze code project create --message "Build an intelligent assistant" --type web
27
27
  ```
28
28
 
29
29
  ## Authentication
@@ -32,10 +32,7 @@ Before using most commands, you need to authenticate with Coze.
32
32
 
33
33
  ```bash
34
34
  # Interactive login via browser (recommended)
35
- coze auth login --oauth
36
-
37
- # Non-interactive login with Personal Access Token (for CI/CD)
38
- coze auth login --token <YOUR_PAT>
35
+ coze auth login
39
36
 
40
37
  # Check current login status
41
38
  coze auth status
@@ -47,32 +44,25 @@ coze auth status --format json
47
44
  coze auth logout
48
45
  ```
49
46
 
50
- You can also authenticate via environment variables for CI/CD pipelines:
51
-
52
- ```bash
53
- export COZE_API_TOKEN=<YOUR_PAT>
54
- ```
55
-
56
47
  ## Commands
57
48
 
58
49
  ### `coze auth` — Authentication
59
50
 
60
- Manage the full authentication lifecycle. Supports interactive OAuth login via browser and non-interactive login via Personal Access Token (PAT) for CI/CD pipelines.
51
+ Manage the full authentication lifecycle. Supports interactive OAuth login via browser.
61
52
 
62
- | Command | Description |
63
- |---|---|
64
- | `coze auth login --oauth` | Interactive login via browser |
65
- | `coze auth login --token <PAT>` | Login with a Personal Access Token |
53
+ | Command | Description |
54
+ | ------------------ | -------------------------------------------------- |
55
+ | `coze auth login` | Interactive login via browser |
66
56
  | `coze auth status` | Check current login status and credential validity |
67
- | `coze auth logout` | Logout and clear stored credentials |
57
+ | `coze auth logout` | Logout and clear stored credentials |
68
58
 
69
59
  ### `coze organization` — Organization Management
70
60
 
71
61
  View and switch organizations to set the default Organization ID for subsequent commands.
72
62
 
73
- | Command | Description |
74
- |---|---|
75
- | `coze organization list` | List all accessible organizations and their enterprises |
63
+ | Command | Description |
64
+ | -------------------------------- | ------------------------------------------------------- |
65
+ | `coze organization list` | List all accessible organizations and their enterprises |
76
66
  | `coze organization use <org_id>` | Set the default organization (auto-saves Enterprise ID) |
77
67
 
78
68
  Alias: `coze org`
@@ -81,10 +71,10 @@ Alias: `coze org`
81
71
 
82
72
  View and switch workspaces to set the default Space ID for subsequent commands.
83
73
 
84
- | Command | Description |
85
- |---|---|
86
- | `coze space list` | List all spaces under the current organization |
87
- | `coze space use <space_id>` | Set the default workspace |
74
+ | Command | Description |
75
+ | --------------------------- | ---------------------------------------------- |
76
+ | `coze space list` | List all spaces under the current organization |
77
+ | `coze space use <space_id>` | Set the default workspace |
88
78
 
89
79
  ### `coze code` — Coze Coding
90
80
 
@@ -92,61 +82,62 @@ View and switch workspaces to set the default Space ID for subsequent commands.
92
82
 
93
83
  Manage Coze Coding projects. Supports creating, viewing, listing, and deleting projects across various types.
94
84
 
95
- | Command | Description |
96
- |---|---|
97
- | `coze code project create` | Create a new project from natural language description |
98
- | `coze code project list` | List all projects in the current space |
99
- | `coze code project get <projectId>` | Get project details |
100
- | `coze code project delete <projectId>` | Delete a project (irreversible) |
85
+ | Command | Description |
86
+ | -------------------------------------- | ------------------------------------------------------ |
87
+ | `coze code project create` | Create a new project from natural language description |
88
+ | `coze code project list` | List all projects in the current space |
89
+ | `coze code project get <projectId>` | Get project details |
90
+ | `coze code project delete <projectId>` | Delete a project (irreversible) |
101
91
 
102
92
  Alias: `coze code proj`
103
93
 
104
94
  ```bash
105
95
  # Create a Web project
106
- coze code project create -m "Create a chatbot" --type web
96
+ coze code project create --message "Create a chatbot" --type web
107
97
 
108
98
  # Create and wait for the initial build to complete
109
- coze code project create -m "Create a data dashboard" --type app --wait
99
+ coze code project create --message "Create a data dashboard" --type app --wait
110
100
 
111
101
  # List projects with filters
112
102
  coze code project list --type agent --type workflow
113
103
  coze code project list --name "customer service"
114
- coze code project list --size 20 --has-published true
104
+ coze code project list --size 20 --has-published
115
105
  ```
116
106
 
117
- **`project create` options:**
118
-
119
- | Option | Description |
120
- |---|---|
121
- | `-m, --message <message>` | **(required)** Project description in natural language |
122
- | `--type <type>` | **(required)** Project type: `web` \| `app` |
123
- | `--wait` | Wait for project creation to complete |
124
- | `--org-id <orgId>` | Organization ID (reads from context if omitted) |
125
- | `--space-id <spaceId>` | Space ID (reads from context if omitted) |
126
-
127
- **`project list` options:**
128
-
129
- | Option | Description |
130
- |---|---|
131
- | `--size <size>` | Number of projects to return (default: 10) |
132
- | `--cursor-id <cursorId>` | Cursor for pagination |
133
- | `--type <type>` | Filter by type (can pass multiple times): `agent` \| `workflow` \| `webapp` \| `app` \| `web` \| `miniprogram` \| `assistant` |
134
- | `--name <name>` | Filter by project name |
135
- | `--has-published <bool>` | Filter by publish status |
136
- | `--search-scope <n>` | Created by (0=All, 1=CreatedByMe, 2=AllWithCollaborator) |
137
- | `--folder-id <id>` | Filter by folder |
138
- | `--order-type <n>` | Sort type (0=descending, 1=ascending) |
139
- | `--is-fav-filter <bool>` | Filter favorites only |
107
+ **`project create`** **options:**
108
+
109
+ | Option | Description |
110
+ | ---------------------- | ------------------------------------------------------ |
111
+ | `--message <message>` | **(required)** Project description in natural language |
112
+ | `--type <type>` | **(required)** Project type: `web` \| `app` |
113
+ | `--wait` | Wait for project creation to complete |
114
+ | `--org-id <orgId>` | Organization ID (reads from context if omitted) |
115
+ | `--space-id <spaceId>` | Space ID (reads from context if omitted) |
116
+
117
+ **`project list`** **options:**
118
+
119
+ | Option | Description |
120
+ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
121
+ | `--size <size>` | Number of projects to return (default: 10) |
122
+ | `--cursor-id <cursorId>` | Cursor for pagination |
123
+ | `--type <type>` | Filter by type (can pass multiple times): `agent` \| `workflow` \| `webapp` \| `app` \| `web` \| `miniprogram` \| `assistant` |
124
+ | `--name <name>` | Filter by project name |
125
+ | `--has-published` | Filter by publish status |
126
+ | `--search-scope <n>` | Created by (0=All, 1=CreatedByMe, 2=AllWithCollaborator) |
127
+ | `--folder-id <id>` | Filter by folder |
128
+ | `--order-type <n>` | Sort type (0=descending, 1=ascending) |
129
+ | `--order-by <n>` | Order by (0=updated\_at, 1=created\_at) |
130
+ | `--is-fav-filter` | Filter favorites only |
140
131
 
141
132
  #### Message
142
133
 
143
134
  Send and manage chat messages in Coze Coding projects. The project ID is specified on the `message` parent command and shared by all subcommands.
144
135
 
145
- | Command | Description |
146
- |---|---|
147
- | `coze code message send [message]` | Send a prompt message to a project chat |
148
- | `coze code message status` | Query message status and get result when completed |
149
- | `coze code message cancel` | Cancel an ongoing message |
136
+ | Command | Description |
137
+ | ---------------------------------- | -------------------------------------------------- |
138
+ | `coze code message send [message]` | Send a prompt message to a project chat |
139
+ | `coze code message status` | Query message status and get result when completed |
140
+ | `coze code message cancel` | Cancel an ongoing message |
150
141
 
151
142
  ```bash
152
143
  # Send a message to a project
@@ -172,21 +163,22 @@ export COZE_PROJECT_ID=123456
172
163
  coze code message send "Hello"
173
164
  ```
174
165
 
175
- **`message` options (shared by all subcommands):**
166
+ **`message`** **options (shared by all subcommands):**
176
167
 
177
- | Option | Description |
178
- |---|---|
168
+ | Option | Description |
169
+ | ----------------------- | ------------------------------------------ |
179
170
  | `-p, --project-id <id>` | Coze project ID (or env `COZE_PROJECT_ID`) |
180
171
 
181
172
  #### Deploy
182
173
 
183
174
  Deploy projects to the production environment. Supports multiple project types including Agent, Workflow, Skill, Web, Mini-program, etc.
184
175
 
185
- | Command | Description |
186
- |---|---|
187
- | `coze code deploy <projectId>` | Deploy a project to production |
188
- | `coze code deploy <projectId> --wait` | Deploy and wait for completion |
189
- | `coze code deploy status <projectId>` | Check deployment status |
176
+ | Command | Description |
177
+ | -------------------------------------------- | ----------------------------------------- |
178
+ | `coze code deploy <projectId>` | Deploy a project to production |
179
+ | `coze code deploy <projectId> --wait` | Deploy and wait for completion |
180
+ | `coze code deploy status <projectId>` | Check deployment status |
181
+ | `coze code deploy status <projectId> --wait` | Check and wait for deployment to complete |
190
182
 
191
183
  ```bash
192
184
  # Deploy a project
@@ -200,17 +192,20 @@ coze code deploy status <projectId>
200
192
 
201
193
  # Check a specific deployment record
202
194
  coze code deploy status <projectId> --deploy-id <deployHistoryId>
195
+
196
+ # Check and wait for deployment to complete
197
+ coze code deploy status <projectId> --wait
203
198
  ```
204
199
 
205
200
  #### Environment Variables
206
201
 
207
202
  Manage project environment variables (Secrets). Supports development and production environments.
208
203
 
209
- | Command | Description |
210
- |---|---|
211
- | `coze code env list -p <projectId>` | List environment variables |
212
- | `coze code env set <key> <value> -p <projectId>` | Set an environment variable |
213
- | `coze code env delete <key> -p <projectId>` | Delete an environment variable |
204
+ | Command | Description |
205
+ | ------------------------------------------------ | ------------------------------ |
206
+ | `coze code env list -p <projectId>` | List environment variables |
207
+ | `coze code env set <key> <value> -p <projectId>` | Set an environment variable |
208
+ | `coze code env delete <key> -p <projectId>` | Delete an environment variable |
214
209
 
215
210
  ```bash
216
211
  # List dev environment variables (default)
@@ -230,28 +225,28 @@ coze code env delete API_KEY -p <projectId>
230
225
 
231
226
  Manage custom domains for deployed projects.
232
227
 
233
- | Command | Description |
234
- |---|---|
235
- | `coze code domain list <projectId>` | List all custom domains bound to the project |
236
- | `coze code domain add <domain> -p <projectId>` | Add a custom domain |
237
- | `coze code domain remove <domain> -p <projectId>` | Remove a custom domain |
228
+ | Command | Description |
229
+ | ------------------------------------------------- | -------------------------------------------- |
230
+ | `coze code domain list <projectId>` | List all custom domains bound to the project |
231
+ | `coze code domain add <domain> -p <projectId>` | Add a custom domain |
232
+ | `coze code domain remove <domain> -p <projectId>` | Remove a custom domain |
238
233
 
239
234
  #### Skill
240
235
 
241
236
  Manage skills associated with a project to extend its capabilities.
242
237
 
243
- | Command | Description |
244
- |---|---|
245
- | `coze code skill list <projectId>` | List all skills (shows installed status) |
246
- | `coze code skill add <skillId> -p <projectId>` | Add a skill to the project |
247
- | `coze code skill remove <skillId> -p <projectId>` | Remove a skill from the project |
238
+ | Command | Description |
239
+ | ------------------------------------------------- | ---------------------------------------- |
240
+ | `coze code skill list -p <projectId>` | List all skills (shows installed status) |
241
+ | `coze code skill add <skillId> -p <projectId>` | Add a skill to the project |
242
+ | `coze code skill remove <skillId> -p <projectId>` | Remove a skill from the project |
248
243
 
249
244
  #### Preview
250
245
 
251
246
  Get the sandbox preview URL for a project.
252
247
 
253
- | Command | Description |
254
- |---|---|
248
+ | Command | Description |
249
+ | ------------------------------- | --------------------------- |
255
250
  | `coze code preview <projectId>` | Get the project preview URL |
256
251
 
257
252
  ```bash
@@ -285,18 +280,18 @@ coze generate image "Similar style" --image https://example.com/ref.png
285
280
  coze generate image "A storyboard" --sequential auto --max-images 5
286
281
  ```
287
282
 
288
- **`generate image` options:**
283
+ **`generate image`** **options:**
289
284
 
290
- | Option | Default | Description |
291
- |---|---|---|
292
- | `--size <size>` | `2K` | Image size: `2K` \| `4K` \| `WIDTHxHEIGHT` |
293
- | `--no-watermark` | enabled | Disable watermark |
294
- | `--image <url>` | — | Reference image URL (repeatable) |
295
- | `--response-format <fmt>` | `url` | Response format: `url` \| `b64_json` |
296
- | `--optimize-prompt-mode <mode>` | `standard` | Prompt optimization mode |
297
- | `--sequential <mode>` | `disabled` | Group image generation: `auto` \| `disabled` |
298
- | `--max-images <n>` | `15` | Maximum group images (1–15) |
299
- | `--output-path <path>` | — | Directory to save generated images |
285
+ | Option | Default | Description |
286
+ | ------------------------------- | ---------- | -------------------------------------------- |
287
+ | `--size <size>` | `2K` | Image size: `2K` \| `4K` \| `WIDTHxHEIGHT` |
288
+ | `--no-watermark` | enabled | Disable watermark |
289
+ | `--image <url>` | — | Reference image URL (repeatable) |
290
+ | `--response-format <fmt>` | `url` | Response format: `url` \| `b64_json` |
291
+ | `--optimize-prompt-mode <mode>` | `standard` | Prompt optimization mode |
292
+ | `--sequential <mode>` | `disabled` | Group image generation: `auto` \| `disabled` |
293
+ | `--max-images <n>` | `15` | Maximum group images (1–15) |
294
+ | `--output-path <path>` | — | Directory to save generated images |
300
295
 
301
296
  #### Audio Generation (TTS)
302
297
 
@@ -310,47 +305,52 @@ coze generate audio "Hello" --output-path ./audio.mp3
310
305
  # Use SSML input
311
306
  echo "<speak>Hello</speak>" | coze generate audio --ssml
312
307
 
313
- # Custom speaker and format
314
- coze generate audio "Hello" --speaker zh_female_xiaohe_uranus_bigtts --format ogg_opus
308
+ # Custom speaker and audio encoding
309
+ coze generate audio "Hello" --speaker zh_female_xiaohe_uranus_bigtts --audio-format ogg_opus
315
310
  ```
316
311
 
317
- **`generate audio` options:**
312
+ **`generate audio`** **options:**
318
313
 
319
- | Option | Default | Description |
320
- |---|---|---|
321
- | `--speaker <speaker>` | `zh_female_xiaohe_uranus_bigtts` | Voice speaker |
322
- | `--format <fmt>` | `mp3` | Audio format: `pcm` \| `mp3` \| `ogg_opus` |
323
- | `--sample-rate <n>` | `24000` | Sample rate |
324
- | `--speech-rate <n>` | `0` | Speech rate (-50 to 100) |
325
- | `--loudness-rate <n>` | `0` | Loudness (-50 to 100) |
326
- | `--ssml` | `false` | Treat input as SSML instead of plain text |
327
- | `--output-path <path>` | | Directory to save generated audio |
314
+ | Option | Default | Description |
315
+ | ---------------------- | -------------------------------- | -------------------------------------------- |
316
+ | `--speaker <speaker>` | `zh_female_xiaohe_uranus_bigtts` | Voice speaker |
317
+ | `--audio-format <fmt>` | `mp3` | Audio encoding: `pcm` \| `mp3` \| `ogg_opus` |
318
+ | `--sample-rate <n>` | `24000` | Sample rate |
319
+ | `--speech-rate <n>` | `0` | Speech rate (-50 to 100) |
320
+ | `--loudness-rate <n>` | `0` | Loudness (-50 to 100) |
321
+ | `--ssml` | `false` | Treat input as SSML instead of plain text |
322
+ | `--uid <uid>` | `cli_user` | User UID |
323
+ | `--output-path <path>` | — | Directory to save generated audio |
328
324
 
329
325
  #### Video Generation
330
326
 
331
327
  ```bash
332
- # Generate a video (waits for completion by default)
333
- coze generate video "A cat playing piano"
328
+ # Create a video generation task
329
+ coze generate video create "A cat playing piano"
334
330
 
335
- # Save to a specific path
336
- coze generate video "A dancing kitten" --output-path ./video.mp4
331
+ # Create a task and wait for completion
332
+ coze generate video create "A dancing kitten" --wait
337
333
 
338
- # Create task only, don't wait for completion
339
- coze generate video "A dancing kitten" --no-wait
334
+ # Save to a specific path
335
+ coze generate video create "A dancing kitten" --wait --output-path ./video.mp4
340
336
 
341
337
  # Custom resolution and aspect ratio
342
- coze generate video "A landscape" --resolution 1080p --ratio 16:9
338
+ coze generate video create "A landscape" --resolution 1080p --ratio 16:9
343
339
 
344
- # Use reference images
345
- coze generate video "Animate this" --first-frame https://example.com/frame.png
346
- coze generate video "In this style" --reference-image https://example.com/ref.png
340
+ # Use first frame / last frame
341
+ coze generate video create "Animate this" --first-frame https://example.com/frame.png
342
+
343
+ # Query task status later
344
+ coze generate video status task_123
347
345
  ```
348
346
 
349
- **`generate video` options:**
347
+ Use `coze generate video create` to submit generation tasks, and `coze generate video status <taskId>` to query existing tasks.
348
+
349
+ **`generate video create`** **options:**
350
350
 
351
351
  | Option | Default | Description |
352
352
  |---|---|---|
353
- | `--model <model>` | `doubao-seedance-1-5-pro-251215` | Video generation model |
353
+ | `--callback-url <url>` | | Callback URL for task status changes |
354
354
  | `--resolution <res>` | `720p` | Resolution: `480p` \| `720p` \| `1080p` |
355
355
  | `--ratio <ratio>` | `16:9` | Aspect ratio (e.g., `16:9`, `9:16`, `1:1`) |
356
356
  | `--size <size>` | — | Derive ratio/resolution from `WIDTHxHEIGHT` |
@@ -361,19 +361,22 @@ coze generate video "In this style" --reference-image https://example.com/ref.pn
361
361
  | `--no-generate-audio` | generates audio | Do not generate accompanying audio |
362
362
  | `--first-frame <url>` | — | First frame image URL |
363
363
  | `--last-frame <url>` | — | Last frame image URL |
364
- | `--reference-image <url>` | — | Reference image URL (repeatable) |
365
364
  | `--return-last-frame` | `false` | Return last frame URL in output |
366
- | `--no-wait` | waits | Only create task, don't poll for completion |
367
- | `--poll-interval <ms>` | `2000` | Polling interval in milliseconds |
368
- | `--poll-timeout <ms>` | `300000` | Polling timeout in milliseconds (5 min) |
365
+ | `--wait` | `false` | Poll until completion instead of returning `taskId` immediately |
369
366
  | `--output-path <path>` | — | Directory to save generated video |
370
367
 
368
+ **`generate video status`** **options:**
369
+
370
+ | Option | Default | Description |
371
+ | ------------------- | ------- | ------------------------------- |
372
+ | `--output <format>` | `text` | Output format: `text` \| `json` |
373
+
371
374
  ### `coze file` — File Operations
372
375
 
373
376
  Upload local files to Coze for use as attachments or context in projects.
374
377
 
375
- | Command | Description |
376
- |---|---|
378
+ | Command | Description |
379
+ | ------------------------- | ------------------- |
377
380
  | `coze file upload <path>` | Upload a local file |
378
381
 
379
382
  ```bash
@@ -385,12 +388,12 @@ coze file upload ./document.pdf
385
388
 
386
389
  Manage CLI configuration stored in `~/.coze/config.json` (global) and `.cozerc.json` (project-level).
387
390
 
388
- | Command | Description |
389
- |---|---|
390
- | `coze config list` | List all configuration items with sources |
391
- | `coze config get <keys...>` | Get one or more configuration values |
392
- | `coze config set <key> <value>` | Set a configuration value |
393
- | `coze config delete <keys...>` | Delete one or more configuration items |
391
+ | Command | Description |
392
+ | ------------------------------- | ----------------------------------------- |
393
+ | `coze config list` | List all configuration items with sources |
394
+ | `coze config get <keys...>` | Get one or more configuration values |
395
+ | `coze config set <key> <value>` | Set a configuration value |
396
+ | `coze config delete <keys...>` | Delete one or more configuration items |
394
397
 
395
398
  ```bash
396
399
  # List all configurations with their sources (env, local, global, default)
@@ -412,7 +415,7 @@ coze config delete spaceId apiBaseUrl
412
415
 
413
416
  ### `coze completion` — Shell Autocompletion
414
417
 
415
- Set up or remove shell autocompletion for bash/zsh.
418
+ Set up or remove shell autocompletion (supports bash/zsh/fish/powershell).
416
419
 
417
420
  ```bash
418
421
  # Install shell completion script
@@ -422,82 +425,87 @@ coze completion --setup
422
425
  coze completion --cleanup
423
426
  ```
424
427
 
428
+ ### `coze upgrade` — CLI Upgrade
429
+
430
+ Upgrade Coze CLI to the latest version. Detects the package manager used for the original installation (npm/pnpm/yarn) and runs the appropriate global install command.
431
+
432
+ ```bash
433
+ # Upgrade to latest version
434
+ coze upgrade
435
+
436
+ # Force check and upgrade
437
+ coze upgrade --force
438
+
439
+ # Upgrade to a specific tag
440
+ coze upgrade --tag beta
441
+ ```
442
+
443
+ | Option | Description |
444
+ | ------------- | ------------------------------------------------------ |
445
+ | `--force` | Force upgrade even if already on the latest version |
446
+ | `--tag <tag>` | Specify the dist-tag to upgrade to (default: `latest`) |
447
+
425
448
  ## Global Options
426
449
 
427
- | Option | Description |
428
- |---|---|
429
- | `-h, --help` | Show help |
430
- | `-v, --version` | Show version |
431
- | `--format <fmt>` | Output format: `json` or `text` (default: `json`) |
432
- | `--no-color` | Disable ANSI color output |
433
- | `--config <path>` | Use a custom configuration file |
434
- | `--org-id <id>` | Override the default Organization ID |
435
- | `--space-id <id>` | Override the default Space ID |
436
- | `--verbose` | Enable verbose mode with detailed process information |
437
- | `--debug` | Enable debug mode with all log output for diagnosing issues |
438
- | `--log-file <path>` | Write logs to a file |
439
- | `--man` | Show full manual information |
440
- | `--schema` | Output the command's JSON Schema |
441
- | `--commands` | Output the list of subcommands |
450
+ | Option | Description |
451
+ | ------------------- | ----------------------------------------------------------- |
452
+ | `-h, --help` | Show help |
453
+ | `-v, --version` | Show version |
454
+ | `--format <fmt>` | Output format: `json` or `text` (default: `text`) |
455
+ | `--no-color` | Disable ANSI color output |
456
+ | `--config <path>` | Use a custom configuration file |
457
+ | `--org-id <id>` | Override the default Organization ID |
458
+ | `--space-id <id>` | Override the default Space ID |
459
+ | `--verbose` | Enable verbose mode with detailed process information |
460
+ | `--debug` | Enable debug mode with all log output for diagnosing issues |
461
+ | `--log-file <path>` | Write logs to a file |
462
+ | `--man` | Show full manual information |
463
+ | `--schema` | Output the command's JSON Schema |
464
+ | `--commands` | Output the list of subcommands |
442
465
 
443
466
  ## Configuration
444
467
 
445
468
  The CLI reads configuration from multiple sources with the following priority (highest to lowest):
446
469
 
447
470
  1. **Environment variables**
448
- 2. **Command-line `--config` file**
449
- 3. **Project-level config** (`.cozerc.json` in current directory)
450
- 4. **Global config** (`~/.coze/config.json`)
451
- 5. **Built-in defaults**
471
+ 2. **Command-line** **`--config`** **file**
472
+ 3. **`COZE_CONFIG_FILE`** **environment variable file**
473
+ 4. **Project-level config** (`.cozerc.json` in current directory)
474
+ 5. **Global config** (`~/.coze/config.json`)
475
+ 6. **Built-in defaults**
452
476
 
453
477
  ### Environment Variables
454
478
 
455
- | Variable | Description |
456
- |---|---|
457
- | `COZE_API_TOKEN` | Personal Access Token for authentication |
458
- | `COZE_ORG_ID` | Default Organization ID |
459
- | `COZE_ENTERPRISE_ID` | Default Enterprise ID |
460
- | `COZE_SPACE_ID` | Default Space ID |
461
- | `COZE_PROJECT_ID` | Default Project ID (used by `message` commands) |
479
+ | Variable | Description |
480
+ | ------------------------ | --------------------------------------------------- |
481
+ | `COZE_ORG_ID` | Default Organization ID |
482
+ | `COZE_ENTERPRISE_ID` | Default Enterprise ID |
483
+ | `COZE_SPACE_ID` | Default Space ID |
484
+ | `COZE_PROJECT_ID` | Default Project ID (used by `message` commands) |
485
+ | `COZE_CONFIG_FILE` | Custom configuration file path |
486
+ | `COZE_CONFIG_SCOPE` | Config write scope: `global` or `local` |
487
+ | `COZE_AUTO_CHECK_UPDATE` | Enable/disable auto update check: `true` or `false` |
462
488
 
463
489
  ## Exit Codes
464
490
 
465
- | Code | Name | Description |
466
- |---|---|---|
467
- | `0` | `SUCCESS` | Command completed successfully |
468
- | `1` | `GENERAL_ERROR` | General error |
469
- | `2` | `AUTH_FAILED` | Authentication failed |
470
- | `3` | `RESOURCE_NOT_FOUND` | Requested resource not found |
471
- | `4` | `INVALID_ARGUMENT` | Invalid argument or option |
472
- | `5` | `PERMISSION_DENIED` | Permission denied |
473
- | `6` | `NETWORK_ERROR` | Network error |
474
- | `7` | `SERVER_ERROR` | Server error |
475
- | `8` | `TIMEOUT` | Operation timed out |
476
- | `9` | `QUOTA_EXCEEDED` | Quota exceeded |
477
- | `10` | `CONFLICT` | Resource conflict |
478
-
479
- ## CI/CD Usage
491
+ | Code | Name | Description |
492
+ | ---- | -------------------- | ------------------------------ |
493
+ | `0` | `SUCCESS` | Command completed successfully |
494
+ | `1` | `GENERAL_ERROR` | General error |
495
+ | `2` | `AUTH_FAILED` | Authentication failed |
496
+ | `3` | `RESOURCE_NOT_FOUND` | Requested resource not found |
497
+ | `4` | `INVALID_ARGUMENT` | Invalid argument or option |
498
+ | `5` | `PERMISSION_DENIED` | Permission denied |
499
+ | `6` | `NETWORK_ERROR` | Network error |
500
+ | `7` | `SERVER_ERROR` | Server error |
501
+ | `8` | `TIMEOUT` | Operation timed out |
502
+ | `9` | `QUOTA_EXCEEDED` | Quota exceeded |
503
+ | `10` | `CONFLICT` | Resource conflict |
480
504
 
481
- ```bash
482
- # Authenticate with a PAT
483
- export COZE_API_TOKEN=<YOUR_PAT>
484
- export COZE_ORG_ID=<ORG_ID>
485
- export COZE_SPACE_ID=<SPACE_ID>
486
-
487
- # Create a project and wait for completion
488
- coze code project create -m "Build a chatbot" --type web --wait --format json
489
-
490
- # Send a message to a project
491
- export COZE_PROJECT_ID=<PROJECT_ID>
492
- coze code message send "Fix the authentication module" --format json
493
-
494
- # Deploy a project and wait for completion
495
- coze code deploy <projectId> --wait --format json
505
+ ## License
496
506
 
497
- # Check deployment status
498
- coze code deploy status <projectId> --format json
499
- ```
507
+ This project is licensed under the **MIT License**. When running, it calls Coze Platform APIs. To use these APls, you must comply with the following agreements and privacy policies:
500
508
 
501
- ## License
509
+ - [Privacy Policy](https://docs.coze.cn/guides/privacy)
510
+ - [Terms of Service](https://docs.coze.cn/guides/terms-of-service)
502
511
 
503
- MIT
@@ -0,0 +1,31 @@
1
+ # @coze/cli THIRD-PARTY LICENSES
2
+
3
+ **Copyright (c) 2026 ByteDance Ltd. and/or its affiliates**
4
+
5
+ This project, **@coze/cli**, incorporates components from the open source projects listed below.
6
+ The original copyright notices and the licenses under which ByteDance received such components are set forth below.
7
+
8
+ ## Open Source and Third-Party Components
9
+
10
+ | Component | License | URL |
11
+ | :--- | :--- | :--- |
12
+ | **chalk** | MIT | [Link](https://www.npmjs.com/package/chalk) |
13
+ | **commander** | MIT | [Link](https://www.npmjs.com/package/commander) |
14
+ | **form-data** | MIT | [Link](https://www.npmjs.com/package/form-data) |
15
+ | **http-proxy-agent** | MIT | [Link](https://www.npmjs.com/package/http-proxy-agent) |
16
+ | **https-proxy-agent** | MIT | [Link](https://www.npmjs.com/package/https-proxy-agent) |
17
+ | **lodash** | MIT | [Link](https://www.npmjs.com/package/lodash) |
18
+ | **mitt** | MIT | [Link](https://www.npmjs.com/package/mitt) |
19
+ | **omelette** | MIT | [Link](https://www.npmjs.com/package/omelette) |
20
+ | **undici** | MIT | [Link](https://www.npmjs.com/package/undici) |
21
+ | **@rollup/plugin-commonjs** | MIT | [Link](https://www.npmjs.com/package/@rollup/plugin-commonjs) |
22
+ | **@rollup/plugin-json** | MIT | [Link](https://www.npmjs.com/package/@rollup/plugin-json) |
23
+ | **@rollup/plugin-node-resolve** | MIT | [Link](https://www.npmjs.com/package/@rollup/plugin-node-resolve) |
24
+ | **@rollup/plugin-sucrase** | MIT | [Link](https://www.npmjs.com/package/@rollup/plugin-sucrase) |
25
+ | **@types/lodash** | MIT | [Link](https://www.npmjs.com/package/@types/lodash) |
26
+ | **@types/node** | MIT | [Link](https://www.npmjs.com/package/@types/node) |
27
+ | **@vitest/coverage-v8** | MIT | [Link](https://www.npmjs.com/package/@vitest/coverage-v8) |
28
+ | **rollup** | MIT | [Link](https://www.npmjs.com/package/rollup) |
29
+ | **sucrase** | MIT | [Link](https://www.npmjs.com/package/sucrase) |
30
+ | **tsx** | MIT | [Link](https://www.npmjs.com/package/tsx) |
31
+ | **vitest** | MIT | [Link](https://www.npmjs.com/package/vitest) |