@coze/cli 0.1.0-alpha.5aabeb → 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
@@ -32,141 +32,353 @@ 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
42
39
 
43
- # Logout
44
- coze auth logout
45
- ```
46
-
47
- You can also authenticate via environment variables for CI/CD pipelines:
40
+ # Check status in JSON format
41
+ coze auth status --format json
48
42
 
49
- ```bash
50
- export COZE_API_TOKEN=<YOUR_PAT>
43
+ # Logout and clear credentials
44
+ coze auth logout
51
45
  ```
52
46
 
53
47
  ## Commands
54
48
 
55
49
  ### `coze auth` — Authentication
56
50
 
57
- | Command | Description |
58
- |---|---|
59
- | `coze auth login --oauth` | Interactive login via browser |
60
- | `coze auth login --token <PAT>` | Login with a Personal Access Token |
61
- | `coze auth status` | Check current login status |
62
- | `coze auth logout` | Logout and clear stored credentials |
51
+ Manage the full authentication lifecycle. Supports interactive OAuth login via browser.
52
+
53
+ | Command | Description |
54
+ | ------------------ | -------------------------------------------------- |
55
+ | `coze auth login` | Interactive login via browser |
56
+ | `coze auth status` | Check current login status and credential validity |
57
+ | `coze auth logout` | Logout and clear stored credentials |
63
58
 
64
59
  ### `coze organization` — Organization Management
65
60
 
66
- | Command | Description |
67
- |---|---|
68
- | `coze organization list` | List all accessible organizations |
69
- | `coze organization use <org_id>` | Set the default organization |
61
+ View and switch organizations to set the default Organization ID for subsequent commands.
62
+
63
+ | Command | Description |
64
+ | -------------------------------- | ------------------------------------------------------- |
65
+ | `coze organization list` | List all accessible organizations and their enterprises |
66
+ | `coze organization use <org_id>` | Set the default organization (auto-saves Enterprise ID) |
70
67
 
71
68
  Alias: `coze org`
72
69
 
73
70
  ### `coze space` — Workspace Management
74
71
 
75
- | Command | Description |
76
- |---|---|
77
- | `coze space list` | List all spaces under the current organization |
78
- | `coze space use <space_id>` | Set the default workspace |
72
+ View and switch workspaces to set the default Space ID for subsequent commands.
73
+
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 |
79
78
 
80
79
  ### `coze code` — Coze Coding
81
80
 
82
81
  #### Project
83
82
 
84
- | Command | Description |
85
- |---|---|
86
- | `coze code project create` | Create a new project from natural language description |
87
- | `coze code project list` | List all projects |
88
- | `coze code project get <id>` | Get project details |
89
- | `coze code project delete <id>` | Delete a project |
83
+ Manage Coze Coding projects. Supports creating, viewing, listing, and deleting projects across various types.
84
+
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) |
91
+
92
+ Alias: `coze code proj`
90
93
 
91
94
  ```bash
92
- # Create an Agent project
93
- coze code project create --message "Create a customer service bot" --type agent
95
+ # Create a Web project
96
+ coze code project create --message "Create a chatbot" --type web
94
97
 
95
- # Supported types: agent, workflow, app, skill, web, miniprogram, assistant
98
+ # Create and wait for the initial build to complete
99
+ coze code project create --message "Create a data dashboard" --type app --wait
100
+
101
+ # List projects with filters
102
+ coze code project list --type agent --type workflow
103
+ coze code project list --name "customer service"
104
+ coze code project list --size 20 --has-published
96
105
  ```
97
106
 
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 |
131
+
98
132
  #### Message
99
133
 
100
- | Command | Description |
101
- |---|---|
102
- | `coze code message send [message]` | Send a prompt message to a project chat |
103
- | `coze code message status` | Check message status |
104
- | `coze code message cancel` | Cancel an ongoing message |
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.
135
+
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 |
105
141
 
106
142
  ```bash
107
143
  # Send a message to a project
108
- coze code message send "Fix the login bug" --project-id 123456
144
+ coze code message send "Fix the login bug" -p 123456
145
+
146
+ # Mention local files with @ syntax for upload as context
147
+ coze code message send "Refactor @src/utils.ts to use async/await" -p 123456
148
+
149
+ # Mention multiple files
150
+ coze code message send "Compare @src/old.ts and @src/new.ts" -p 123456
109
151
 
