--- name: slay-automations description: "Create and manage automations via the slay CLI" trigger: auto --- Automations are project-scoped, event-driven actions. They fire shell commands in response to task events or on a cron schedule. ## Trigger types | Type | Fires when | Extra flags | |------|-----------|-------------| | `task_status_change` | Task status changes | `--trigger-from-status`, `--trigger-to-status` (both optional, filter transitions) | | `task_created` | New task created | — | | `task_archived` | Task archived | — | | `task_tag_changed` | Tags modified on a task | — | | `cron` | On schedule | `--cron ` (required) | | `manual` | Only via `slay automations run` | — | ## Commands - `slay automations list --project [--json]` — list automations for a project. - Shows enabled state, trigger type, run count, and last run time - `slay automations view [--json]` — view full automation details including trigger config, conditions, and actions. - `slay automations create --project --trigger [--action-command ] [--trigger-from-status ] [--trigger-to-status ] [--cron ] [--description ] [--config ]` — create an automation. - For simple automations, use `--action-command` to specify a shell command - For complex setups with multiple actions or conditions, use `--config ` with JSON `{ trigger_config, conditions?, actions }` — overrides all other flags - `slay automations update [--name ] [--description ] [--enabled] [--disabled] [--trigger ] [--action-command ] [--trigger-from-status ] [--trigger-to-status ] [--cron ]` — update an automation. - At least one option required - `slay automations delete ` — permanently delete an automation. - `slay automations toggle ` — flip the enabled/disabled state. - You don't need to know the current state — it toggles automatically - `slay automations run ` — manually trigger an automation. - Requires the SlayZone app to be running (uses the app's HTTP API) - Reports status and duration - `slay automations runs [--limit ] [--json]` — view execution history. - Shows status, duration, and any errors - Default limit: 10 ## Config file example ```json { "trigger_config": { "type": "task_status_change", "params": { "toStatus": "done" } }, "actions": [ { "type": "run_command", "params": { "command": "echo 'Task completed!'" } } ] } ```