@getlark/cli 0.3.0
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 +483 -0
- package/dist/api/client.d.ts +79 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +179 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/types.d.ts +143 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +2 -0
- package/dist/api/types.js.map +1 -0
- package/dist/commands/archive-workflow.d.ts +3 -0
- package/dist/commands/archive-workflow.d.ts.map +1 -0
- package/dist/commands/archive-workflow.js +47 -0
- package/dist/commands/archive-workflow.js.map +1 -0
- package/dist/commands/create-workflow.d.ts +3 -0
- package/dist/commands/create-workflow.d.ts.map +1 -0
- package/dist/commands/create-workflow.js +39 -0
- package/dist/commands/create-workflow.js.map +1 -0
- package/dist/commands/events.d.ts +3 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +34 -0
- package/dist/commands/events.js.map +1 -0
- package/dist/commands/execution.d.ts +3 -0
- package/dist/commands/execution.d.ts.map +1 -0
- package/dist/commands/execution.js +76 -0
- package/dist/commands/execution.js.map +1 -0
- package/dist/commands/generations.d.ts +3 -0
- package/dist/commands/generations.d.ts.map +1 -0
- package/dist/commands/generations.js +30 -0
- package/dist/commands/generations.js.map +1 -0
- package/dist/commands/get-workflow.d.ts +3 -0
- package/dist/commands/get-workflow.d.ts.map +1 -0
- package/dist/commands/get-workflow.js +26 -0
- package/dist/commands/get-workflow.js.map +1 -0
- package/dist/commands/invoke.d.ts +3 -0
- package/dist/commands/invoke.d.ts.map +1 -0
- package/dist/commands/invoke.js +216 -0
- package/dist/commands/invoke.js.map +1 -0
- package/dist/commands/list-workflows.d.ts +3 -0
- package/dist/commands/list-workflows.d.ts.map +1 -0
- package/dist/commands/list-workflows.js +33 -0
- package/dist/commands/list-workflows.js.map +1 -0
- package/dist/commands/repairs.d.ts +3 -0
- package/dist/commands/repairs.d.ts.map +1 -0
- package/dist/commands/repairs.js +123 -0
- package/dist/commands/repairs.js.map +1 -0
- package/dist/commands/secret-contexts.d.ts +3 -0
- package/dist/commands/secret-contexts.d.ts.map +1 -0
- package/dist/commands/secret-contexts.js +152 -0
- package/dist/commands/secret-contexts.js.map +1 -0
- package/dist/commands/update-workflow.d.ts +3 -0
- package/dist/commands/update-workflow.d.ts.map +1 -0
- package/dist/commands/update-workflow.js +48 -0
- package/dist/commands/update-workflow.js.map +1 -0
- package/dist/commands/workflow-groups.d.ts +3 -0
- package/dist/commands/workflow-groups.d.ts.map +1 -0
- package/dist/commands/workflow-groups.js +126 -0
- package/dist/commands/workflow-groups.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
# LarkCI CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for creating, invoking, and managing [LarkCI](https://getlark.ai) testing workflows.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Quickstart](#quickstart)
|
|
8
|
+
- [Configuration](#configuration)
|
|
9
|
+
- [CI Pipeline Usage](#ci-pipeline-usage)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [workflows](#commands) — create, get, update, list, archive, invoke
|
|
12
|
+
- [workflows executions](#workflows-executions-get--get-execution-details) — get, logs, cancel
|
|
13
|
+
- [workflows repairs](#workflows-repairs-trigger--trigger-a-workflow-repair) — trigger, list, get, cancel, logs
|
|
14
|
+
- [workflows generations](#workflows-generations-cancel--cancel-a-running-generation) — cancel
|
|
15
|
+
- [workflows events](#workflows-events-list--list-workflow-events) — list
|
|
16
|
+
- [workflow-groups](#workflow-groups-create--create-a-workflow-group) — create, list, get, update, delete
|
|
17
|
+
- [secret-contexts](#secret-contexts-list--list-secret-contexts) — list, get, create, update, delete, delete-key
|
|
18
|
+
- [Examples](#examples)
|
|
19
|
+
- [Contributing](#contributing)
|
|
20
|
+
- [License](#license)
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
Requires Node.js >= 18.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx -y larkci@latest workflows invoke --all --wait
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or install globally:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install -g larkci@latest
|
|
34
|
+
|
|
35
|
+
larkci workflows invoke --all --wait
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
Set your API key as an environment variable:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
export LARKCI_API_KEY=your-api-key
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Alternatively, pass it inline with the `--api-key` flag (see [Global Options](#global-options)).
|
|
47
|
+
|
|
48
|
+
The CLI also supports a `.env` file in the current directory.
|
|
49
|
+
|
|
50
|
+
## CI Pipeline Usage
|
|
51
|
+
|
|
52
|
+
The `--wait` flag makes it easy to use in CI pipelines. The command will block until the workflow completes and exit with a non-zero code on failure.
|
|
53
|
+
|
|
54
|
+
### GitHub Actions Example
|
|
55
|
+
|
|
56
|
+
Set the `LARKCI_API_KEY` environment variable in GitHub Actions secrets.
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- name: Run LarkCI Tests
|
|
60
|
+
run: npx -y larkci@latest workflows invoke --all --wait
|
|
61
|
+
env:
|
|
62
|
+
LARKCI_API_KEY: ${{ secrets.LARKCI_API_KEY }}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### CircleCI Example
|
|
66
|
+
|
|
67
|
+
Set the `LARKCI_API_KEY` environment variable in CircleCI.
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
larkci_tests:
|
|
71
|
+
docker:
|
|
72
|
+
- image: cimg/node:lts
|
|
73
|
+
resource_class: small
|
|
74
|
+
steps:
|
|
75
|
+
- run:
|
|
76
|
+
name: Run LarkCI Tests
|
|
77
|
+
command: |
|
|
78
|
+
npx -y larkci@latest workflows invoke --all --wait
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
larkci [options] <command>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Global Options
|
|
88
|
+
|
|
89
|
+
| Flag | Description |
|
|
90
|
+
| ----------------- | -------------------------------------------- |
|
|
91
|
+
| `--api-key <key>` | API key (overrides `LARKCI_API_KEY` env var) |
|
|
92
|
+
| `-V, --version` | Display the current version |
|
|
93
|
+
| `-h, --help` | Display help |
|
|
94
|
+
|
|
95
|
+
### Commands
|
|
96
|
+
|
|
97
|
+
#### `workflows create` — Create a workflow
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
larkci workflows create --name "login-flow" --description "Test the login process end-to-end"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Flag | Required | Description | Default |
|
|
104
|
+
| --------------------------------- | -------- | ---------------------------------------------- | ----------- |
|
|
105
|
+
| `--name <name>` | Yes | Workflow name | |
|
|
106
|
+
| `--description <description>` | Yes | Workflow description | |
|
|
107
|
+
| `--mode <mode>` | No | Execution mode: `ai_driven` or `deterministic` | `ai_driven` |
|
|
108
|
+
| `--secret-contexts <contexts...>` | No | Secret contexts to attach to the workflow | |
|
|
109
|
+
| `--group-id <groupId>` | No | Workflow group ID to assign this workflow to | |
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Create a deterministic workflow with secret contexts
|
|
113
|
+
larkci workflows create \
|
|
114
|
+
--name "checkout-flow" \
|
|
115
|
+
--description "Test the full checkout process" \
|
|
116
|
+
--mode deterministic \
|
|
117
|
+
--secret-contexts production staging
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### `workflows get` — Get workflow details
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
larkci workflows get <workflow_id>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Returns the full workflow resource including status, mode, schedule, and last execution/generation/repair info.
|
|
127
|
+
|
|
128
|
+
#### `workflows update` — Update a workflow
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
larkci workflows update <workflow_id> --name "new-name" --description "updated description"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
| Flag | Description |
|
|
135
|
+
| --------------------------------- | ----------------------------------------- |
|
|
136
|
+
| `--name <name>` | New name for the workflow |
|
|
137
|
+
| `--description <description>` | New description for the workflow |
|
|
138
|
+
| `--secret-contexts <contexts...>` | Secret contexts to attach |
|
|
139
|
+
| `--schedule <cron>` | Cron schedule for the workflow |
|
|
140
|
+
| `--group-id <groupId>` | Workflow group ID (use `null` to ungroup) |
|
|
141
|
+
|
|
142
|
+
At least one option is required.
|
|
143
|
+
|
|
144
|
+
#### `workflows archive` — Archive a workflow
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
larkci workflows archive <workflow_id>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Archived workflows are hidden from the default list and cannot be invoked until unarchived.
|
|
151
|
+
|
|
152
|
+
#### `workflows unarchive` — Unarchive a workflow
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
larkci workflows unarchive <workflow_id>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Restores an archived workflow so it appears in the list and can be invoked again.
|
|
159
|
+
|
|
160
|
+
#### `workflows list` — List workflows
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
larkci workflows list
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
| Flag | Description | Default |
|
|
167
|
+
| ---------------------- | ------------------------------- | ------- |
|
|
168
|
+
| `--limit <number>` | Max workflows to return (1–100) | `10` |
|
|
169
|
+
| `--offset <number>` | Number of workflows to skip | `0` |
|
|
170
|
+
| `--group-id <groupId>` | Filter workflows by group ID | |
|
|
171
|
+
|
|
172
|
+
#### `workflows invoke` — Invoke workflows
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Invoke all workflows and wait (up to 5 minutes) for completion
|
|
176
|
+
larkci workflows invoke --all --wait --timeout 300
|
|
177
|
+
|
|
178
|
+
# Invoke specific workflows and wait
|
|
179
|
+
larkci workflows invoke --workflow-ids wf_abc123 wf_def456 --wait --timeout 300
|
|
180
|
+
|
|
181
|
+
# Invoke all workflows in a group by ID
|
|
182
|
+
larkci workflows invoke --group-id wfl_grp_abc123 --wait
|
|
183
|
+
|
|
184
|
+
# Invoke all workflows in a group by name
|
|
185
|
+
larkci workflows invoke --group-name "Checkout Flow" --wait
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
| Flag | Description |
|
|
189
|
+
| -------------------------- | -------------------------------------------------------------------------------- |
|
|
190
|
+
| `--workflow-ids <id...>` | The IDs of the workflows to invoke |
|
|
191
|
+
| `--all` | Invoke all workflows |
|
|
192
|
+
| `--group-id <groupId>` | Invoke all workflows in a group (by group ID) |
|
|
193
|
+
| `--group-name <groupName>` | Invoke all workflows in a group (by group name) |
|
|
194
|
+
| `--wait` | Wait for the execution to finish (successfully or unsuccessfully) before exiting |
|
|
195
|
+
| `--timeout <seconds>` | Maximum time to wait in seconds (default: 600, requires `--wait`) |
|
|
196
|
+
| `--verbose` | Print verbose output (includes logs) |
|
|
197
|
+
|
|
198
|
+
One of `--workflow-ids`, `--all`, `--group-id`, or `--group-name` is required.
|
|
199
|
+
|
|
200
|
+
Exit codes: `0` = success, `1` = workflow failure, `2` = timeout, `3` = unexpected error.
|
|
201
|
+
|
|
202
|
+
#### `workflows executions get` — Get execution details
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
larkci workflows executions get <workflow_id> <execution_id>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
#### `workflows executions logs` — Get execution logs
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
larkci workflows executions logs <workflow_id> <execution_id>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### `workflows executions cancel` — Cancel a running execution
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
larkci workflows executions cancel <workflow_id> <execution_id>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
#### `workflows repairs trigger` — Trigger a workflow repair
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
larkci workflows repairs trigger <workflow_id>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Triggers a repair for a workflow. Returns the repair resource.
|
|
227
|
+
|
|
228
|
+
#### `workflows repairs list` — List workflow repairs
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
larkci workflows repairs list <workflow_id>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
| Flag | Description | Default |
|
|
235
|
+
| ------------------- | ----------------------------- | ------- |
|
|
236
|
+
| `--limit <number>` | Max repairs to return (1–100) | `10` |
|
|
237
|
+
| `--offset <number>` | Number of repairs to skip | `0` |
|
|
238
|
+
|
|
239
|
+
#### `workflows repairs get` — Get repair details
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
larkci workflows repairs get <workflow_id> <repair_id>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### `workflows repairs cancel` — Cancel a running repair
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
larkci workflows repairs cancel <workflow_id> <repair_id>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### `workflows repairs logs` — Get repair logs
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
larkci workflows repairs logs <workflow_id> <repair_id>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
#### `workflows generations cancel` — Cancel a running generation
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
larkci workflows generations cancel <workflow_id> <generation_id>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### `workflows events list` — List workflow events
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
larkci workflows events list <workflow_id>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
| Flag | Description | Default |
|
|
270
|
+
| ------------------- | ---------------------------- | ------- |
|
|
271
|
+
| `--limit <number>` | Max events to return (1–100) | `10` |
|
|
272
|
+
| `--offset <number>` | Number of events to skip | `0` |
|
|
273
|
+
|
|
274
|
+
Lists all events (generations, executions, repairs) for a workflow.
|
|
275
|
+
|
|
276
|
+
#### `workflow-groups create` — Create a workflow group
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
larkci workflow-groups create --name "Checkout Flow"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
| Flag | Required | Description |
|
|
283
|
+
| --------------- | -------- | -------------------------- |
|
|
284
|
+
| `--name <name>` | Yes | Name of the workflow group |
|
|
285
|
+
|
|
286
|
+
#### `workflow-groups list` — List workflow groups
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
larkci workflow-groups list
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
| Flag | Description | Default |
|
|
293
|
+
| ------------------- | ---------------------------- | ------- |
|
|
294
|
+
| `--limit <number>` | Max groups to return (1–100) | `10` |
|
|
295
|
+
| `--offset <number>` | Number of groups to skip | `0` |
|
|
296
|
+
|
|
297
|
+
#### `workflow-groups get` — Get a workflow group
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
larkci workflow-groups get <group_id>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
#### `workflow-groups update` — Update a workflow group
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
larkci workflow-groups update <group_id> --name "Updated Name"
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
| Flag | Description |
|
|
310
|
+
| --------------- | ------------------------------- |
|
|
311
|
+
| `--name <name>` | New name for the workflow group |
|
|
312
|
+
|
|
313
|
+
#### `workflow-groups delete` — Delete a workflow group
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
larkci workflow-groups delete <group_id>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Workflows in the group become ungrouped.
|
|
320
|
+
|
|
321
|
+
#### `secret-contexts list` — List secret contexts
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
larkci secret-contexts list
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Returns all secret context names and metadata for your account. Does not return secret values.
|
|
328
|
+
|
|
329
|
+
#### `secret-contexts get` — Get a secret context
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
larkci secret-contexts get <context>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
Returns the context name and the list of key names stored in it. Does not return secret values.
|
|
336
|
+
|
|
337
|
+
#### `secret-contexts create` — Create or replace a secret context
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
larkci secret-contexts create --context production --secret username=admin --secret password=s3cret
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
| Flag | Required | Description |
|
|
344
|
+
| ---------------------- | -------- | -------------------------------------------------- |
|
|
345
|
+
| `--context <name>` | Yes | Name of the secret context |
|
|
346
|
+
| `--secret <key=value>` | Yes | Secret key-value pair (repeat for multiple values) |
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Create a secret context with multiple credentials
|
|
350
|
+
larkci secret-contexts create \
|
|
351
|
+
--context staging \
|
|
352
|
+
--secret api_key=sk_test_abc123 \
|
|
353
|
+
--secret username=testuser \
|
|
354
|
+
--secret password=testpass
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### `secret-contexts update` — Update a key in a secret context
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
larkci secret-contexts update <context> --key <key> --value <value>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
| Flag | Required | Description |
|
|
364
|
+
| ----------------- | -------- | --------------------------- |
|
|
365
|
+
| `--key <key>` | Yes | The key to create or update |
|
|
366
|
+
| `--value <value>` | Yes | The new value for the key |
|
|
367
|
+
|
|
368
|
+
If the key already exists its value is replaced; if it does not exist it is added.
|
|
369
|
+
|
|
370
|
+
#### `secret-contexts delete` — Delete a secret context
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
larkci secret-contexts delete <context>
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Permanently deletes a secret context. Workflows referencing it will no longer have access.
|
|
377
|
+
|
|
378
|
+
#### `secret-contexts delete-key` — Delete a key from a secret context
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
larkci secret-contexts delete-key <context> <key>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Removes a single key-value pair from an existing secret context.
|
|
385
|
+
|
|
386
|
+
### Examples
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
# Create a workflow
|
|
390
|
+
larkci workflows create --name "signup-flow" --description "Test user signup"
|
|
391
|
+
|
|
392
|
+
# Get workflow details
|
|
393
|
+
larkci workflows get wf_abc123
|
|
394
|
+
|
|
395
|
+
# Update a workflow
|
|
396
|
+
larkci workflows update wf_abc123 --name "updated-signup-flow" --schedule "0 9 * * *"
|
|
397
|
+
|
|
398
|
+
# List your workflows
|
|
399
|
+
larkci workflows list --limit 20
|
|
400
|
+
|
|
401
|
+
# List workflows in a group
|
|
402
|
+
larkci workflows list --group-id grp_abc123
|
|
403
|
+
|
|
404
|
+
# Archive a workflow
|
|
405
|
+
larkci workflows archive wf_abc123
|
|
406
|
+
|
|
407
|
+
# Unarchive a workflow
|
|
408
|
+
larkci workflows unarchive wf_abc123
|
|
409
|
+
|
|
410
|
+
# Invoke a workflow but don't wait for completion
|
|
411
|
+
larkci workflows invoke --workflow-ids wf_abc123
|
|
412
|
+
|
|
413
|
+
# Invoke and wait for completion (10 min default timeout)
|
|
414
|
+
larkci workflows invoke --workflow-ids wf_abc123 --wait
|
|
415
|
+
|
|
416
|
+
# Invoke and wait (up to 5 minutes) with verbose logs
|
|
417
|
+
larkci workflows invoke --workflow-ids wf_abc123 --wait --timeout 300 --verbose
|
|
418
|
+
|
|
419
|
+
# Invoke all workflows in a group by ID
|
|
420
|
+
larkci workflows invoke --group-id wfl_grp_abc123 --wait
|
|
421
|
+
|
|
422
|
+
# Invoke all workflows in a group by name
|
|
423
|
+
larkci workflows invoke --group-name "Checkout Flow" --wait
|
|
424
|
+
|
|
425
|
+
# Check execution status
|
|
426
|
+
larkci workflows executions get wf_abc123 exec_xyz789
|
|
427
|
+
|
|
428
|
+
# Fetch execution logs
|
|
429
|
+
larkci workflows executions logs wf_abc123 exec_xyz789
|
|
430
|
+
|
|
431
|
+
# Cancel a running execution
|
|
432
|
+
larkci workflows executions cancel wf_abc123 exec_xyz789
|
|
433
|
+
|
|
434
|
+
# Trigger a repair
|
|
435
|
+
larkci workflows repairs trigger wf_abc123
|
|
436
|
+
|
|
437
|
+
# List repairs
|
|
438
|
+
larkci workflows repairs list wf_abc123
|
|
439
|
+
|
|
440
|
+
# Cancel a generation
|
|
441
|
+
larkci workflows generations cancel wf_abc123 gen_xyz789
|
|
442
|
+
|
|
443
|
+
# List events
|
|
444
|
+
larkci workflows events list wf_abc123
|
|
445
|
+
|
|
446
|
+
# Create a workflow group
|
|
447
|
+
larkci workflow-groups create --name "Checkout Flow"
|
|
448
|
+
|
|
449
|
+
# List workflow groups
|
|
450
|
+
larkci workflow-groups list
|
|
451
|
+
|
|
452
|
+
# Delete a workflow group
|
|
453
|
+
larkci workflow-groups delete grp_abc123
|
|
454
|
+
|
|
455
|
+
# Override API key inline
|
|
456
|
+
larkci --api-key sk-test-key workflows invoke --workflow-ids wf_abc123
|
|
457
|
+
|
|
458
|
+
# Store credentials for a secret context
|
|
459
|
+
larkci secret-contexts create --context production --secret username=admin --secret password=s3cret
|
|
460
|
+
|
|
461
|
+
# Update a single key in a secret context
|
|
462
|
+
larkci secret-contexts update production --key password --value new-s3cret
|
|
463
|
+
|
|
464
|
+
# List all secret contexts
|
|
465
|
+
larkci secret-contexts list
|
|
466
|
+
|
|
467
|
+
# View the keys stored in a secret context
|
|
468
|
+
larkci secret-contexts get production
|
|
469
|
+
|
|
470
|
+
# Delete a key from a secret context
|
|
471
|
+
larkci secret-contexts delete-key production password
|
|
472
|
+
|
|
473
|
+
# Delete a secret context
|
|
474
|
+
larkci secret-contexts delete production
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
## Contributing
|
|
478
|
+
|
|
479
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|
|
480
|
+
|
|
481
|
+
## License
|
|
482
|
+
|
|
483
|
+
ISC
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Config } from "../config.js";
|
|
2
|
+
import type { GetSecretContextResponse, ListSecretContextsResponse, ListWorkflowEventsResponse, ListWorkflowGroupsResponse, ListWorkflowRepairsResponse, ListWorkflowsResponse, WorkflowExecutionResource, WorkflowGenerationResource, WorkflowGroupResource, WorkflowRepairResource, WorkflowResource } from "./types.js";
|
|
3
|
+
export declare class TimeoutError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export interface PollOptions {
|
|
7
|
+
timeoutMs: number;
|
|
8
|
+
pollIntervalMs: number;
|
|
9
|
+
onPoll?: (execution: WorkflowExecutionResource, elapsedMs: number) => void | Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare class LarkCIClient {
|
|
12
|
+
private baseUrl;
|
|
13
|
+
private apiKey;
|
|
14
|
+
constructor(config: Config);
|
|
15
|
+
private request;
|
|
16
|
+
private buildQueryPath;
|
|
17
|
+
createWorkflow(options: {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
secret_contexts?: string[];
|
|
21
|
+
mode?: "ai_driven" | "deterministic";
|
|
22
|
+
group_id?: string;
|
|
23
|
+
}): Promise<WorkflowResource>;
|
|
24
|
+
getWorkflow(workflowId: string): Promise<WorkflowResource>;
|
|
25
|
+
updateWorkflow(workflowId: string, options: {
|
|
26
|
+
name?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
secret_contexts?: string[];
|
|
29
|
+
schedule?: string | null;
|
|
30
|
+
group_id?: string | null;
|
|
31
|
+
}): Promise<WorkflowResource>;
|
|
32
|
+
archiveWorkflow(workflowId: string): Promise<WorkflowResource>;
|
|
33
|
+
unarchiveWorkflow(workflowId: string): Promise<WorkflowResource>;
|
|
34
|
+
invokeWorkflow(workflowId: string): Promise<WorkflowExecutionResource>;
|
|
35
|
+
listWorkflows(options?: {
|
|
36
|
+
limit?: number;
|
|
37
|
+
offset?: number;
|
|
38
|
+
group_id?: string;
|
|
39
|
+
}): Promise<ListWorkflowsResponse>;
|
|
40
|
+
getWorkflowExecution(workflowId: string, executionId: string): Promise<WorkflowExecutionResource>;
|
|
41
|
+
getWorkflowExecutionLogs(workflowId: string, executionId: string): Promise<string[]>;
|
|
42
|
+
cancelWorkflowExecution(workflowId: string, executionId: string): Promise<WorkflowExecutionResource>;
|
|
43
|
+
cancelWorkflowGeneration(workflowId: string, generationId: string): Promise<WorkflowGenerationResource>;
|
|
44
|
+
repairWorkflow(workflowId: string): Promise<WorkflowRepairResource>;
|
|
45
|
+
listWorkflowRepairs(workflowId: string, options?: {
|
|
46
|
+
limit?: number;
|
|
47
|
+
offset?: number;
|
|
48
|
+
}): Promise<ListWorkflowRepairsResponse>;
|
|
49
|
+
getWorkflowRepair(workflowId: string, repairId: string): Promise<WorkflowRepairResource>;
|
|
50
|
+
cancelWorkflowRepair(workflowId: string, repairId: string): Promise<WorkflowRepairResource>;
|
|
51
|
+
getWorkflowRepairLogs(workflowId: string, repairId: string): Promise<string[]>;
|
|
52
|
+
listWorkflowEvents(workflowId: string, options?: {
|
|
53
|
+
limit?: number;
|
|
54
|
+
offset?: number;
|
|
55
|
+
}): Promise<ListWorkflowEventsResponse>;
|
|
56
|
+
listSecretContexts(): Promise<ListSecretContextsResponse>;
|
|
57
|
+
getSecretContext(context: string): Promise<GetSecretContextResponse>;
|
|
58
|
+
createSecretContext(options: {
|
|
59
|
+
context: string;
|
|
60
|
+
value: Record<string, string>;
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
updateSecretContext(context: string, key: string, value: string): Promise<void>;
|
|
63
|
+
deleteSecretContext(context: string): Promise<void>;
|
|
64
|
+
deleteSecretContextKey(context: string, key: string): Promise<void>;
|
|
65
|
+
createWorkflowGroup(options: {
|
|
66
|
+
name: string;
|
|
67
|
+
}): Promise<WorkflowGroupResource>;
|
|
68
|
+
listWorkflowGroups(options?: {
|
|
69
|
+
limit?: number;
|
|
70
|
+
offset?: number;
|
|
71
|
+
}): Promise<ListWorkflowGroupsResponse>;
|
|
72
|
+
getWorkflowGroup(groupId: string): Promise<WorkflowGroupResource>;
|
|
73
|
+
updateWorkflowGroup(groupId: string, options: {
|
|
74
|
+
name?: string;
|
|
75
|
+
}): Promise<WorkflowGroupResource>;
|
|
76
|
+
deleteWorkflowGroup(groupId: string): Promise<void>;
|
|
77
|
+
pollWorkflowExecution(workflowId: string, executionId: string, options: PollOptions): Promise<WorkflowExecutionResource>;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;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