Skip to main content
The LarkCI 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:
npx -y larkci@latest workflows invoke --all --wait
Or install globally:
npm install -g larkci@latest

Authentication

Set your API key as an environment variable:
export LARKCI_API_KEY=your-api-key
The CLI also supports a .env file in the current directory. You can pass the key inline with the --api-key flag on any command. Get your API key from the dashboard.

Global options

FlagDescription
--api-key <key>API key (overrides the LARKCI_API_KEY env var)
-V, --versionDisplay the CLI version
-h, --helpDisplay help for any command

Commands

Create a workflow

larkci workflows create --name "login-flow" --description "Test the login process end-to-end"
FlagRequiredDescriptionDefault
--name <name>YesWorkflow name
--description <text>YesWorkflow description
--mode <mode>Noai_driven or deterministicai_driven
--secret-contexts <names...>NoSecret contexts to attach
--group-id <id>NoWorkflow group ID to assign this workflow to
larkci workflows create \
  --name "checkout-flow" \
  --description "Test the full checkout process" \
  --mode deterministic \
  --secret-contexts production staging

Get workflow details

larkci workflows get <workflow_id>
Returns the full workflow resource including status, mode, schedule, and last execution/generation/repair info.

Update a workflow

larkci workflows update <workflow_id> --name "new-name" --description "updated description"
FlagDescription
--name <name>New name for the workflow
--description <text>New description for the workflow
--secret-contexts <names...>Secret contexts to attach
--schedule <cron>Cron schedule for the workflow
--group-id <id>Workflow group ID (use null to ungroup)
At least one option is required.

Archive a workflow

larkci workflows archive <workflow_id>
Archived workflows are hidden from the default list and cannot be invoked until unarchived.

Unarchive a workflow

larkci workflows unarchive <workflow_id>
Restores an archived workflow so it appears in the list and can be invoked again.

List workflows

larkci workflows list
FlagDescriptionDefault
--limit <n>Max workflows to return (1–100)10
--offset <n>Number of workflows to skip0
--group-id <id>Filter workflows by group ID

Invoke workflows

Run one or more workflows and optionally wait for them to finish. Either --workflow-ids or --all is required.
larkci workflows invoke --all --wait --timeout 300
larkci workflows invoke --workflow-ids wf_abc123 wf_def456 --wait --timeout 300
FlagDescription
--workflow-ids <ids...>IDs of the workflows to invoke
--allInvoke all workflows
--waitBlock until every execution finishes
--timeout <seconds>Maximum wait time in seconds (default: 600, requires --wait)
--verbosePrint verbose output including logs

Exit codes

CodeMeaning
0All workflows passed
1One or more workflows failed
2Timed out waiting for results
3Unexpected error

Get execution details

larkci workflows executions get <workflow_id> <execution_id>

Get execution logs

larkci workflows executions logs <workflow_id> <execution_id>

Cancel a running execution

larkci workflows executions cancel <workflow_id> <execution_id>

Trigger a workflow repair

larkci workflows repairs trigger <workflow_id>
Triggers a repair for a workflow. Returns the repair resource.

List workflow repairs

larkci workflows repairs list <workflow_id>
FlagDescriptionDefault
--limit <n>Max repairs to return (1–100)10
--offset <n>Number of repairs to skip0

Get repair details

larkci workflows repairs get <workflow_id> <repair_id>

Cancel a running repair

larkci workflows repairs cancel <workflow_id> <repair_id>

Get repair logs

larkci workflows repairs logs <workflow_id> <repair_id>

Cancel a running generation

larkci workflows generations cancel <workflow_id> <generation_id>

List workflow events

larkci workflows events list <workflow_id>
FlagDescriptionDefault
--limit <n>Max events to return (1–100)10
--offset <n>Number of events to skip0
Lists all events (generations, executions, repairs) for a workflow.

Create a workflow group

larkci workflow-groups create --name "Checkout Flow"
FlagRequiredDescription
--name <name>YesName of the workflow group

List workflow groups

larkci workflow-groups list
FlagDescriptionDefault
--limit <n>Max groups to return (1–100)10
--offset <n>Number of groups to skip0

Get a workflow group

larkci workflow-groups get <group_id>

Update a workflow group

larkci workflow-groups update <group_id> --name "Updated Name"
FlagDescription
--name <name>New name for the workflow group

Delete a workflow group

larkci workflow-groups delete <group_id>
Workflows in the group become ungrouped.

List secret contexts

larkci secret-contexts list
Returns all secret context names and metadata for your account. Does not return secret values.

Get a secret context

larkci secret-contexts get <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

larkci secret-contexts create --context production --secret username=admin --secret password=s3cret
FlagRequiredDescription
--context <name>YesName of the secret context
--secret <key=value>YesSecret key-value pair (repeat for multiple values)
larkci secret-contexts create \
  --context staging \
  --secret api_key=sk_test_abc123 \
  --secret username=testuser \
  --secret password=testpass

Update a key in a secret context

larkci secret-contexts update <context> --key <key> --value <value>
FlagRequiredDescription
--key <name>YesThe key to create or update
--value <value>YesThe new value for the key
If the key already exists its value is replaced; if it does not exist it is added.

Delete a secret context

larkci secret-contexts delete <context>
Permanently deletes a secret context. Workflows referencing it will no longer have access.

Delete a key from a secret context

larkci secret-contexts delete-key <context> <key>
Removes a single key-value pair from an existing secret context.

Examples

# Create a workflow
larkci workflows create --name "signup-flow" --description "Test user signup"

# Get workflow details
larkci workflows get wf_abc123

# Update a workflow
larkci workflows update wf_abc123 --name "updated-signup-flow" --schedule "0 9 * * *"

# List your workflows
larkci workflows list --limit 20

# List workflows in a group
larkci workflows list --group-id grp_abc123

# Archive a workflow
larkci workflows archive wf_abc123

# Unarchive a workflow
larkci workflows unarchive wf_abc123

# Invoke a workflow without waiting
larkci workflows invoke --workflow-ids wf_abc123

# Invoke and wait with a 5-minute timeout
larkci workflows invoke --workflow-ids wf_abc123 --wait --timeout 300

# Invoke all workflows and wait with verbose logs
larkci workflows invoke --all --wait --verbose

# Check execution status
larkci workflows executions get wf_abc123 exec_xyz789

# Fetch execution logs
larkci workflows executions logs wf_abc123 exec_xyz789

# Cancel a running execution
larkci workflows executions cancel wf_abc123 exec_xyz789

# Trigger a repair
larkci workflows repairs trigger wf_abc123

# List repairs
larkci workflows repairs list wf_abc123

# Cancel a generation
larkci workflows generations cancel wf_abc123 gen_xyz789

# List events
larkci workflows events list wf_abc123

# Create a workflow group
larkci workflow-groups create --name "Checkout Flow"

# List workflow groups
larkci workflow-groups list

# Delete a workflow group
larkci workflow-groups delete grp_abc123

# Override API key inline
larkci --api-key sk-test-key workflows invoke --workflow-ids wf_abc123

# Store credentials for a secret context
larkci secret-contexts create --context production --secret username=admin --secret password=s3cret

# Update a single key in a secret context
larkci secret-contexts update production --key password --value new-s3cret

# List all secret contexts
larkci secret-contexts list

# View the keys stored in a secret context
larkci secret-contexts get production

# Delete a key from a secret context
larkci secret-contexts delete-key production password

# Delete a secret context
larkci secret-contexts delete production

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.