110
152
  # Pipe context via stdin
111
- cat error.log | coze code message send "Analyze this error" --project-id 123456
153
+ cat error.log | coze code message send "Analyze this error" -p 123456
154
+
155
+ # Check message status (auto-fetches result when completed)
156
+ coze code message status -p 123456
157
+
158
+ # Cancel an ongoing message
159
+ coze code message cancel -p 123456
160
+
161
+ # Use environment variable for project ID
162
+ export COZE_PROJECT_ID=123456
163
+ coze code message send "Hello"
112
164
  ```
113
165
 
166
+ **`message`** **options (shared by all subcommands):**
167
+
168
+ | Option | Description |
169
+ | ----------------------- | ------------------------------------------ |
170
+ | `-p, --project-id <id>` | Coze project ID (or env `COZE_PROJECT_ID`) |
171
+
114
172
  #### Deploy
115
173
 
116
- | Command | Description |
117
- |---|---|
118
- | `coze code deploy <projectId>` | Deploy a project to production |
119
- | `coze code deploy <projectId> --wait` | Deploy and wait for completion |
120
- | `coze code deploy status <projectId>` | Check deployment status |
174
+ Deploy projects to the production environment. Supports multiple project types including Agent, Workflow, Skill, Web, Mini-program, etc.
175
+
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 |
182
+
183
+ ```bash
184
+ # Deploy a project
185
+ coze code deploy <projectId>
186
+
187
+ # Deploy and wait for completion
188
+ coze code deploy <projectId> --wait
189
+
190
+ # Check latest deployment status
191
+ coze code deploy status <projectId>
192
+
193
+ # Check a specific deployment record
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
198
+ ```
121
199
 
122
200
  #### Environment Variables
123
201
 
124
- | Command | Description |
125
- |---|---|
126
- | `coze code env list` | List environment variables |
127
- | `coze code env set <key> <value>` | Set an environment variable |
128
- | `coze code env delete <key>` | Delete an environment variable |
202
+ Manage project environment variables (Secrets). Supports development and production environments.
203
+
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 |
209
+
210
+ ```bash
211
+ # List dev environment variables (default)
212
+ coze code env list -p <projectId>
213
+
214
+ # List prod environment variables
215
+ coze code env list -p <projectId> --env prod
216
+
217
+ # Set an environment variable
218
+ coze code env set API_KEY sk-xxxxx -p <projectId>
219
+
220
+ # Delete an environment variable
221
+ coze code env delete API_KEY -p <projectId>
222
+ ```
129
223
 
130
224
  #### Domain
131
225
 
132
- | Command | Description |
133
- |---|---|
134
- | `coze code domain list` | List custom domains |
135
- | `coze code domain add <domain>` | Add a custom domain |
136
- | `coze code domain remove <domain>` | Remove a custom domain |
226
+ Manage custom domains for deployed projects.
227
+
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 |
137
233
 
138
234
  #### Skill
139
235
 
140
- | Command | Description |
141
- |---|---|
142
- | `coze code skill list` | List skills |
143
- | `coze code skill add` | Add a skill |
144
- | `coze code skill remove` | Remove a skill |
236
+ Manage skills associated with a project to extend its capabilities.
237
+
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 |
145
243
 
146
244
  #### Preview
147
245
 
148
- | Command | Description |
149
- |---|---|
150
- | `coze code preview` | Preview the project |
246
+ Get the sandbox preview URL for a project.
247
+
248
+ | Command | Description |
249
+ | ------------------------------- | --------------------------- |
250
+ | `coze code preview <projectId>` | Get the project preview URL |
251
+
252
+ ```bash
253
+ # Get the preview URL (sandbox initialization takes 1-3 minutes)
254
+ coze code preview <projectId>
255
+ ```
151
256
 
152
257
  ### `coze generate` — Media Generation
153
258
 
259
+ Generate images, audio, and video using Coze AI models. All `generate` subcommands support `--output-path <path>` to save generated media to disk.
260
+
261
+ #### Image Generation
262
+
154
263
  ```bash
