All pages

Lesson 4.2 · Automate · 8 min

The command queue

Stage commands that run one after another.

Listen

After this lesson you can line up commands that run one after another in a pane, stop the line when something fails, and hand files or screenshots to the next command.

Time: 8 minutes · Works on: macOS app.

How the queue works

The Queue tab holds a first-in, first-out list of commands. Each command is tied to the pane that was focused when you queued it. When the command running in that pane finishes and the prompt comes back, the next one is sent.

TRMNLY knows a command has finished through shell integration, which marks the moment the prompt returns. That's why the queue waits for real completion rather than guessing with a timer.

Queue your first commands

  1. Click into a terminal pane.
  2. Show the right sidebar with ⌘⇧\ and click Queue.
  3. Type sleep 3 && echo first into the field, then press ⌘↩ or click +.
  4. Add echo second and echo third the same way.
  5. In the pane, run anything, such as echo go. When it finishes, the queue sends sleep 3 && echo first, then the rest, one after another.

Rows can be edited in place and dragged to reorder. Run next now sends the first command without waiting. Clear drops every command shown.

Choose how commands are sent

Three switches sit under the field. TRMNLY remembers them between launches.

  • Press Return is on by default. Turn it off to type the text into the pane without running it. That's useful for filling in a prompt inside a program like an installer or a coding CLI.
  • Stop on error is off by default. Turn it on and, if a command exits with an error, the rest of the queue is dropped. A banner shows the exit code and how many commands were skipped.
  • Auto-run is off by default. Turn it on and a new command runs right away if the pane is idle at a prompt, instead of waiting for the next command to finish.

Try Stop on error:

  1. Turn it on.
  2. Queue false, then echo you should not see this.
  3. Run something in the pane. false fails, and the banner says one command was dropped.

See more than one pane

The picker in the Queue header changes what the list shows: Tab, Project or All Windows. Each row has a chip naming its pane. Use it to move a command to a different split.

Attach files and screenshots

A queued command can carry attachments.

  • Paste an image with ⌘V into the field. It's saved as a PNG under the project's .trmnly/attachments/ folder and shown as a chip.
  • Drop files onto the panel, or pick them with the paperclip. These point at the original file rather than copying it.

The picker next to the switches decides how attachments are added to the command:

  • @path, the default, adds @/full/path for each file. Claude Code and similar coding CLIs read that as an attached file.
  • drop adds shell-escaped paths, the same as dragging files from Finder onto the pane.

A command with attachments and no text is allowed. That's how you hand a screenshot to a coding CLI that's waiting for input.

The queue and the rest of TRMNLY

  • Every saved prompt has a queue button that adds it here. See Saved prompts.
  • A scheduled terminal command is added to this same queue, so it follows the same rules, including Stop on error. See Schedules and background jobs.
  • The agent can queue commands for you to review and run. Ask it: "Queue the build and the test commands in my focused pane, but don't run them."
  • While anything is queued, TRMNLY keeps the Mac from sleeping, so a long queue can drain overnight. You can turn that off under Settings → General → Sleep.

This queue is for terminal commands. Prompts you type while the agent is still answering go into the agent's own prompt queue, which lives in the agent sidebar.

Check yourself

  • Three queued commands ran in order after the pane's current command finished.
  • With Stop on error on, a failing command dropped the ones behind it.
  • A pasted screenshot showed up as an @/… path in the sent command.

Go further