larkci 0.2.2 → 0.2.3
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 +86 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LarkCI CLI
|
|
2
2
|
|
|
3
|
-
Command-line interface for invoking and managing LarkCI testing workflows.
|
|
3
|
+
Command-line interface for creating, invoking, and managing [LarkCI](https://getlark.ai) testing workflows.
|
|
4
4
|
|
|
5
5
|
## Quickstart
|
|
6
6
|
|
|
@@ -28,6 +28,8 @@ export LARKCI_API_KEY=your-api-key
|
|
|
28
28
|
|
|
29
29
|
Alternatively, pass it inline with the `--api-key` flag (see [Global Options](#global-options)).
|
|
30
30
|
|
|
31
|
+
The CLI also supports a `.env` file in the current directory.
|
|
32
|
+
|
|
31
33
|
## Usage
|
|
32
34
|
|
|
33
35
|
```bash
|
|
@@ -44,53 +46,110 @@ larkci [options] <command>
|
|
|
44
46
|
|
|
45
47
|
### Commands
|
|
46
48
|
|
|
47
|
-
####
|
|
49
|
+
#### `workflows create` — Create a workflow
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
larkci workflows create --name "login-flow" --description "Test the login process end-to-end"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Flag | Required | Description | Default |
|
|
56
|
+
| --------------------------------- | -------- | ----------------------------------------------- | ------------ |
|
|
57
|
+
| `--name <name>` | Yes | Workflow name | |
|
|
58
|
+
| `--description <description>` | Yes | Workflow description | |
|
|
59
|
+
| `--mode <mode>` | No | Execution mode: `ai_driven` or `deterministic` | `ai_driven` |
|
|
60
|
+
| `--secret-contexts <contexts...>` | No | Secret contexts to attach to the workflow | |
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Create a deterministic workflow with secret contexts
|
|
64
|
+
larkci workflows create \
|
|
65
|
+
--name "checkout-flow" \
|
|
66
|
+
--description "Test the full checkout process" \
|
|
67
|
+
--mode deterministic \
|
|
68
|
+
--secret-contexts production staging
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### `workflows list` — List workflows
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
larkci workflows list
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
| Flag | Description | Default |
|
|
78
|
+
| ------------------ | ------------------------------- | ------- |
|
|
79
|
+
| `--limit <number>` | Max workflows to return (1–100) | `10` |
|
|
80
|
+
| `--offset <number>`| Number of workflows to skip | `0` |
|
|
81
|
+
|
|
82
|
+
#### `workflows invoke` — Invoke workflows
|
|
48
83
|
|
|
49
84
|
```bash
|
|
50
85
|
# Invoke all workflows and wait (up to 5 minutes) for completion
|
|
51
86
|
larkci workflows invoke --all --wait --timeout 300
|
|
52
87
|
|
|
53
|
-
# Invoke specific workflows and wait
|
|
54
|
-
larkci workflows invoke --workflow-ids wf_abc123 wf_def456
|
|
88
|
+
# Invoke specific workflows and wait
|
|
89
|
+
larkci workflows invoke --workflow-ids wf_abc123 wf_def456 --wait --timeout 300
|
|
55
90
|
```
|
|
56
91
|
|
|
57
|
-
| Flag
|
|
58
|
-
|
|
|
59
|
-
| `--workflow-ids <id...>`
|
|
60
|
-
| `--all`
|
|
61
|
-
| `--wait`
|
|
62
|
-
| `--timeout <seconds>`
|
|
63
|
-
| `--verbose`
|
|
92
|
+
| Flag | Description |
|
|
93
|
+
| ------------------------- | -------------------------------------------------------------------------------- |
|
|
94
|
+
| `--workflow-ids <id...>` | The IDs of the workflows to invoke |
|
|
95
|
+
| `--all` | Invoke all workflows |
|
|
96
|
+
| `--wait` | Wait for the execution to finish (successfully or unsuccessfully) before exiting |
|
|
97
|
+
| `--timeout <seconds>` | Maximum time to wait in seconds (default: 600, requires `--wait`) |
|
|
98
|
+
| `--verbose` | Print verbose output (includes logs) |
|
|
99
|
+
|
|
100
|
+
Either `--workflow-ids` or `--all` is required.
|
|
64
101
|
|
|
65
102
|
Exit codes: `0` = success, `1` = workflow failure, `2` = timeout, `3` = unexpected error.
|
|
66
103
|
|
|
67
|
-
####
|
|
104
|
+
#### `workflows executions list` — List executions
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
larkci workflows executions list <workflow_id>
|
|
108
|
+
```
|
|
68
109
|
|
|
69
|
-
|
|
110
|
+
| Flag | Description | Default |
|
|
111
|
+
| ------------------ | -------------------------------- | ------- |
|
|
112
|
+
| `--limit <number>` | Max executions to return (1–100) | `10` |
|
|
113
|
+
| `--offset <number>`| Number of executions to skip | `0` |
|
|
114
|
+
|
|
115
|
+
#### `workflows executions get` — Get execution details
|
|
70
116
|
|
|
71
117
|
```bash
|
|
72
118
|
larkci workflows executions get <workflow_id> <execution_id>
|
|
73
119
|
```
|
|
74
120
|
|
|
75
|
-
#### Get execution logs
|
|
76
|
-
|
|
77
|
-
Retrieve logs for a specific execution:
|
|
121
|
+
#### `workflows executions logs` — Get execution logs
|
|
78
122
|
|
|
79
123
|
```bash
|
|
80
124
|
larkci workflows executions logs <workflow_id> <execution_id>
|
|
81
125
|
```
|
|
82
126
|
|
|
127
|
+
#### `workflows executions cancel` — Cancel a running execution
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
larkci workflows executions cancel <workflow_id> <execution_id>
|
|
131
|
+
```
|
|
132
|
+
|
|
83
133
|
### Examples
|
|
84
134
|
|
|
85
135
|
```bash
|
|
136
|
+
# Create a workflow
|
|
137
|
+
larkci workflows create --name "signup-flow" --description "Test user signup"
|
|
138
|
+
|
|
139
|
+
# List your workflows
|
|
140
|
+
larkci workflows list --limit 20
|
|
141
|
+
|
|
86
142
|
# Invoke a workflow but don't wait for completion
|
|
87
|
-
larkci workflows invoke wf_abc123
|
|
143
|
+
larkci workflows invoke --workflow-ids wf_abc123
|
|
88
144
|
|
|
89
145
|
# Invoke and wait for completion (10 min default timeout)
|
|
90
|
-
larkci workflows invoke wf_abc123 --wait
|
|
146
|
+
larkci workflows invoke --workflow-ids wf_abc123 --wait
|
|
147
|
+
|
|
148
|
+
# Invoke and wait (up to 5 minutes) with verbose logs
|
|
149
|
+
larkci workflows invoke --workflow-ids wf_abc123 --wait --timeout 300 --verbose
|
|
91
150
|
|
|
92
|
-
#
|
|
93
|
-
larkci workflows
|
|
151
|
+
# List recent executions for a workflow
|
|
152
|
+
larkci workflows executions list wf_abc123
|
|
94
153
|
|
|
95
154
|
# Check execution status
|
|
96
155
|
larkci workflows executions get wf_abc123 exec_xyz789
|
|
@@ -98,17 +157,20 @@ larkci workflows executions get wf_abc123 exec_xyz789
|
|
|
98
157
|
# Fetch execution logs
|
|
99
158
|
larkci workflows executions logs wf_abc123 exec_xyz789
|
|
100
159
|
|
|
160
|
+
# Cancel a running execution
|
|
161
|
+
larkci workflows executions cancel wf_abc123 exec_xyz789
|
|
162
|
+
|
|
101
163
|
# Override API key inline
|
|
102
|
-
larkci --api-key sk-test-key workflows invoke wf_abc123
|
|
164
|
+
larkci --api-key sk-test-key workflows invoke --workflow-ids wf_abc123
|
|
103
165
|
```
|
|
104
166
|
|
|
105
167
|
## CI Pipeline Usage
|
|
106
168
|
|
|
107
|
-
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
|
|
169
|
+
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.
|
|
108
170
|
|
|
109
171
|
### GitHub Actions Example
|
|
110
172
|
|
|
111
|
-
|
|
173
|
+
Set the `LARKCI_API_KEY` environment variable in GitHub Actions secrets.
|
|
112
174
|
|
|
113
175
|
```yaml
|
|
114
176
|
- name: Run LarkCI Tests
|
|
@@ -119,7 +181,7 @@ Be sure to set the `LARKCI_API_KEY` environment variable in GitHub Actions secre
|
|
|
119
181
|
|
|
120
182
|
### CircleCI Example
|
|
121
183
|
|
|
122
|
-
|
|
184
|
+
Set the `LARKCI_API_KEY` environment variable in CircleCI.
|
|
123
185
|
|
|
124
186
|
```yaml
|
|
125
187
|
larkci_tests:
|