@coze/cli 0.1.0-alpha.cb1d83 → 0.1.0-alpha.d26823

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/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,22 +44,15 @@ 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
53
  | Command | Description |
63
54
  |---|---|
64
- | `coze auth login --oauth` | Interactive login via browser |
65
- | `coze auth login --token <PAT>` | Login with a Personal Access Token |
55
+ | `coze auth login` | Interactive login via browser |
66
56
  | `coze auth status` | Check current login status and credential validity |
67
57
  | `coze auth logout` | Logout and clear stored credentials |
68
58
 
@@ -103,22 +93,22 @@ 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
107
  **`project create` options:**
118
108
 
119
109
  | Option | Description |
120
110
  |---|---|
121
- | `-m, --message <message>` | **(required)** Project description in natural language |
111
+ | `--message <message>` | **(required)** Project description in natural language |
122
112
  | `--type <type>` | **(required)** Project type: `web` \| `app` |
123
113
  | `--wait` | Wait for project creation to complete |
124
114
  | `--org-id <orgId>` | Organization ID (reads from context if omitted) |
@@ -132,11 +122,12 @@ coze code project list --size 20 --has-published true
132
122
  | `--cursor-id <cursorId>` | Cursor for pagination |
133
123
  | `--type <type>` | Filter by type (can pass multiple times): `agent` \| `workflow` \| `webapp` \| `app` \| `web` \| `miniprogram` \| `assistant` |
134
124
  | `--name <name>` | Filter by project name |
135
- | `--has-published <bool>` | Filter by publish status |
125
+ | `--has-published` | Filter by publish status |
136
126
  | `--search-scope <n>` | Created by (0=All, 1=CreatedByMe, 2=AllWithCollaborator) |
137
127
  | `--folder-id <id>` | Filter by folder |
138
128
  | `--order-type <n>` | Sort type (0=descending, 1=ascending) |
139
- | `--is-fav-filter <bool>` | Filter favorites only |
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
 
@@ -187,6 +178,7 @@ Deploy projects to the production environment. Supports multiple project types i
187
178
  | `coze code deploy <projectId>` | Deploy a project to production |
188
179
  | `coze code deploy <projectId> --wait` | Deploy and wait for completion |
189
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,6 +192,9 @@ 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
@@ -242,7 +237,7 @@ Manage skills associated with a project to extend its capabilities.
242
237
 
243
238
  | Command | Description |
244
239
  |---|---|
245
- | `coze code skill list <projectId>` | List all skills (shows installed status) |
240
+ | `coze code skill list -p <projectId>` | List all skills (shows installed status) |
246
241
  | `coze code skill add <skillId> -p <projectId>` | Add a skill to the project |
247
242
  | `coze code skill remove <skillId> -p <projectId>` | Remove a skill from the project |
248
243
 
@@ -324,6 +319,7 @@ coze generate audio "Hello" --speaker zh_female_xiaohe_uranus_bigtts --audio-for
324
319
  | `--speech-rate <n>` | `0` | Speech rate (-50 to 100) |
325
320
  | `--loudness-rate <n>` | `0` | Loudness (-50 to 100) |
326
321
  | `--ssml` | `false` | Treat input as SSML instead of plain text |
322
+ | `--uid <uid>` | `cli_user` | User UID |
327
323
  | `--output-path <path>` | — | Directory to save generated audio |
328
324
 
329
325
  #### Video Generation
@@ -422,7 +418,7 @@ coze config delete spaceId apiBaseUrl
422
418
 
423
419
  ### `coze completion` — Shell Autocompletion
424
420
 
425
- Set up or remove shell autocompletion for bash/zsh.
421
+ Set up or remove shell autocompletion (supports bash/zsh/fish/powershell).
426
422
 
427
423
  ```bash
428
424
  # Install shell completion script
@@ -432,13 +428,33 @@ coze completion --setup
432
428
  coze completion --cleanup
433
429
  ```
434
430
 
