larkci 0.1.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 +80 -0
- package/dist/api/client.d.ts +11 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +46 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/types.d.ts +28 -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/execution.d.ts +3 -0
- package/dist/commands/execution.d.ts.map +1 -0
- package/dist/commands/execution.js +30 -0
- package/dist/commands/execution.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 +26 -0
- package/dist/commands/invoke.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 +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# LarkCI CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for invoking and managing LarkCI testing workflows.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Requires Node.js >= 18.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g larkci
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or run directly without installing:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx larkci <command>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Set your API key as an environment variable:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export LARKCI_API_KEY=your-api-key
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Alternatively, pass it inline with the `--api-key` flag (see [Global Options](#global-options)).
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
larkci [options] <command>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Global Options
|
|
36
|
+
|
|
37
|
+
| Flag | Description |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `--api-key <key>` | API key (overrides `LARKCI_API_KEY` env var) |
|
|
40
|
+
| `-V, --version` | Display the current version |
|
|
41
|
+
| `-h, --help` | Display help |
|
|
42
|
+
|
|
43
|
+
### Commands
|
|
44
|
+
|
|
45
|
+
#### Invoke a workflow
|
|
46
|
+
|
|
47
|
+
Start a new execution for a workflow:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
larkci workflows invoke <workflow_id>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### Get a workflow execution
|
|
54
|
+
|
|
55
|
+
Retrieve details of a specific execution:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
larkci workflows executions get <workflow_id> <execution_id>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Examples
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Invoke a workflow
|
|
65
|
+
larkci workflows invoke wf_abc123
|
|
66
|
+
|
|
67
|
+
# Check execution status
|
|
68
|
+
larkci workflows executions get wf_abc123 exec_xyz789
|
|
69
|
+
|
|
70
|
+
# Override API key inline
|
|
71
|
+
larkci --api-key sk-test-key workflows invoke wf_abc123
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
ISC
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Config } from "../config.js";
|
|
2
|
+
import type { WorkflowExecutionResource } from "./types.js";
|
|
3
|
+
export declare class LarkCIClient {
|
|
4
|
+
private baseUrl;
|
|
5
|
+
private apiKey;
|
|
6
|
+
constructor(config: Config);
|
|
7
|
+
private request;
|
|
8
|
+
invokeWorkflow(workflowId: string): Promise<WorkflowExecutionResource>;
|
|
9
|
+
getWorkflowExecution(workflowId: string, executionId: string): Promise<WorkflowExecutionResource>;
|
|
10
|
+
}
|
|
11
|
+
//# 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,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;YAKZ,OAAO;IAoCf,cAAc,CAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,yBAAyB,CAAC;IAO/B,oBAAoB,CACxB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,yBAAyB,CAAC;CAMtC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class LarkCIClient {
|
|
2
|
+
baseUrl;
|
|
3
|
+
apiKey;
|
|
4
|
+
constructor(config) {
|
|
5
|
+
this.baseUrl = config.apiUrl.replace(/\/+$/, "");
|
|
6
|
+
this.apiKey = config.apiKey;
|
|
7
|
+
}
|
|
8
|
+
async request(method, path) {
|
|
9
|
+
const url = `${this.baseUrl}${path}`;
|
|
10
|
+
let response;
|
|
11
|
+
try {
|
|
12
|
+
response = await fetch(url, {
|
|
13
|
+
method,
|
|
14
|
+
headers: {
|
|
15
|
+
"X-API-Key": this.apiKey,
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
const cause = err instanceof Error ? err.message : String(err);
|
|
22
|
+
throw new Error(`Could not connect to ${this.baseUrl} (${cause}). Is the API running? Check your LARKCI_API_URL setting.`);
|
|
23
|
+
}
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
let message = `HTTP ${response.status} ${response.statusText}`;
|
|
26
|
+
try {
|
|
27
|
+
const body = (await response.json());
|
|
28
|
+
if (typeof body.detail === "string") {
|
|
29
|
+
message = `${message}: ${body.detail}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// response body was not JSON, use the default message
|
|
34
|
+
}
|
|
35
|
+
throw new Error(message);
|
|
36
|
+
}
|
|
37
|
+
return (await response.json());
|
|
38
|
+
}
|
|
39
|
+
async invokeWorkflow(workflowId) {
|
|
40
|
+
return this.request("POST", `/workflows/${workflowId}/invoke`);
|
|
41
|
+
}
|
|
42
|
+
async getWorkflowExecution(workflowId, executionId) {
|
|
43
|
+
return this.request("GET", `/workflows/${workflowId}/executions/${executionId}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,YAAY;IACf,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,OAAO,CAAI,MAAc,EAAE,IAAY;QACnD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;QAErC,IAAI,QAAkB,CAAC;QACvB,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;gBAC1B,MAAM;gBACN,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI,CAAC,MAAM;oBACxB,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,KAAK,GACT,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnD,MAAM,IAAI,KAAK,CACb,wBAAwB,IAAI,CAAC,OAAO,KAAK,KAAK,2DAA2D,CAC1G,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,IAAI,OAAO,GAAG,QAAQ,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA4B,CAAC;gBAChE,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACpC,OAAO,GAAG,GAAG,OAAO,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzC,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,sDAAsD;YACxD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,UAAkB;QAElB,OAAO,IAAI,CAAC,OAAO,CACjB,MAAM,EACN,cAAc,UAAU,SAAS,CAClC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,UAAkB,EAClB,WAAmB;QAEnB,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,EACL,cAAc,UAAU,eAAe,WAAW,EAAE,CACrD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface WorkflowExecutionStepResource {
|
|
2
|
+
step: string;
|
|
3
|
+
result: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface WorkflowExecutionArtifactResource {
|
|
6
|
+
artifact_type: "screenshot" | "video";
|
|
7
|
+
filename: string;
|
|
8
|
+
presigned_url: string;
|
|
9
|
+
presigned_url_expires_at: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowExecutionResource {
|
|
14
|
+
id: string;
|
|
15
|
+
workflow_id: string;
|
|
16
|
+
status: "pending" | "running" | "success" | "failure";
|
|
17
|
+
artifacts: WorkflowExecutionArtifactResource[];
|
|
18
|
+
steps: WorkflowExecutionStepResource[] | null;
|
|
19
|
+
summary: string | null;
|
|
20
|
+
started_at: string | null;
|
|
21
|
+
stopped_at: string | null;
|
|
22
|
+
created_at: string;
|
|
23
|
+
updated_at: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ApiErrorResponse {
|
|
26
|
+
detail: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iCAAiC;IAChD,aAAa,EAAE,YAAY,GAAG,OAAO,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB,EAAE,MAAM,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACtD,SAAS,EAAE,iCAAiC,EAAE,CAAC;IAC/C,KAAK,EAAE,6BAA6B,EAAE,GAAG,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/commands/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,GACf,IAAI,CA+BN"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LarkCIClient } from "../api/client.js";
|
|
2
|
+
import { getConfig } from "../config.js";
|
|
3
|
+
export function registerExecutionCommand(workflows, program) {
|
|
4
|
+
const executions = workflows
|
|
5
|
+
.command("executions")
|
|
6
|
+
.description("Manage workflow executions");
|
|
7
|
+
executions
|
|
8
|
+
.command("get")
|
|
9
|
+
.description("Get details of a specific workflow execution")
|
|
10
|
+
.argument("<workflow_id>", "The ID of the workflow")
|
|
11
|
+
.argument("<execution_id>", "The ID of the execution")
|
|
12
|
+
.action(async (workflowId, executionId) => {
|
|
13
|
+
const opts = program.opts();
|
|
14
|
+
const config = getConfig({
|
|
15
|
+
apiKey: opts.apiKey,
|
|
16
|
+
apiUrl: opts.apiUrl,
|
|
17
|
+
});
|
|
18
|
+
const client = new LarkCIClient(config);
|
|
19
|
+
try {
|
|
20
|
+
const result = await client.getWorkflowExecution(workflowId, executionId);
|
|
21
|
+
console.log(JSON.stringify(result, null, 2));
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
25
|
+
console.error(`Error: ${message}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/commands/execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,UAAU,wBAAwB,CACtC,SAAkB,EAClB,OAAgB;IAEhB,MAAM,UAAU,GAAG,SAAS;SACzB,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAE7C,UAAU;SACP,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,8CAA8C,CAAC;SAC3D,QAAQ,CAAC,eAAe,EAAE,wBAAwB,CAAC;SACnD,QAAQ,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;SACrD,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,WAAmB,EAAE,EAAE;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,SAAS,CAAC;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAC9C,UAAU,EACV,WAAW,CACZ,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/commands/invoke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,GACf,IAAI,CAuBN"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LarkCIClient } from "../api/client.js";
|
|
2
|
+
import { getConfig } from "../config.js";
|
|
3
|
+
export function registerInvokeCommand(workflows, program) {
|
|
4
|
+
workflows
|
|
5
|
+
.command("invoke")
|
|
6
|
+
.description("Invoke a workflow and start a new execution")
|
|
7
|
+
.argument("<workflow_id>", "The ID of the workflow to invoke")
|
|
8
|
+
.action(async (workflowId) => {
|
|
9
|
+
const opts = program.opts();
|
|
10
|
+
const config = getConfig({
|
|
11
|
+
apiKey: opts.apiKey,
|
|
12
|
+
apiUrl: opts.apiUrl,
|
|
13
|
+
});
|
|
14
|
+
const client = new LarkCIClient(config);
|
|
15
|
+
try {
|
|
16
|
+
const execution = await client.invokeWorkflow(workflowId);
|
|
17
|
+
console.log(JSON.stringify(execution, null, 2));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
21
|
+
console.error(`Error: ${message}`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=invoke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../src/commands/invoke.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,UAAU,qBAAqB,CACnC,SAAkB,EAClB,OAAgB;IAEhB,SAAS;SACN,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,QAAQ,CAAC,eAAe,EAAE,kCAAkC,CAAC;SAC7D,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,EAAE;QACnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,SAAS,CAAC;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,wBAAgB,SAAS,CAAC,OAAO,EAAE;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAYT"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import dotenv from "dotenv";
|
|
2
|
+
dotenv.config();
|
|
3
|
+
const DEFAULT_API_URL = "https://api.getlark.ai";
|
|
4
|
+
export function getConfig(options) {
|
|
5
|
+
const apiKey = options.apiKey ?? process.env.LARKCI_API_KEY;
|
|
6
|
+
const apiUrl = options.apiUrl ?? process.env.LARKCI_API_URL ?? DEFAULT_API_URL;
|
|
7
|
+
if (!apiKey) {
|
|
8
|
+
console.error("Error: API key is required. Set LARKCI_API_KEY environment variable or pass --api-key.");
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
return { apiKey, apiUrl };
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAOhB,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD,MAAM,UAAU,SAAS,CAAC,OAGzB;IACC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,eAAe,CAAC;IAE/E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CACX,wFAAwF,CACzF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { registerInvokeCommand } from "./commands/invoke.js";
|
|
4
|
+
import { registerExecutionCommand } from "./commands/execution.js";
|
|
5
|
+
const program = new Command();
|
|
6
|
+
program
|
|
7
|
+
.name("larkci")
|
|
8
|
+
.description("LarkCI CLI - Invoke testing workflows and manage test executions")
|
|
9
|
+
.version("0.1.0")
|
|
10
|
+
.option("--api-key <key>", "API key (overrides LARKCI_API_KEY env var)")
|
|
11
|
+
.option("--api-url <url>", "API base URL (overrides LARKCI_API_URL env var)");
|
|
12
|
+
const workflows = program
|
|
13
|
+
.command("workflows")
|
|
14
|
+
.description("Manage workflows");
|
|
15
|
+
registerInvokeCommand(workflows, program);
|
|
16
|
+
registerExecutionCommand(workflows, program);
|
|
17
|
+
program.parse();
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,kEAAkE,CAAC;KAC/E,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,CAAC;KACvE,MAAM,CAAC,iBAAiB,EAAE,iDAAiD,CAAC,CAAC;AAEhF,MAAM,SAAS,GAAG,OAAO;KACtB,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAEnC,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC1C,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAE7C,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "larkci",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "LarkCI CLI - Invoke testing workflows and manage test executions",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"larkci": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"larkci",
|
|
21
|
+
"cli",
|
|
22
|
+
"testing",
|
|
23
|
+
"ci"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"start": "node dist/index.js",
|
|
28
|
+
"dev": "tsx src/index.ts",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"commander": "^13.1.0",
|
|
34
|
+
"dotenv": "^16.4.5"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.10.0",
|
|
38
|
+
"tsx": "^4.19.0",
|
|
39
|
+
"typescript": "^5.7.0"
|
|
40
|
+
}
|
|
41
|
+
}
|