CLI

dispatched is the CLI. It handles sign-in, workflows, and secrets from your terminal. Your private key stays on your laptop.

Install

# macOS (Apple Silicon)
curl -fsSL https://dispatched.work/cli/dispatched_darwin_arm64 -o /usr/local/bin/dispatched && chmod +x /usr/local/bin/dispatched

# macOS (Intel)
curl -fsSL https://dispatched.work/cli/dispatched_darwin_amd64 -o /usr/local/bin/dispatched && chmod +x /usr/local/bin/dispatched

# Linux (amd64)
curl -fsSL https://dispatched.work/cli/dispatched_linux_amd64 -o /usr/local/bin/dispatched && chmod +x /usr/local/bin/dispatched

# Linux (arm64)
curl -fsSL https://dispatched.work/cli/dispatched_linux_arm64 -o /usr/local/bin/dispatched && chmod +x /usr/local/bin/dispatched

The download URL always points at the latest release.

Create a tenant

The CLI can spin up a new tenant for you:

dispatched init
# Choose "Create a new tenant"
# Organization name: Acme Corp
# → Generates an X25519 keypair locally
# → Registers with the server (only the public key goes over the wire)
# → Saves credentials to ~/.config/dispatched/credentials.json

The private key is generated on your machine and never sent to the server.

Setup

Run dispatched init to drop your credentials onto disk:

dispatched init
# Host URL [http://localhost:4000]: https://dispatched.work
# Tenant ID: ten_abc123
# API Key: dsk_live_xxx
# Private Key (base64): <paste your key>

Credentials land in ~/.config/dispatched/credentials.json.

Authentication

# Start a session (runs the DH handshake)
dispatched login

# Check session status
dispatched status

# Print the session token (for curl, httpie, etc.)
dispatched token

Then hand the token to curl:

curl https://dispatched.work/api/workflows/my-workflow \
  -H "Dispatched-Session: $(dispatched token)"

Workflows

# Register a workflow from a YAML file
cat my-workflow.yaml | dispatched workflow register

# Show a workflow definition
dispatched workflow show my-workflow

# Delete a workflow
dispatched workflow delete my-workflow

Runs

# Trigger a workflow. --async returns immediately with the run id;
# omit it to wait for the run's response.
RUN=$(dispatched run start my-workflow --async \
  --data '{"order_id": "ord_42"}')

# Inspect a run's status and per-step states.
dispatched run show $RUN

# Wake up a `wait` step. --data is the signal payload, available as
# {{ steps.<step_id>.signal.body }} in the workflow.
dispatched run signal $RUN address-submitted --data @address.json

# Cancel an active run.
dispatched run cancel $RUN

# List the 50 most recent runs.
dispatched run list

# Print every event for a run and exit.
dispatched run events $RUN

# Subscribe to a run's events. --follow keeps the connection open via
# HTTP long-polling (wait=30s by default) and prints new events as
# they arrive. Use --after N to skip events at or before sequence N,
# and --json to emit one JSON event per line for piping.
dispatched run events $RUN --follow
dispatched run events $RUN --follow --after 5 --json

--data accepts a JSON literal or @file.json to read from disk. If you omit it, an empty {} body is sent.

Secrets

# List all secrets
dispatched secret list

# Set a secret
dispatched secret set STRIPE_KEY sk_live_xxx

# Delete a secret
dispatched secret delete STRIPE_KEY