Configuration

YAML config file format for the CueAPI worker.

Config file

Create a YAML file (e.g., cueapi-worker.yaml):

yaml
# API key — or set CUEAPI_API_KEY env var, or run `cueapi login`
# api_key: cue_sk_your_key_here
 
# API base URL (default: https://api.cueapi.ai)
# api_base: https://api.cueapi.ai
 
# Worker ID (default: hostname)
# worker_id: my-laptop
 
# Poll interval in seconds (default: 5)
poll_interval: 5
 
# Heartbeat interval in seconds (default: 30)
heartbeat_interval: 30
 
# Max concurrent handler executions (default: 4)
max_concurrent: 4
 
# Handlers — map task names to commands
handlers:
  my-task:
    cmd: "python3 handler.py"
    cwd: "/home/user/scripts"
    timeout: 120
    env:
      MY_VAR: "{{ payload.my_field }}"

Settings

SettingDefaultDescription
api_key(from env/creds)API key for authentication
api_basehttps://api.cueapi.aiAPI base URL
worker_idhostnameUnique worker identifier
poll_interval5Seconds between polls
heartbeat_interval30Seconds between heartbeats
max_concurrent4Max simultaneous handler executions
handlers(required)Handler definitions

API key resolution

The worker resolves API keys in this order:

  1. api_key in the YAML config file
  2. CUEAPI_API_KEY environment variable
  3. ~/.config/cueapi/credentials.json (from cueapi login)

Minimal config

If you've already run cueapi login, the minimal config is just handlers:

yaml
handlers:
  my-task: "python3 handler.py"