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
| Setting | Default | Description |
|---|---|---|
api_key | (from env/creds) | API key for authentication |
api_base | https://api.cueapi.ai | API base URL |
worker_id | hostname | Unique worker identifier |
poll_interval | 5 | Seconds between polls |
heartbeat_interval | 30 | Seconds between heartbeats |
max_concurrent | 4 | Max simultaneous handler executions |
handlers | (required) | Handler definitions |
API key resolution
The worker resolves API keys in this order:
api_keyin the YAML config fileCUEAPI_API_KEYenvironment variable~/.config/cueapi/credentials.json(fromcueapi login)
Minimal config
If you've already run cueapi login, the minimal config is just handlers:
yaml
handlers:
my-task: "python3 handler.py"