Turn a command-line tool into steps
Point Switchboard at any command-line tool and its --help becomes steps with real forms; review them before they are saved.
In the app: Window > Imported Steps, Add > Command-Line Tool…, type the name, Read, check the flags, Save Steps. Or in Terminal:
switchboard cli add sips # shows what it found
switchboard cli add sips --yes # saves the steps
Switchboard runs sips --help (and help for each subcommand), reads the options and arguments, and shows you each command with its flags and a sample command line. Read it. Help text is written for people, so a flag can be misread; the review marks the commands it is unsure of. Nothing is saved until you add --yes.
What you get #
One step per subcommand (cli.gh.pr.list), with a checkbox for each switch, a field for each option (a popup when the tool lists the choices), and a list for options you can repeat. The step also has extraArgs for anything the form doesn't cover and allowFailure for tools that exit non-zero on purpose.
The step runs the tool directly with each value as its own argument. It is never given to a shell, so a value like ; rm -rf ~ is only text. In a dry run the step prints the exact command line instead of running it.
Output #
The step returns what the tool printed. If that is JSON, it is parsed so later steps can read its fields. The exit status and the first line of its error output are in the trace; a non-zero exit fails the step.
Updates #
switchboard cli refresh re-reads each tool. When the tool's version changed and a command or flag disappeared, its steps are marked stale instead of failing quietly.