- On your Mac, open the Shortcuts app and make a new shortcut.
- Add the Run Shell Script action. For a command in a new Terminal window, paste: osascript -e 'tell application "Terminal" to do script "npm run dev"' (change npm run dev to your command).
- Name the shortcut, for example Start dev server.
- In TouchDeck, add a key and choose the macOS Shortcut action, then pick that shortcut from the list.
- Press the key. The command runs on your Mac, in a script you wrote.
How to run a Terminal command from your iPhone or iPad
TouchDeck never runs shell commands itself, on purpose. A macOS Shortcut can, and a key can run that Shortcut.