@coze/cli 0.1.0-alpha.391559 → 0.1.0-alpha.429e52
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 +311 -39
- package/THIRD-PARTY-LICENSES.md +31 -0
- package/bin/main +3 -1
- package/lib/cli.js +1 -41194
- package/lib/index-DLgV1inZ.js +1 -0
- package/lib/send-message.worker.js +1 -52
- package/package.json +17 -18
- package/lib/index-lMSqm5Bi.js +0 -20896
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
|
|
26
|
+
coze code project create -m "Build an intelligent assistant" --type web
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Authentication
|
|
@@ -40,7 +40,10 @@ coze auth login --token <YOUR_PAT>
|
|
|
40
40
|
# Check current login status
|
|
41
41
|
coze auth status
|
|
42
42
|
|
|
43
|
-
#
|
|
43
|
+
# Check status in JSON format
|
|
44
|
+
coze auth status --format json
|
|
45
|
+
|
|
46
|
+
# Logout and clear credentials
|
|
44
47
|
coze auth logout
|
|
45
48
|
```
|
|
46
49
|
|
|
@@ -54,24 +57,30 @@ export COZE_API_TOKEN=<YOUR_PAT>
|
|
|
54
57
|
|
|
55
58
|
### `coze auth` — Authentication
|
|
56
59
|
|
|
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.
|
|
61
|
+
|
|
57
62
|
| Command | Description |
|
|
58
63
|
|---|---|
|
|
59
64
|
| `coze auth login --oauth` | Interactive login via browser |
|
|
60
65
|
| `coze auth login --token <PAT>` | Login with a Personal Access Token |
|
|
61
|
-
| `coze auth status` | Check current login status |
|
|
66
|
+
| `coze auth status` | Check current login status and credential validity |
|
|
62
67
|
| `coze auth logout` | Logout and clear stored credentials |
|
|
63
68
|
|
|
64
69
|
### `coze organization` — Organization Management
|
|
65
70
|
|
|
71
|
+
View and switch organizations to set the default Organization ID for subsequent commands.
|
|
72
|
+
|
|
66
73
|
| Command | Description |
|
|
67
74
|
|---|---|
|
|
68
|
-
| `coze organization list` | List all accessible organizations |
|
|
69
|
-
| `coze organization use <org_id>` | Set the default organization |
|
|
75
|
+
| `coze organization list` | List all accessible organizations and their enterprises |
|
|
76
|
+
| `coze organization use <org_id>` | Set the default organization (auto-saves Enterprise ID) |
|
|
70
77
|
|
|
71
78
|
Alias: `coze org`
|
|
72
79
|
|
|
73
80
|
### `coze space` — Workspace Management
|
|
74
81
|
|
|
82
|
+
View and switch workspaces to set the default Space ID for subsequent commands.
|
|
83
|
+
|
|
75
84
|
| Command | Description |
|
|
76
85
|
|---|---|
|
|
77
86
|
| `coze space list` | List all spaces under the current organization |
|
|
@@ -81,92 +90,302 @@ Alias: `coze org`
|
|
|
81
90
|
|
|
82
91
|
#### Project
|
|
83
92
|
|
|
93
|
+
Manage Coze Coding projects. Supports creating, viewing, listing, and deleting projects across various types.
|
|
94
|
+
|
|
84
95
|
| Command | Description |
|
|
85
96
|
|---|---|
|
|
86
97
|
| `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 <
|
|
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) |
|
|
101
|
+
|
|
102
|
+
Alias: `coze code proj`
|
|
90
103
|
|
|
91
104
|
```bash
|
|
92
|
-
# Create
|
|
93
|
-
coze code project create
|
|
105
|
+
# Create a Web project
|
|
106
|
+
coze code project create -m "Create a chatbot" --type web
|
|
94
107
|
|
|
95
|
-
#
|
|
108
|
+
# Create and wait for the initial build to complete
|
|
109
|
+
coze code project create -m "Create a data dashboard" --type app --wait
|
|
110
|
+
|
|
111
|
+
# List projects with filters
|
|
112
|
+
coze code project list --type agent --type workflow
|
|
113
|
+
coze code project list --name "customer service"
|
|
114
|
+
coze code project list --size 20 --has-published true
|
|
96
115
|
```
|
|
97
116
|
|
|
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 |
|
|
140
|
+
|
|
98
141
|
#### Message
|
|
99
142
|
|
|
143
|
+
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
|
+
|
|
100
145
|
| Command | Description |
|
|
101
146
|
|---|---|
|
|
102
147
|
| `coze code message send [message]` | Send a prompt message to a project chat |
|
|
103
|
-
| `coze code message status` |
|
|
148
|
+
| `coze code message status` | Query message status and get result when completed |
|
|
104
149
|
| `coze code message cancel` | Cancel an ongoing message |
|
|
105
150
|
|
|
106
151
|
```bash
|
|
107
152
|
# Send a message to a project
|
|
108
|
-
coze code message send "Fix the login bug"
|
|
153
|
+
coze code message send "Fix the login bug" -p 123456
|
|
154
|
+
|
|
155
|
+
# Mention local files with @ syntax for upload as context
|
|
156
|
+
coze code message send "Refactor @src/utils.ts to use async/await" -p 123456
|
|
157
|
+
|
|
158
|
+
# Mention multiple files
|
|
159
|
+
coze code message send "Compare @src/old.ts and @src/new.ts" -p 123456
|
|
109
160
|
|
|
110
161
|
# Pipe context via stdin
|
|
111
|
-
cat error.log | coze code message send "Analyze this error"
|
|
162
|
+
cat error.log | coze code message send "Analyze this error" -p 123456
|
|
163
|
+
|
|
164
|
+
# Check message status (auto-fetches result when completed)
|
|
165
|
+
coze code message status -p 123456
|
|
166
|
+
|
|
167
|
+
# Cancel an ongoing message
|
|
168
|
+
coze code message cancel -p 123456
|
|
169
|
+
|
|
170
|
+
# Use environment variable for project ID
|
|
171
|
+
export COZE_PROJECT_ID=123456
|
|
172
|
+
coze code message send "Hello"
|
|
112
173
|
```
|
|
113
174
|
|
|
175
|
+
**`message` options (shared by all subcommands):**
|
|
176
|
+
|
|
177
|
+
| Option | Description |
|
|
178
|
+
|---|---|
|
|
179
|
+
| `-p, --project-id <id>` | Coze project ID (or env `COZE_PROJECT_ID`) |
|
|
180
|
+
|
|
114
181
|
#### Deploy
|
|
115
182
|
|
|
183
|
+
Deploy projects to the production environment. Supports multiple project types including Agent, Workflow, Skill, Web, Mini-program, etc.
|
|
184
|
+
|
|
116
185
|
| Command | Description |
|
|
117
186
|
|---|---|
|
|
118
187
|
| `coze code deploy <projectId>` | Deploy a project to production |
|
|
119
188
|
| `coze code deploy <projectId> --wait` | Deploy and wait for completion |
|
|
120
189
|
| `coze code deploy status <projectId>` | Check deployment status |
|
|
121
190
|
|
|
191
|
+
```bash
|
|
192
|
+
# Deploy a project
|
|
193
|
+
coze code deploy <projectId>
|
|
194
|
+
|
|
195
|
+
# Deploy and wait for completion
|
|
196
|
+
coze code deploy <projectId> --wait
|
|
197
|
+
|
|
198
|
+
# Check latest deployment status
|
|
199
|
+
coze code deploy status <projectId>
|
|
200
|
+
|
|
201
|
+
# Check a specific deployment record
|
|
202
|
+
coze code deploy status <projectId> --deploy-id <deployHistoryId>
|
|
203
|
+
```
|
|
204
|
+
|
|
122
205
|
#### Environment Variables
|
|
123
206
|
|
|
207
|
+
Manage project environment variables (Secrets). Supports development and production environments.
|
|
208
|
+
|
|
124
209
|
| Command | Description |
|
|
125
210
|
|---|---|
|
|
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 |
|
|
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 |
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# List dev environment variables (default)
|
|
217
|
+
coze code env list -p <projectId>
|
|
218
|
+
|
|
219
|
+
# List prod environment variables
|
|
220
|
+
coze code env list -p <projectId> --env prod
|
|
221
|
+
|
|
222
|
+
# Set an environment variable
|
|
223
|
+
coze code env set API_KEY sk-xxxxx -p <projectId>
|
|
224
|
+
|
|
225
|
+
# Delete an environment variable
|
|
226
|
+
coze code env delete API_KEY -p <projectId>
|
|
227
|
+
```
|
|
129
228
|
|
|
130
229
|
#### Domain
|
|
131
230
|
|
|
231
|
+
Manage custom domains for deployed projects.
|
|
232
|
+
|
|
132
233
|
| Command | Description |
|
|
133
234
|
|---|---|
|
|
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 |
|
|
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 |
|
|
137
238
|
|
|
138
239
|
#### Skill
|
|
139
240
|
|
|
241
|
+
Manage skills associated with a project to extend its capabilities.
|
|
242
|
+
|
|
140
243
|
| Command | Description |
|
|
141
244
|
|---|---|
|
|
142
|
-
| `coze code skill list
|
|
143
|
-
| `coze code skill add
|
|
144
|
-
| `coze code skill remove
|
|
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 |
|
|
145
248
|
|
|
146
249
|
#### Preview
|
|
147
250
|
|
|
251
|
+
Get the sandbox preview URL for a project.
|
|
252
|
+
|
|
148
253
|
| Command | Description |
|
|
149
254
|
|---|---|
|
|
150
|
-
| `coze code preview
|
|
255
|
+
| `coze code preview <projectId>` | Get the project preview URL |
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Get the preview URL (sandbox initialization takes 1-3 minutes)
|
|
259
|
+
coze code preview <projectId>
|
|
260
|
+
```
|
|
151
261
|
|
|
152
262
|
### `coze generate` — Media Generation
|
|
153
263
|
|
|
264
|
+
Generate images, audio, and video using Coze AI models. All `generate` subcommands support `--output-path <path>` to save generated media to disk.
|
|
265
|
+
|
|
266
|
+
#### Image Generation
|
|
267
|
+
|
|
154
268
|
```bash
|
|
155
|
-
# Generate an image
|
|
269
|
+
# Generate an image from text
|
|
156
270
|
coze generate image "A sunset over the mountains"
|
|
157
271
|
|
|
158
|
-
#
|
|
272
|
+
# Save to a specific path
|
|
273
|
+
coze generate image "A logo design" --output-path ./assets
|
|
274
|
+
|
|
275
|
+
# Specify size (2K, 4K, or WIDTHxHEIGHT)
|
|
276
|
+
coze generate image "A futuristic city" --size 4K
|
|
277
|
+
|
|
278
|
+
# Disable watermark
|
|
279
|
+
coze generate image "A cat" --no-watermark
|
|
280
|
+
|
|
281
|
+
# Use reference image(s)
|
|
282
|
+
coze generate image "Similar style" --image https://example.com/ref.png
|
|
283
|
+
|
|
284
|
+
# Enable sequential (group) image generation
|
|
285
|
+
coze generate image "A storyboard" --sequential auto --max-images 5
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**`generate image` options:**
|
|
289
|
+
|
|
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 |
|
|
300
|
+
|
|
301
|
+
#### Audio Generation (TTS)
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# Basic text-to-speech
|
|
159
305
|
coze generate audio "Hello, welcome to Coze"
|
|
160
306
|
|
|
161
|
-
#
|
|
162
|
-
coze generate
|
|
307
|
+
# Save to file
|
|
308
|
+
coze generate audio "Hello" --output-path ./audio.mp3
|
|
163
309
|
|
|
164
|
-
#
|
|
165
|
-
|
|
310
|
+
# Use SSML input
|
|
311
|
+
echo "<speak>Hello</speak>" | coze generate audio --ssml
|
|
312
|
+
|
|
313
|
+
# Custom speaker and audio encoding
|
|
314
|
+
coze generate audio "Hello" --speaker zh_female_xiaohe_uranus_bigtts --audio-format ogg_opus
|
|
166
315
|
```
|
|
167
316
|
|
|
317
|
+
**`generate audio` options:**
|
|
318
|
+
|
|
319
|
+
| Option | Default | Description |
|
|
320
|
+
|---|---|---|
|
|
321
|
+
| `--speaker <speaker>` | `zh_female_xiaohe_uranus_bigtts` | Voice speaker |
|
|
322
|
+
| `--audio-format <fmt>` | `mp3` | Audio encoding: `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 |
|
|
328
|
+
|
|
329
|
+
#### Video Generation
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Create a video generation task
|
|
333
|
+
coze generate video create "A cat playing piano"
|
|
334
|
+
|
|
335
|
+
# Create a task and wait for completion
|
|
336
|
+
coze generate video create "A dancing kitten" --wait
|
|
337
|
+
|
|
338
|
+
# Save to a specific path
|
|
339
|
+
coze generate video create "A dancing kitten" --wait --output-path ./video.mp4
|
|
340
|
+
|
|
341
|
+
# Custom resolution and aspect ratio
|
|
342
|
+
coze generate video create "A landscape" --resolution 1080p --ratio 16:9
|
|
343
|
+
|
|
344
|
+
# Use reference images
|
|
345
|
+
coze generate video create "Animate this" --first-frame https://example.com/frame.png
|
|
346
|
+
coze generate video create "In this style" --reference-image https://example.com/ref.png
|
|
347
|
+
|
|
348
|
+
# Query task status later
|
|
349
|
+
coze generate video status task_123
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Use `coze generate video create` to submit generation tasks, and `coze generate video status <taskId>` to query existing tasks.
|
|
353
|
+
|
|
354
|
+
**`generate video create` options:**
|
|
355
|
+
|
|
356
|
+
| Option | Default | Description |
|
|
357
|
+
|---|---|---|
|
|
358
|
+
| `--model <model>` | `doubao-seedance-1-5-pro-251215` | Video generation model |
|
|
359
|
+
| `--callback-url <url>` | — | Callback URL for task status changes |
|
|
360
|
+
| `--resolution <res>` | `720p` | Resolution: `480p` \| `720p` \| `1080p` |
|
|
361
|
+
| `--ratio <ratio>` | `16:9` | Aspect ratio (e.g., `16:9`, `9:16`, `1:1`) |
|
|
362
|
+
| `--size <size>` | — | Derive ratio/resolution from `WIDTHxHEIGHT` |
|
|
363
|
+
| `--duration <seconds>` | `5` | Duration in seconds (4–12) |
|
|
364
|
+
| `--no-watermark` | enabled | Disable watermark |
|
|
365
|
+
| `--seed <seed>` | — | Random seed for reproducibility |
|
|
366
|
+
| `--camerafixed` | `false` | Fix camera position (reduce motion) |
|
|
367
|
+
| `--no-generate-audio` | generates audio | Do not generate accompanying audio |
|
|
368
|
+
| `--first-frame <url>` | — | First frame image URL |
|
|
369
|
+
| `--last-frame <url>` | — | Last frame image URL |
|
|
370
|
+
| `--reference-image <url>` | — | Reference image URL (repeatable) |
|
|
371
|
+
| `--return-last-frame` | `false` | Return last frame URL in output |
|
|
372
|
+
| `--wait` | `false` | Poll until completion instead of returning `taskId` immediately |
|
|
373
|
+
| `--output-path <path>` | — | Directory to save generated video |
|
|
374
|
+
|
|
375
|
+
**`generate video status` options:**
|
|
376
|
+
|
|
377
|
+
| Option | Default | Description |
|
|
378
|
+
|---|---|---|
|
|
379
|
+
| `--output <format>` | `text` | Output format: `text` \| `json` |
|
|
380
|
+
|
|
168
381
|
### `coze file` — File Operations
|
|
169
382
|
|
|
383
|
+
Upload local files to Coze for use as attachments or context in projects.
|
|
384
|
+
|
|
385
|
+
| Command | Description |
|
|
386
|
+
|---|---|
|
|
387
|
+
| `coze file upload <path>` | Upload a local file |
|
|
388
|
+
|
|
170
389
|
```bash
|
|
171
390
|
# Upload a file
|
|
172
391
|
coze file upload ./document.pdf
|
|
@@ -174,20 +393,43 @@ coze file upload ./document.pdf
|
|
|
174
393
|
|
|
175
394
|
### `coze config` — Configuration
|
|
176
395
|
|
|
177
|
-
|
|
396
|
+
Manage CLI configuration stored in `~/.coze/config.json` (global) and `.cozerc.json` (project-level).
|
|
178
397
|
|
|
179
398
|
| Command | Description |
|
|
180
399
|
|---|---|
|
|
181
400
|
| `coze config list` | List all configuration items with sources |
|
|
182
|
-
| `coze config get <
|
|
401
|
+
| `coze config get <keys...>` | Get one or more configuration values |
|
|
183
402
|
| `coze config set <key> <value>` | Set a configuration value |
|
|
184
|
-
| `coze config delete <
|
|
403
|
+
| `coze config delete <keys...>` | Delete one or more configuration items |
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
# List all configurations with their sources (env, local, global, default)
|
|
407
|
+
coze config list
|
|
408
|
+
|
|
409
|
+
# Get a single config value
|
|
410
|
+
coze config get spaceId
|
|
411
|
+
|
|
412
|
+
# Get multiple config values
|
|
413
|
+
coze config get apiBaseUrl spaceId organizationId
|
|
414
|
+
|
|
415
|
+
# Set a configuration value
|
|
416
|
+
coze config set spaceId 123456789
|
|
417
|
+
|
|
418
|
+
# Delete configuration keys
|
|
419
|
+
coze config delete spaceId
|
|
420
|
+
coze config delete spaceId apiBaseUrl
|
|
421
|
+
```
|
|
185
422
|
|
|
186
423
|
### `coze completion` — Shell Autocompletion
|
|
187
424
|
|
|
425
|
+
Set up or remove shell autocompletion for bash/zsh.
|
|
426
|
+
|
|
188
427
|
```bash
|
|
189
|
-
#
|
|
428
|
+
# Install shell completion script
|
|
190
429
|
coze completion --setup
|
|
430
|
+
|
|
431
|
+
# Remove shell completion script
|
|
432
|
+
coze completion --cleanup
|
|
191
433
|
```
|
|
192
434
|
|
|
193
435
|
## Global Options
|
|
@@ -196,14 +438,17 @@ coze completion --setup
|
|
|
196
438
|
|---|---|
|
|
197
439
|
| `-h, --help` | Show help |
|
|
198
440
|
| `-v, --version` | Show version |
|
|
199
|
-
| `--format <fmt>` | Output format: `json` or `text` (default: `
|
|
441
|
+
| `--format <fmt>` | Output format: `json` or `text` (default: `json`) |
|
|
200
442
|
| `--no-color` | Disable ANSI color output |
|
|
201
443
|
| `--config <path>` | Use a custom configuration file |
|
|
202
444
|
| `--org-id <id>` | Override the default Organization ID |
|
|
203
445
|
| `--space-id <id>` | Override the default Space ID |
|
|
204
|
-
| `--verbose` | Enable verbose
|
|
205
|
-
| `--debug` | Enable debug mode |
|
|
446
|
+
| `--verbose` | Enable verbose mode with detailed process information |
|
|
447
|
+
| `--debug` | Enable debug mode with all log output for diagnosing issues |
|
|
206
448
|
| `--log-file <path>` | Write logs to a file |
|
|
449
|
+
| `--man` | Show full manual information |
|
|
450
|
+
| `--schema` | Output the command's JSON Schema |
|
|
451
|
+
| `--commands` | Output the list of subcommands |
|
|
207
452
|
|
|
208
453
|
## Configuration
|
|
209
454
|
|
|
@@ -223,6 +468,23 @@ The CLI reads configuration from multiple sources with the following priority (h
|
|
|
223
468
|
| `COZE_ORG_ID` | Default Organization ID |
|
|
224
469
|
| `COZE_ENTERPRISE_ID` | Default Enterprise ID |
|
|
225
470
|
| `COZE_SPACE_ID` | Default Space ID |
|
|
471
|
+
| `COZE_PROJECT_ID` | Default Project ID (used by `message` commands) |
|
|
472
|
+
|
|
473
|
+
## Exit Codes
|
|
474
|
+
|
|
475
|
+
| Code | Name | Description |
|
|
476
|
+
|---|---|---|
|
|
477
|
+
| `0` | `SUCCESS` | Command completed successfully |
|
|
478
|
+
| `1` | `GENERAL_ERROR` | General error |
|
|
479
|
+
| `2` | `AUTH_FAILED` | Authentication failed |
|
|
480
|
+
| `3` | `RESOURCE_NOT_FOUND` | Requested resource not found |
|
|
481
|
+
| `4` | `INVALID_ARGUMENT` | Invalid argument or option |
|
|
482
|
+
| `5` | `PERMISSION_DENIED` | Permission denied |
|
|
483
|
+
| `6` | `NETWORK_ERROR` | Network error |
|
|
484
|
+
| `7` | `SERVER_ERROR` | Server error |
|
|
485
|
+
| `8` | `TIMEOUT` | Operation timed out |
|
|
486
|
+
| `9` | `QUOTA_EXCEEDED` | Quota exceeded |
|
|
487
|
+
| `10` | `CONFLICT` | Resource conflict |
|
|
226
488
|
|
|
227
489
|
## CI/CD Usage
|
|
228
490
|
|
|
@@ -232,10 +494,20 @@ export COZE_API_TOKEN=<YOUR_PAT>
|
|
|
232
494
|
export COZE_ORG_ID=<ORG_ID>
|
|
233
495
|
export COZE_SPACE_ID=<SPACE_ID>
|
|
234
496
|
|
|
235
|
-
#
|
|
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
|
|
236
505
|
coze code deploy <projectId> --wait --format json
|
|
506
|
+
|
|
507
|
+
# Check deployment status
|
|
508
|
+
coze code deploy status <projectId> --format json
|
|
237
509
|
```
|
|
238
510
|
|
|
239
511
|
## License
|
|
240
512
|
|
|
241
|
-
|
|
513
|
+
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
|
|