Skip to content
Edith

Docs

Command reference

Switchyard

Switchyard runs local rules: a trigger, optional conditions and a sequence of steps. Enable switchyard, then use ed invoke. Every payload is a JSON object, and rule operations take an id from the configuration.rules list in any snapshot.

Terminal
ed invoke switchyard switchyard.readed invoke switchyard switchyard.run --json '{"id":"<rule id>"}'ed invoke switchyard switchyard.pause --json '{"paused":true}'ed invoke switchyard switchyard.export > rules.json

Operations

Operation Payload Result
switchyard.read {} The snapshot: configuration, history (newest first), running, timers, nextDue, issue, notices
switchyard.save rule, optional expectedRule Adds the rule or replaces the one with the same id; with expectedRule it fails when the saved rule changed since. Returns the snapshot
switchyard.enable id, enabled Turns the rule on or off; returns the snapshot
switchyard.delete id Deletes the rule; returns the snapshot
switchyard.pause paused Pauses or resumes every rule; returns the snapshot
switchyard.run id Starts the rule's steps now, skipping its trigger, conditions and cooldown; returns the snapshot
switchyard.cancel id Cancels the rule's running sequence at the next step; returns the snapshot
switchyard.timer.cancel id (the timer name) Cancels a named timer; returns the snapshot
switchyard.preview rule A dry run: checks the conditions and each action without running anything. Returns the run
switchyard.actions {} actions (each with owner, actionID, title, subtitle, confirms) from every enabled extension's catalog, and unavailable owners that did not answer
switchyard.shortcuts {} shortcuts, the names from shortcuts list
switchyard.export {} The rules as pretty-printed JSON (version, paused, rules)
switchyard.import configuration, optional replace Adds the rules (or replaces every rule with replace: true), always turned off. Returns added and snapshot
switchyard.history.clear {} Clears run history unless a rule is running; returns the snapshot
switchyard.dismiss {} Clears the storage issue; returns the snapshot

A rule has id, name, enabled, trigger, conditions, matchAny, steps, cooldown (seconds, 0 to 86400) and continueOnFailure. A trigger has kind, value, seconds (for interval, at least 60), hour, minute and weekdays (1 is Sunday; empty is every day) for daily. Trigger kinds are manual, appLaunched, appActivated, appTerminated, appHidden, appUnhidden, displayConnected, displayDisconnected, displaysChanged, wake, sleep, screenLocked, screenUnlocked, volumeMounted, volumeUnmounted, daily, interval, timer, edith, networkChanged, powerChanged, batteryChanged, audioChanged, usbConnected, usbDisconnected and pathChanged.

A condition has id, field (eventValue, frontmostApp, runningApp, display, externalDisplay, weekday, time, edith, power, battery, audioOutput, usb), comparison (equals, differs, contains, exists, absent, atLeast, atMost), key (for edith, as owner.key) and value.

A step has id, kind (action, shortcut, wait, startTimer, cancelTimer), owner and actionID for actions, shortcut for shortcuts, seconds (the wait, the timer length, or the shortcut timeout of at most 600) and timerName.

A run has id, ruleID, ruleName, event (kind, value, detail, date), manual, started, finished, status (running, succeeded, failed, cancelled, skipped, preview), message and results, each with stepID, title, status and detail. Dates are ISO 8601.

actions.catalog lists run:<ruleID>, pause and resume for Bifrost and Launchweave; run one with actions.perform and {"actionID":"run:<id>"}. A catalog run finishes when the rule does and fails with the failing step's detail.