Browse the docs

switchboard run

Starts a macro by id or name, with inputs, optionally as a dry run, and can wait for it to finish.

Details #

switchboard run <id|name> starts one macro through the engine and prints the new run id. The macro runs in the engine, not in the terminal.

The target is matched by id first. If no id matches, it is matched by name, ignoring case. If no name matches, the start of an id (four characters or more) is accepted when only one macro begins with it, the way git takes a short hash. A name or a start that matches more than one macro is refused: use more of the id.

switchboard run "Paste ticket as title" --input key=DAY-412

With --wait the command stays until the run ends. It prints one line per step as steps finish, then the final status. The exit code is 0 when the run succeeded and 1 when it did not.

switchboard run m_4f2a9c --dry-run --wait
  simulated   s1  2 ms
  simulated   s2  1 ms
succeeded

Parameters #

switchboard run <id|name> [--input k=v]… [--dry-run] [--wait] run a macro now (--wait prints each step)

Examples #

# run it and look at the trace afterwards
id=$(switchboard run "Backup notes")
switchboard trace "$id"
# use the result in a script
switchboard run "Clean downloads" --wait || echo "the macro failed"

Gotchas #

  • Without --wait, the exit code only says the run was queued, not that it worked.

  • Exit 65 means no macro matched, or the name matched several.

  • Exit 64 means a usage error, such as --input without name=value.

  • Exit 69 means the engine is not running.

See also #