Skip to main content
The Lark CLI lets you create workflows, invoke them, poll for results, and retrieve execution logs from your terminal or CI pipeline.

Installation

Requires Node.js 18 or later. Run directly with npx:
Or install globally:

Authentication

The fastest way to authenticate is getlark login:
This stores your credentials at ~/.getlark/config.json (mode 0600) so subsequent commands work in any new shell — no need to reload your shell or re-export an env var. Run getlark logout to remove the stored credentials. The CLI resolves the API key in this order:
  1. --api-key flag
  2. GETLARK_API_KEY environment variable
  3. ~/.getlark/config.json
  4. error
The same precedence applies to --api-url / GETLARK_API_URL. CI usage is unchanged — keep using the env var. The CLI also supports a .env file in the current directory.
Create and manage API keys in the dashboard. Copy the key when you create it — you only see the full value once.

Global options

Workflows

Create, update, list, archive, and invoke workflows. See the dedicated sections below for executions, repairs, and generations.

Create a workflow

Get workflow details

Returns the full workflow resource including status, mode, schedule, and last execution/generation/repair info.

Update a workflow

At least one option is required.

Archive a workflow

Archived workflows are hidden from the default list and cannot be invoked until unarchived.

Unarchive a workflow

Restores an archived workflow so it appears in the list and can be invoked again.

List workflows

Invoke workflows

Run one or more workflows and optionally wait for them to finish. One of --workflow-ids, --all, --group-id, or --group-name is required.

Exit codes

List workflow events

Lists all events (generations, executions, repairs) for a workflow.

Executions

Inspect, follow, and cancel individual runs of a workflow.

Get execution details

Get execution logs

Cancel a running execution

Repairs

Trigger and inspect AI repair attempts on a workflow after a failed execution.

Trigger a workflow repair

Triggers a repair for a workflow. Returns the repair resource.

List workflow repairs

Get repair details

Cancel a running repair

Get repair logs

Generations

Manage in-progress workflow generations (the background process that produces a workflow’s executable artifact when it’s created or substantially edited).

Cancel a running generation

Workflow groups

Group related workflows together for organization and bulk filtering.

Create a workflow group

List workflow groups

Get a workflow group

Update a workflow group

Delete a workflow group

Workflows in the group become ungrouped.

Jobs

Asynchronous bulk operations on workflows (currently workflow_import). Submit a job, then poll getlark jobs get until it reaches a terminal state (completed, failed, or cancelled).

Create a job from an inline JSON input file

workflow_import input file schema

The input file is a single JSON object. The same file is accepted by jobs create, jobs upload, and jobs validate. Top-level object: Each entry under workflows: No additional properties are accepted at the top level or per workflow. Example workflows.json:
Run getlark jobs validate --file ./workflows.json before submitting to catch schema errors without creating a job.

List jobs

Get a job

Cancel a job

Cancels a pending or running job.

Upload a job from a file

Sends the file as multipart/form-data to /jobs/upload. The job stores the original filename so you can retrieve it later from getlark jobs get.

Validate an input file without creating a job

Prints the validation report and exits non-zero if valid: false.

Secret contexts

Manage credentials that workflows reference at runtime. Values are encrypted at rest and never returned by the API.

List secret contexts

Returns all secret context names and metadata for your account. Does not return secret values.

Get a secret context

Returns the context name and the list of key names stored in it. Does not return secret values.

Create or replace a secret context

Update a key in a secret context

If the key already exists its value is replaced; if it does not exist it is added.

Delete a secret context

Permanently deletes a secret context. Workflows referencing it will no longer have access.

Delete a key from a secret context

Removes a single key-value pair from an existing secret context.

Examples

CI pipeline usage

The --wait flag makes the CLI well-suited for CI pipelines. The command blocks until every workflow finishes and exits with a non-zero code on failure. For full CI setup instructions, see CI integration.