lf automation (rules)
Manages trigger rules in the Phase U automation engine. For the older file-first markdown-object surface (lf validate, lf import, lf export), see Automation CLI.
Subcommands
| Command | Purpose |
|---|---|
lf automation list [--active-only] [--json] | List rules you own |
lf automation create --file <path>.json | Create a rule from a JSON file |
lf automation enable <id> | Activate a disabled rule |
lf automation disable <id> | Deactivate without deleting |
lf automation delete <id> --force | Permanently delete |
lf automation history <id> [--limit 25] | Show recent dispatch outcomes |
lf automation test --file <path>.json --event '<json>' | Local dry-run — no RPC |
list
lf automation list
lf automation list --active-only
lf automation list --jsonReads automation.trigger_rules filtered by the calling user. Output columns: Rule ID | Name | Event | Action | Active | Created. With --json, prints raw rows.
create
lf automation create --file rule.jsonValidates the file, INSERTs into automation.trigger_rules, and prints { rule_id, name }. The full schema is documented in Trigger rule schema.
Errors:
Invalid action_kind: <value>— must be one ofdispatch_workflow,webhook,notify.Invalid filter clause at <path>— the value must be a single-key object whose key iseq,neq,gt,lt, orcontains.
enable / disable
lf automation enable <rule-id>
lf automation disable <rule-id>PATCHes is_active. The dispatcher skips disabled rules even if events arrive in the meantime.
delete
lf automation delete <rule-id> --force--force is required because the operation cascades dispatch history. Without --force, the CLI prints a confirmation prompt and aborts.
history
lf automation history <rule-id>
lf automation history <rule-id> --limit 50Reads automation.event_dispatches for the rule, ordered by attempted_at DESC. --limit is clamped to [1, 100]; default 25. Columns: Event ID | Status | Attempted | Error.
test
lf automation test \
--file rule.json \
--event '{"event_type":"battle.finalized","payload":{"winner_contender_id":"..."}}'Dry-runs the rule against a synthetic event entirely client-side. No network call. Useful for validating filter logic before persisting a rule. Output is one of:
WOULD FIRE — rule "<name>" matches event type <type>NO MATCH — event_type <type> does not match (<expected>)NO MATCH — clause <pointer> failed: <op>(<expected>)