CLI Overview
The zart CLI lets you manage durable executions from the terminal — perfect for development workflows, operator tooling, and AI agent integration.
Installation
Section titled “Installation”cargo install zart-cliOr download a pre-built binary from the GitHub releases page.
Configuration
Section titled “Configuration”The CLI reads database configuration from the environment:
export DATABASE_URL="postgres://user:pass@localhost/mydb"Or use a .env file in the working directory. All commands respect the --database-url flag to override the environment variable:
zart --database-url "postgres://..." status exec-abc-123Commands
Section titled “Commands”zart migrate
Section titled “zart migrate”Run database migrations to create or update the Zart schema. Safe to run on every deploy — migrations are idempotent.
zart migrate# Applied 3 migrations successfully.zart schedule
Section titled “zart schedule”Schedule a new workflow execution.
zart schedule <task-name> [--data <json>] [--id <execution-id>]# Schedule with auto-generated execution IDzart schedule onboarding --data '{"email":"user@example.com","user_id":"u123"}'
# Schedule with explicit ID (idempotent — safe to run twice)zart schedule checkout \ --data '{"order_id":"ord-456","total":9900}' \ --id checkout-ord-456Output:
Scheduled execution: exec-7f3a9b2cTask: onboardingStatus: pendingzart status
Section titled “zart status”Query the current status of an execution.
zart status <execution-id> [--verbose]zart status exec-7f3a9b2c# execution_id: exec-7f3a9b2c# task: onboarding# status: running# started_at: 2026-04-04T10:23:11Z# steps: 2 completed, 1 running
zart status exec-7f3a9b2c --verbose# ... includes per-step details and attempt historyzart cancel
Section titled “zart cancel”Cancel a pending or running execution.
zart cancel <execution-id>zart cancel exec-7f3a9b2c# Cancelled execution: exec-7f3a9b2czart wait
Section titled “zart wait”Block until an execution completes (or fails), with an optional timeout.
zart wait <execution-id> [--timeout <seconds>]# Wait up to 60 seconds, then print final statuszart wait exec-7f3a9b2c --timeout 60# {"status":"completed","output":{"customer_id":"cus_abc"}}Exits with code 0 on success, 1 on failure, 2 on timeout.
zart event
Section titled “zart event”Deliver an event to a waiting execution.
zart event <execution-id> <event-name> [--data <json>]zart event exec-7f3a9b2c email-verified \ --data '{"token":"tk_xyz789","verified_at":"2026-04-04T10:25:00Z"}'# Event delivered to exec-7f3a9b2c: email-verifiedzart list
Section titled “zart list”List executions with optional filtering.
zart list [--status <status>] [--task <task-name>] [--limit <n>]# List all running executionszart list --status running
# List recent onboarding executionszart list --task onboarding --limit 20Status values: pending, running, waiting, completed, failed.
Global Flags
Section titled “Global Flags”| Flag | Description |
|---|---|
--database-url <url> | Database connection string (overrides DATABASE_URL) |
--json | Output as JSON instead of human-readable text |
--quiet | Suppress non-error output |
--help | Show help text |
--version | Show CLI version |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Success |
1 | Execution failed or command error |
2 | Timeout (for zart wait) |
3 | Execution not found |
Next Steps
Section titled “Next Steps”- LLM Agents — using the CLI from AI agent loops
- Deployment Options — running workers alongside your app