155
- # Generate an image
264
+ # Generate an image from text
156
265
  coze generate image "A sunset over the mountains"
157
266
 
158
- # Generate audio
267
+ # Save to a specific path
268
+ coze generate image "A logo design" --output-path ./assets
269
+
270
+ # Specify size (2K, 4K, or WIDTHxHEIGHT)
271
+ coze generate image "A futuristic city" --size 4K
272
+
273
+ # Disable watermark
274
+ coze generate image "A cat" --no-watermark
275
+
276
+ # Use reference image(s)
277
+ coze generate image "Similar style" --image https://example.com/ref.png
278
+
279
+ # Enable sequential (group) image generation
280
+ coze generate image "A storyboard" --sequential auto --max-images 5
281
+ ```
282
+
283
+ **`generate image`** **options:**
284
+
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 |
295
+
296
+ #### Audio Generation (TTS)
297
+
298
+ ```bash
299
+ # Basic text-to-speech
159
300
  coze generate audio "Hello, welcome to Coze"
160
301
 
161
- # Generate a video
162
- coze generate video "A cat playing piano"
302
+ # Save to file
303
+ coze generate audio "Hello" --output-path ./audio.mp3
163
304
 
164
- # Save to a specific directory
165
- coze generate image "A logo design" --output-path ./assets
305
+ # Use SSML input
306
+ echo "<speak>Hello</speak>" | coze generate audio --ssml
307
+
308
+ # Custom speaker and audio encoding
309
+ coze generate audio "Hello" --speaker zh_female_xiaohe_uranus_bigtts --audio-format ogg_opus
310
+ ```
311
+
312
+ **`generate audio`** **options:**
313
+
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 |
324
+
325
+ #### Video Generation
326
+
327
+ ```bash
328
+ # Create a video generation task
329
+ coze generate video create "A cat playing piano"
330
+
331
+ # Create a task and wait for completion
332
+ coze generate video create "A dancing kitten" --wait
333
+
334
+ # Save to a specific path
335
+ coze generate video create "A dancing kitten" --wait --output-path ./video.mp4
336
+
337
+ # Custom resolution and aspect ratio
338
+ coze generate video create "A landscape" --resolution 1080p --ratio 16:9
339
+
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
166
345
  ```
167
346
 
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
+
351
+ | Option | Default | Description |
352
+ |---|---|---|
353
+ | `--callback-url <url>` | — | Callback URL for task status changes |
354
+ | `--resolution <res>` | `720p` | Resolution: `480p` \| `720p` \| `1080p` |
355
+ | `--ratio <ratio>` | `16:9` | Aspect ratio (e.g., `16:9`, `9:16`, `1:1`) |
356
+ | `--size <size>` | — | Derive ratio/resolution from `WIDTHxHEIGHT` |
357
+ | `--duration <seconds>` | `5` | Duration in seconds (4–12) |
358
+ | `--no-watermark` | enabled | Disable watermark |
359
+ | `--seed <seed>` | — | Random seed for reproducibility |
360
+ | `--camerafixed` | `false` | Fix camera position (reduce motion) |
361
+ | `--no-generate-audio` | generates audio | Do not generate accompanying audio |
362
+ | `--first-frame <url>` | — | First frame image URL |
363
+ | `--last-frame <url>` | — | Last frame image URL |
364
+ | `--return-last-frame` | `false` | Return last frame URL in output |
365
+ | `--wait` | `false` | Poll until completion instead of returning `taskId` immediately |
366
+ | `--output-path <path>` | — | Directory to save generated video |
367
+
368
+ **`generate video status`** **options:**
369
+
370
+ | Option | Default | Description |
371
+ | ------------------- | ------- | ------------------------------- |
372
+ | `--output <format>` | `text` | Output format: `text` \| `json` |
373
+
168
374
  ### `coze file` — File Operations
169
375
 
376
+ Upload local files to Coze for use as attachments or context in projects.
377
+
378
+ | Command | Description |
379
+ | ------------------------- | ------------------- |
380
+ | `coze file upload <path>` | Upload a local file |
381
+
170
382
  ```bash
171
383
  # Upload a file
172
384
  coze file upload ./document.pdf
@@ -174,68 +386,126 @@ coze file upload ./document.pdf
174
386
 