431
+ ### `coze upgrade` — CLI Upgrade
432
+
433
+ 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.
434
+
435
+ ```bash
436
+ # Upgrade to latest version
437
+ coze upgrade
438
+
439
+ # Force check and upgrade
440
+ coze upgrade --force
441
+
442
+ # Upgrade to a specific tag
443
+ coze upgrade --tag beta
444
+ ```
445
+
446
+ | Option | Description |
447
+ |---|---|
448
+ | `--force` | Force upgrade even if already on the latest version |
449
+ | `--tag <tag>` | Specify the dist-tag to upgrade to (default: `latest`) |
450
+
435
451
  ## Global Options
436
452
 
437
453
  | Option | Description |
438
454
  |---|---|
439
455
  | `-h, --help` | Show help |
440
456
  | `-v, --version` | Show version |
441
- | `--format <fmt>` | Output format: `json` or `text` (default: `json`) |
457
+ | `--format <fmt>` | Output format: `json` or `text` (default: `text`) |
442
458
  | `--no-color` | Disable ANSI color output |
443
459
  | `--config <path>` | Use a custom configuration file |
444
460
  | `--org-id <id>` | Override the default Organization ID |
@@ -456,19 +472,22 @@ The CLI reads configuration from multiple sources with the following priority (h
456
472
 
457
473
  1. **Environment variables**
458
474
  2. **Command-line `--config` file**
459
- 3. **Project-level config** (`.cozerc.json` in current directory)
460
- 4. **Global config** (`~/.coze/config.json`)
461
- 5. **Built-in defaults**
475
+ 3. **`COZE_CONFIG_FILE` environment variable file**
476
+ 4. **Project-level config** (`.cozerc.json` in current directory)
477
+ 5. **Global config** (`~/.coze/config.json`)
478
+ 6. **Built-in defaults**
462
479
 
463
480
  ### Environment Variables
464
481
 
465
482
  | Variable | Description |
466
483
  |---|---|
467
- | `COZE_API_TOKEN` | Personal Access Token for authentication |
468
484
  | `COZE_ORG_ID` | Default Organization ID |
469
485
  | `COZE_ENTERPRISE_ID` | Default Enterprise ID |
470
486
  | `COZE_SPACE_ID` | Default Space ID |
471
487
  | `COZE_PROJECT_ID` | Default Project ID (used by `message` commands) |
488
+ | `COZE_CONFIG_FILE` | Custom configuration file path |
489
+ | `COZE_CONFIG_SCOPE` | Config write scope: `global` or `local` |
490
+ | `COZE_AUTO_CHECK_UPDATE` | Enable/disable auto update check: `true` or `false` |
472
491
 
473
492
  ## Exit Codes
474
493
 
@@ -486,28 +505,6 @@ The CLI reads configuration from multiple sources with the following priority (h
486
505
  | `9` | `QUOTA_EXCEEDED` | Quota exceeded |
487
506
  | `10` | `CONFLICT` | Resource conflict |
488
507
 
489
- ## CI/CD Usage
490
-
491
- ```bash
492
- # Authenticate with a PAT
493
- export COZE_API_TOKEN=<YOUR_PAT>
494
- export COZE_ORG_ID=<ORG_ID>
495
- export COZE_SPACE_ID=<SPACE_ID>
496
-
497
- # Create a project and wait for completion
498
- coze code project create -m "Build a chatbot" --type web --wait --format json
499
-
500
- # Send a message to a project
501
- export COZE_PROJECT_ID=<PROJECT_ID>
502
- coze code message send "Fix the authentication module" --format json
503
-
504
- # Deploy a project and wait for completion
505
- coze code deploy <projectId> --wait --format json
506
-
507
- # Check deployment status
508
- coze code deploy status <projectId> --format json
509
- ```
510
-
511
508
  ## License
512
509
 
513
510
  See the [LICENSE](LICENSE.md) file and [THIRD-PARTY-LICENSES](THIRD-PARTY-LICENSES.md) included in the package for full terms, conditions, and third-party notices.
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