Skip to content
Muxin
Docs · Run a command everywhere

On your machines

Run a command everywhere

One command on several machines at once, with each one’s output side by side.

Check the disks on every machine, update Homebrew on all your Macs, pull the same repo everywhere: Run (⌃6) runs one command on the machines you pick, at the same time, and shows each one’s output as it comes.

The Run page: df -h / run on eight machines, each machine's output in its own card with a check mark and how long it took. The Run page: df -h / run on eight machines, each machine's output in its own card with a check mark and how long it took.
One command, eight machines, a second later.

Run one

  1. Type the command.
  2. Pick the machines. Every machine that’s online is picked to start with; click one to leave it out, or None (then All) to start over. Offline and disconnected machines are greyed out.
  3. Click Run on N, or press Return.

To start with a single machine, right-click it in the sidebar › Run a command….

Where it runs

On each machine the command runs in your login shell, from your home folder, as you. Your PATH and tools are there as in your terminal. There’s no terminal and nothing to type into: a command that asks a question (a password, “Continue? [y/N]”) gets no answer and usually gives up. Pass the flag that skips the question, like -y.

It’s your real machines, not a sandbox. Read the command before you press Run on twelve of them.

The output

  • Each machine gets a card, filled in as its output comes. The header says how it went: a check mark and how long it took, or why it failed (“Exit 1”).
  • Above the cards, “All done”, or how many failed.
  • The expand button on a card makes it bigger, with more of its output. All of it is in Activity (⌘J).
  • Clear clears the results.

Recent commands

Your last eight commands are listed under the box as Recent. Click one to put it back. They’re still there after you quit. The × forgets them.

Snippets

A snippet is a command you save once and run with one click. Give it a name, and a folder if you like.

  • Save one: type the command, then click the star next to Run. Or click New snippet under Snippets.
  • Run it here: the play button runs it on the machines picked. Click its name to put it in the box first, to change it before it runs.
  • In a terminal: on a session’s page, Snippets types one into its terminal and presses Return. Folders open as their own menus.
  • From the palette: press ⇧⌘P and type its name. On a session’s page it goes into that terminal. On a machine’s page it runs there. Anywhere else it waits in Run for you to press Return.
  • Change or delete one: the pencil and the bin next to it.

Snippets are kept in config.toml, so they survive a restart:

[[settings.snippets]]
name = "Disk space"
command = "df -h /"
folder = "Checks"

A command can have several lines. They run one after another.

From a terminal and from agents

muxin run --on beacon,mac-studio -- df -h /
muxin run --all -- brew upgrade            # every machine that’s online
muxin run --all --timeout 1800 -- git -C ~/code/api pull
  • It waits for all of them and prints each one’s output and exit status. It exits 1 when any of them failed, so it works in a script.
  • Each one may run 10 minutes by default; --timeout takes up to an hour (3600 seconds).

Snippets work from a terminal too:

muxin snippet ls
muxin snippet add "Disk space" --folder Checks -- df -h /
muxin snippet run "Disk space" --on beacon,mac-studio   # or --all
muxin snippet rm "Disk space"

Agents use run_on_machines(machine_ids, command, timeout_secs?), and snippet_list and snippet_run(name, machine_ids) for your snippets. They’re told to run it only when you ask, and to show you the command first. See MCP for your agents.

For something that should run at set times, not just now, make it a schedule.