175
387
  ### `coze config` — Configuration
176
388
 
177
- Configuration is stored in `~/.coze/config.json` (global) and `.cozerc.json` (project-level).
389
+ Manage CLI configuration stored in `~/.coze/config.json` (global) and `.cozerc.json` (project-level).
390
+
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 |
397
+
398
+ ```bash
399
+ # List all configurations with their sources (env, local, global, default)
400
+ coze config list
401
+
402
+ # Get a single config value
403
+ coze config get spaceId
404
+
405
+ # Get multiple config values
406
+ coze config get apiBaseUrl spaceId organizationId
178
407
 
179
- | Command | Description |
180
- |---|---|
181
- | `coze config list` | List all configuration items with sources |
182
- | `coze config get <key>` | Get a configuration value |
183
- | `coze config set <key> <value>` | Set a configuration value |
184
- | `coze config delete <key>` | Delete a configuration item |
408
+ # Set a configuration value
409
+ coze config set spaceId 123456789
410
+
411
+ # Delete configuration keys
412
+ coze config delete spaceId
413
+ coze config delete spaceId apiBaseUrl
414
+ ```
185
415
 
186
416
  ### `coze completion` — Shell Autocompletion
187
417
 
418
+ Set up or remove shell autocompletion (supports bash/zsh/fish/powershell).
419
+
188
420
  ```bash
189
- # Set up shell autocompletion
421
+ # Install shell completion script
190
422
  coze completion --setup
423
+
424
+ # Remove shell completion script
425
+ coze completion --cleanup
426
+ ```
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
191
441
  ```
192
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
+
193
448
  ## Global Options
194
449
 
195
- | Option | Description |
196
- |---|---|
197
- | `-h, --help` | Show help |
198
- | `-v, --version` | Show version |
199
- | `--format <fmt>` | Output format: `json` or `text` (default: `text`) |
200
- | `--no-color` | Disable ANSI color output |
201
- | `--config <path>` | Use a custom configuration file |
202
- | `--org-id <id>` | Override the default Organization ID |
203
- | `--space-id <id>` | Override the default Space ID |
204
- | `--verbose` | Enable verbose logging |
205
- | `--debug` | Enable debug mode |
206
- | `--log-file <path>` | Write logs to a file |
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 |
207
465
 
208
466
  ## Configuration
209
467
 
210
468
  The CLI reads configuration from multiple sources with the following priority (highest to lowest):
211
469
 
212
470
  1. **Environment variables**
213
- 2. **Command-line `--config` file**
214
- 3. **Project-level config** (`.cozerc.json` in current directory)
215
- 4. **Global config** (`~/.coze/config.json`)
216
- 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**
217
476
 
218
477
  ### Environment Variables
219
478
 
220
- | Variable | Description |
221
- |---|---|
222
- | `COZE_API_TOKEN` | Personal Access Token for authentication |
223
- | `COZE_ORG_ID` | Default Organization ID |
224
- | `COZE_ENTERPRISE_ID` | Default Enterprise ID |
225
- | `COZE_SPACE_ID` | Default Space ID |
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` |
488
+
489
+ ## Exit Codes
490
+
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 |
226
504
 
227
- ## CI/CD Usage
228
-
229
- ```bash
230
- # Authenticate with a PAT
231
- export COZE_API_TOKEN=<YOUR_PAT>
232
- export COZE_ORG_ID=<ORG_ID>
233
- export COZE_SPACE_ID=<SPACE_ID>
505
+ ## License
234
506
 
235
- # Deploy a project
236
- coze code deploy <projectId> --wait --format json
237
- ```
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:
238
508
 
239
- ## License
509
+ - [Privacy Policy](https://docs.coze.cn/guides/privacy)
510
+ - [Terms of Service](https://docs.coze.cn/guides/terms-of-service)
240
511
 
241
- 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) |
package/bin/main CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const isCompletion = process.argv.includes('--compzsh') ||
3
+ const isCompletion =
4
+ process.argv.includes('--compzsh') ||
4
5
  process.argv.includes('--compbash') ||
6
+ process.argv.includes('--comppwsh') ||
5
7
  process.argv.includes('--completion') ||
6
8
  process.argv.includes('completion');
7
9