@coze/cli 0.1.0-alpha.5aabeb → 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/LICENSE.md +21 -0
- package/README.md +333 -64
- package/THIRD-PARTY-LICENSES.md +31 -0
- package/bin/main +3 -1
- package/lib/cli.js +1 -41290
- package/lib/index-BJYIJeMH.js +1 -0
- package/lib/send-message.worker.js +1 -52
- package/package.json +18 -18
- package/lib/index-DhC0nL6S.js +0 -25165
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,46 +32,45 @@ 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
|
|
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
|
-
#
|
|
44
|
-
coze auth
|
|
45
|
-
```
|
|
40
|
+
# Check status in JSON format
|
|
41
|
+
coze auth status --format json
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
|
51
|
+
Manage the full authentication lifecycle. Supports interactive OAuth login via browser.
|
|
52
|
+
|
|
57
53
|
| Command | Description |
|
|
58
54
|
|---|---|
|
|
59
|
-
| `coze auth login
|
|
60
|
-
| `coze auth
|
|
61
|
-
| `coze auth status` | Check current login status |
|
|
55
|
+
| `coze auth login` | Interactive login via browser |
|
|
56
|
+
| `coze auth status` | Check current login status and credential validity |
|
|
62
57
|
| `coze auth logout` | Logout and clear stored credentials |
|
|
63
58
|
|
|
64
59
|
### `coze organization` — Organization Management
|
|
65
60
|
|
|
61
|
+
View and switch organizations to set the default Organization ID for subsequent commands.
|
|
62
|
+
|
|
66
63
|
| Command | Description |
|
|
67
64
|
|---|---|
|
|
68
|
-
| `coze organization list` | List all accessible organizations |
|
|
69
|
-
| `coze organization use <org_id>` | Set the default organization |
|
|
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
|
|
|
72
|
+
View and switch workspaces to set the default Space ID for subsequent commands.
|
|
73
|
+
|
|
75
74
|
| Command | Description |
|
|
76
75
|
|---|---|
|
|
77
76
|
| `coze space list` | List all spaces under the current organization |
|
|
@@ -81,92 +80,308 @@ Alias: `coze org`
|
|
|
81
80
|
|
|
82
81
|
#### Project
|
|
83
82
|
|
|
83
|
+
Manage Coze Coding projects. Supports creating, viewing, listing, and deleting projects across various types.
|
|
84
|
+
|
|
84
85
|
| Command | Description |
|
|
85
86
|
|---|---|
|
|
86
87
|
| `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 <
|
|
89
|
-
| `coze code project delete <
|
|
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
|
|
93
|
-
coze code project create --message "Create a
|
|
95
|
+
# Create a Web project
|
|
96
|
+
coze code project create --message "Create a chatbot" --type web
|
|
97
|
+
|
|
98
|
+
# Create and wait for the initial build to complete
|
|
99
|
+
coze code project create --message "Create a data dashboard" --type app --wait
|
|
94
100
|
|
|
95
|
-
#
|
|
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
|
|
|
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
|
+
|
|
100
136
|
| Command | Description |
|
|
101
137
|
|---|---|
|
|
102
138
|
| `coze code message send [message]` | Send a prompt message to a project chat |
|
|
103
|
-
| `coze code message status` |
|
|
139
|
+
| `coze code message status` | Query message status and get result when completed |
|
|
104
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"
|
|
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"
|
|
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
|
|
|
174
|
+
Deploy projects to the production environment. Supports multiple project types including Agent, Workflow, Skill, Web, Mini-program, etc.
|
|
175
|
+
|
|
116
176
|
| Command | Description |
|
|
117
177
|
|---|---|
|
|
118
178
|
| `coze code deploy <projectId>` | Deploy a project to production |
|
|
119
179
|
| `coze code deploy <projectId> --wait` | Deploy and wait for completion |
|
|
120
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
|
|
|
202
|
+
Manage project environment variables (Secrets). Supports development and production environments.
|
|
203
|
+
|
|
124
204
|
| Command | Description |
|
|
125
205
|
|---|---|
|
|
126
|
-
| `coze code env list
|
|
127
|
-
| `coze code env set <key> <value>` | Set an environment variable |
|
|
128
|
-
| `coze code env delete <key>` | Delete an environment variable |
|
|
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
|
|
|
226
|
+
Manage custom domains for deployed projects.
|
|
227
|
+
|
|
132
228
|
| Command | Description |
|
|
133
229
|
|---|---|
|
|
134
|
-
| `coze code domain list
|
|
135
|
-
| `coze code domain add <domain>` | Add a custom domain |
|
|
136
|
-
| `coze code domain remove <domain>` | Remove a custom domain |
|
|
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
|
|
|
236
|
+
Manage skills associated with a project to extend its capabilities.
|
|
237
|
+
|
|
140
238
|
| Command | Description |
|
|
141
239
|
|---|---|
|
|
142
|
-
| `coze code skill list
|
|
143
|
-
| `coze code skill add
|
|
144
|
-
| `coze code skill remove
|
|
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
|
|
|
246
|
+
Get the sandbox preview URL for a project.
|
|
247
|
+
|
|
148
248
|
| Command | Description |
|
|
149
249
|
|---|---|
|
|
150
|
-
| `coze code preview
|
|
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
|
-
#
|
|
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
|
-
#
|
|
162
|
-
coze generate
|
|
302
|
+
# Save to file
|
|
303
|
+
coze generate audio "Hello" --output-path ./audio.mp3
|
|
163
304
|
|
|
164
|
-
#
|
|
165
|
-
|
|
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
|
|
166
310
|
```
|
|
167
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 reference images
|
|
341
|
+
coze generate video create "Animate this" --first-frame https://example.com/frame.png
|
|
342
|
+
coze generate video create "In this style" --reference-image https://example.com/ref.png
|
|
343
|
+
|
|
344
|
+
# Query task status later
|
|
345
|
+
coze generate video status task_123
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Use `coze generate video create` to submit generation tasks, and `coze generate video status <taskId>` to query existing tasks.
|
|
349
|
+
|
|
350
|
+
**`generate video create` options:**
|
|
351
|
+
|
|
352
|
+
| Option | Default | Description |
|
|
353
|
+
|---|---|---|
|
|
354
|
+
| `--model <model>` | `doubao-seedance-1-5-pro-251215` | Video generation model |
|
|
355
|
+
| `--callback-url <url>` | — | Callback URL for task status changes |
|
|
356
|
+
| `--resolution <res>` | `720p` | Resolution: `480p` \| `720p` \| `1080p` |
|
|
357
|
+
| `--ratio <ratio>` | `16:9` | Aspect ratio (e.g., `16:9`, `9:16`, `1:1`) |
|
|
358
|
+
| `--size <size>` | — | Derive ratio/resolution from `WIDTHxHEIGHT` |
|
|
359
|
+
| `--duration <seconds>` | `5` | Duration in seconds (4–12) |
|
|
360
|
+
| `--no-watermark` | enabled | Disable watermark |
|
|
361
|
+
| `--seed <seed>` | — | Random seed for reproducibility |
|
|
362
|
+
| `--camerafixed` | `false` | Fix camera position (reduce motion) |
|
|
363
|
+
| `--no-generate-audio` | generates audio | Do not generate accompanying audio |
|
|
364
|
+
| `--first-frame <url>` | — | First frame image URL |
|
|
365
|
+
| `--last-frame <url>` | — | Last frame image URL |
|
|
366
|
+
| `--reference-image <url>` | — | Reference image URL (repeatable) |
|
|
367
|
+
| `--return-last-frame` | `false` | Return last frame URL in output |
|
|
368
|
+
| `--wait` | `false` | Poll until completion instead of returning `taskId` immediately |
|
|
369
|
+
| `--output-path <path>` | — | Directory to save generated video |
|
|
370
|
+
|
|
371
|
+
**`generate video status` options:**
|
|
372
|
+
|
|
373
|
+
| Option | Default | Description |
|
|
374
|
+
|---|---|---|
|
|
375
|
+
| `--output <format>` | `text` | Output format: `text` \| `json` |
|
|
376
|
+
|
|
168
377
|
### `coze file` — File Operations
|
|
169
378
|
|
|
379
|
+
Upload local files to Coze for use as attachments or context in projects.
|
|
380
|
+
|
|
381
|
+
| Command | Description |
|
|
382
|
+
|---|---|
|
|
383
|
+
| `coze file upload <path>` | Upload a local file |
|
|
384
|
+
|
|
170
385
|
```bash
|
|
171
386
|
# Upload a file
|
|
172
387
|
coze file upload ./document.pdf
|
|
@@ -174,22 +389,65 @@ coze file upload ./document.pdf
|
|
|
174
389
|
|
|
175
390
|
### `coze config` — Configuration
|
|
176
391
|
|
|
177
|
-
|
|
392
|
+
Manage CLI configuration stored in `~/.coze/config.json` (global) and `.cozerc.json` (project-level).
|
|
178
393
|
|
|
179
394
|
| Command | Description |
|
|
180
395
|
|---|---|
|
|
181
396
|
| `coze config list` | List all configuration items with sources |
|
|
182
|
-
| `coze config get <
|
|
397
|
+
| `coze config get <keys...>` | Get one or more configuration values |
|
|
183
398
|
| `coze config set <key> <value>` | Set a configuration value |
|
|
184
|
-
| `coze config delete <
|
|
399
|
+
| `coze config delete <keys...>` | Delete one or more configuration items |
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
# List all configurations with their sources (env, local, global, default)
|
|
403
|
+
coze config list
|
|
404
|
+
|
|
405
|
+
# Get a single config value
|
|
406
|
+
coze config get spaceId
|
|
407
|
+
|
|
408
|
+
# Get multiple config values
|
|
409
|
+
coze config get apiBaseUrl spaceId organizationId
|
|
410
|
+
|
|
411
|
+
# Set a configuration value
|
|
412
|
+
coze config set spaceId 123456789
|
|
413
|
+
|
|
414
|
+
# Delete configuration keys
|
|
415
|
+
coze config delete spaceId
|
|
416
|
+
coze config delete spaceId apiBaseUrl
|
|
417
|
+
```
|
|
185
418
|
|
|
186
419
|
### `coze completion` — Shell Autocompletion
|
|
187
420
|
|
|
421
|
+
Set up or remove shell autocompletion (supports bash/zsh/fish/powershell).
|
|
422
|
+
|
|
188
423
|
```bash
|
|
189
|
-
#
|
|
424
|
+
# Install shell completion script
|
|
190
425
|
coze completion --setup
|
|
426
|
+
|
|
427
|
+
# Remove shell completion script
|
|
428
|
+
coze completion --cleanup
|
|
191
429
|
```
|
|
192
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
|
+
|
|
193
451
|
## Global Options
|
|
194
452
|
|
|
195
453
|
| Option | Description |
|
|
@@ -201,9 +459,12 @@ coze completion --setup
|
|
|
201
459
|
| `--config <path>` | Use a custom configuration file |
|
|
202
460
|
| `--org-id <id>` | Override the default Organization ID |
|
|
203
461
|
| `--space-id <id>` | Override the default Space ID |
|
|
204
|
-
| `--verbose` | Enable verbose
|
|
205
|
-
| `--debug` | Enable debug mode |
|
|
462
|
+
| `--verbose` | Enable verbose mode with detailed process information |
|
|
463
|
+
| `--debug` | Enable debug mode with all log output for diagnosing issues |
|
|
206
464
|
| `--log-file <path>` | Write logs to a file |
|
|
465
|
+
| `--man` | Show full manual information |
|
|
466
|
+
| `--schema` | Output the command's JSON Schema |
|
|
467
|
+
| `--commands` | Output the list of subcommands |
|
|
207
468
|
|
|
208
469
|
## Configuration
|
|
209
470
|
|
|
@@ -211,31 +472,39 @@ The CLI reads configuration from multiple sources with the following priority (h
|
|
|
211
472
|
|
|
212
473
|
1. **Environment variables**
|
|
213
474
|
2. **Command-line `--config` file**
|
|
214
|
-
3.
|
|
215
|
-
4. **
|
|
216
|
-
5. **
|
|
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**
|
|
217
479
|
|
|
218
480
|
### Environment Variables
|
|
219
481
|
|
|
220
482
|
| Variable | Description |
|
|
221
483
|
|---|---|
|
|
222
|
-
| `COZE_API_TOKEN` | Personal Access Token for authentication |
|
|
223
484
|
| `COZE_ORG_ID` | Default Organization ID |
|
|
224
485
|
| `COZE_ENTERPRISE_ID` | Default Enterprise ID |
|
|
225
486
|
| `COZE_SPACE_ID` | Default Space ID |
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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` |
|
|
491
|
+
|
|
492
|
+
## Exit Codes
|
|
493
|
+
|
|
494
|
+
| Code | Name | Description |
|
|
495
|
+
|---|---|---|
|
|
496
|
+
| `0` | `SUCCESS` | Command completed successfully |
|
|
497
|
+
| `1` | `GENERAL_ERROR` | General error |
|
|
498
|
+
| `2` | `AUTH_FAILED` | Authentication failed |
|
|
499
|
+
| `3` | `RESOURCE_NOT_FOUND` | Requested resource not found |
|
|
500
|
+
| `4` | `INVALID_ARGUMENT` | Invalid argument or option |
|
|
501
|
+
| `5` | `PERMISSION_DENIED` | Permission denied |
|
|
502
|
+
| `6` | `NETWORK_ERROR` | Network error |
|
|
503
|
+
| `7` | `SERVER_ERROR` | Server error |
|
|
504
|
+
| `8` | `TIMEOUT` | Operation timed out |
|
|
505
|
+
| `9` | `QUOTA_EXCEEDED` | Quota exceeded |
|
|
506
|
+
| `10` | `CONFLICT` | Resource conflict |
|
|
238
507
|
|
|
239
508
|
## License
|
|
240
509
|
|
|
241
|
-
|
|
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.
|
|
@@ -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 =
|
|
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
|
|