larkci 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +49 -23
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -2,18 +2,20 @@
2
2
 
3
3
  Command-line interface for invoking and managing LarkCI testing workflows.
4
4
 
5
- ## Installation
5
+ ## Quickstart
6
6
 
7
7
  Requires Node.js >= 18.
8
8
 
9
9
  ```bash
10
- npm install -g larkci
10
+ npx -y larkci@latest workflows invoke --all --wait
11
11
  ```
12
12
 
13
- Or run directly without installing:
13
+ Or install globally:
14
14
 
15
15
  ```bash
16
- npx larkci <command>
16
+ npm install -g larkci@latest
17
+
18
+ larkci workflows invoke --all --wait
17
19
  ```
18
20
 
19
21
  ## Configuration
@@ -34,28 +36,33 @@ larkci [options] <command>
34
36
 
35
37
  ### Global Options
36
38
 
37
- | Flag | Description |
38
- |---|---|
39
+ | Flag | Description |
40
+ | ----------------- | -------------------------------------------- |
39
41
  | `--api-key <key>` | API key (overrides `LARKCI_API_KEY` env var) |
40
- | `-V, --version` | Display the current version |
41
- | `-h, --help` | Display help |
42
+ | `-V, --version` | Display the current version |
43
+ | `-h, --help` | Display help |
42
44
 
43
45
  ### Commands
44
46
 
45
- #### Invoke a workflow
46
-
47
- Start a new execution for a workflow:
47
+ #### Invoke workflows
48
48
 
49
49
  ```bash
50
- larkci workflows invoke <workflow_id>
50
+ # Invoke all workflows and wait (up to 5 minutes) for completion
51
+ larkci workflows invoke --all --wait --timeout 300
52
+
53
+ # Invoke specific workflows and wait (up to 5 minutes) for completion
54
+ larkci workflows invoke --workflow-ids wf_abc123 wf_def456 wf_ghi789 --wait --timeout 300
51
55
  ```
52
56
 
53
- | Flag | Description |
54
- |---|---|
55
- | `--wait` | Wait for the execution to reach a terminal status before exiting |
56
- | `--timeout <seconds>` | Maximum time to wait in seconds (default: 600, requires `--wait`) |
57
+ | Flag | Description |
58
+ | ------------------------ | -------------------------------------------------------------------------------- |
59
+ | `--workflow-ids <id...>` | The IDs of the workflow to invoke |
60
+ | `--all` | Invoke all workflows |
61
+ | `--wait` | Wait for the execution to finish (successfully or unsuccessfully) before exiting |
62
+ | `--timeout <seconds>` | Maximum time to wait in seconds (default: 600, requires `--wait`) |
63
+ | `--verbose` | Print verbose output (includes logs) |
57
64
 
58
- When `--wait` is used, progress updates are printed to stderr and the final execution JSON is printed to stdout. Exit codes: `0` = success, `1` = workflow failure, `2` = timeout, `3` = unexpected error.
65
+ Exit codes: `0` = success, `1` = workflow failure, `2` = timeout, `3` = unexpected error.
59
66
 
60
67
  #### Get a workflow execution
61
68
 
@@ -76,13 +83,13 @@ larkci workflows executions logs <workflow_id> <execution_id>
76
83
  ### Examples
77
84
 
78
85
  ```bash
79
- # Invoke a workflow
86
+ # Invoke a workflow but don't wait for completion
80
87
  larkci workflows invoke wf_abc123
81
88
 
82
89
  # Invoke and wait for completion (10 min default timeout)
83
90
  larkci workflows invoke wf_abc123 --wait
84
91
 
85
- # Invoke and wait with a custom timeout of 5 minutes
92
+ # Invoke and wait (up to 5 minutes) for completion
86
93
  larkci workflows invoke wf_abc123 --wait --timeout 300
87
94
 
88
95
  # Check execution status
@@ -95,18 +102,37 @@ larkci workflows executions logs wf_abc123 exec_xyz789
95
102
  larkci --api-key sk-test-key workflows invoke wf_abc123
96
103
  ```
97
104
 
98
- ### CI Pipeline Usage
105
+ ## CI Pipeline Usage
99
106
 
100
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:
101
108
 
109
+ ### GitHub Actions Example
110
+
111
+ Be sure to set the `LARKCI_API_KEY` environment variable in GitHub Actions secrets.
112
+
102
113
  ```yaml
103
- # GitHub Actions example
104
- - name: Run LarkCI workflow
105
- run: larkci workflows invoke ${{ vars.WORKFLOW_ID }} --wait --timeout 300
114
+ - name: Run LarkCI Tests
115
+ run: npx -y larkci@latest workflows invoke --all --wait
106
116
  env:
107
117
  LARKCI_API_KEY: ${{ secrets.LARKCI_API_KEY }}
108
118
  ```
109
119
 
120
+ ### CircleCI Example
121
+
122
+ Be sure to set the `LARKCI_API_KEY` environment variable in CircleCI.
123
+
124
+ ```yaml
125
+ larkci_tests:
126
+ docker:
127
+ - image: cimg/node:lts
128
+ resource_class: small
129
+ steps:
130
+ - run:
131
+ name: Run LarkCI Tests
132
+ command: |
133
+ npx -y larkci@latest workflows invoke --all --wait
134
+ ```
135
+
110
136
  ## Contributing
111
137
 
112
138
  See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkci",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "LarkCI CLI - Invoke testing workflows and manage test executions",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -20,7 +20,8 @@
20
20
  "larkci",
21
21
  "cli",
22
22
  "testing",
23
- "ci"
23
+ "ci",
24
+ "e2e-testing"
24
25
  ],
25
26
  "scripts": {
26
27
  "build": "tsc",