A radial menu for Terminal and iTerm2 on Mac: profiles, SSH, and sessions
If you live in a terminal, you already know the loop. The same four or five SSH targets. The same three iTerm2 profiles — one with the dark theme for prod, one with the red background for staging, one with the bigger font for screen-shares. The same handful of tmux sessions you re-attach to a hundred times a week. Each one a few keystrokes, each one a small interruption.
This post is the honest layout for putting that loop on a radial menu. Up front: Swik does not integrate with iTerm2 or Terminal directly. There is no special "iTerm provider." What there is, is iTerm2's well-documented AppleScript surface, Terminal's do script, the iTerm2 Python API, and Apple Shortcuts as the glue. Swik's job is to put a wedge on a hotkey or mouse side button that fires the one-line Shortcut.
If you are willing to write four or five short Shortcuts, you can collapse a working week of typing into a flick.
What "wired up" means here
Be clear on the architecture before you build it, because it is the whole point of the post:
- You write an Apple Shortcut. The Shortcut runs one of: an AppleScript that talks to iTerm2 or Terminal, a shell command via "Run Shell Script," or a small Python script that uses the iTerm2 API.
- In Swik, you create a wedge with the action set to Run Shortcut, point it at the Shortcut you just wrote, give it an icon and a label.
- You bind Swik to a hotkey or a mouse side button.
That is the whole stack. There is nothing iTerm2-specific in Swik. There is nothing Swik-specific in your Shortcut. The two communicate via the standard macOS automation surface, which is the right shape for a Unix mind: small composable pieces that don't know about each other.
Running Shortcuts from a wedge is a Pro feature in Swik. Full walkthrough on Shortcuts triggering here.
iTerm2 profiles on a wedge
iTerm2 profiles are the obvious first thing to wire up. You have probably already named them — "Production," "Staging," "Local," "Screenshare." Each one defines a colour scheme, font size, command, working directory, maybe a startup tmux command. The slowest part of your day is picking the right one out of the profile menu.
The AppleScript is one line:
tell application "iTerm" to create window with profile "Production"
Wrap that in an Apple Shortcut using the "Run AppleScript" action. Save it as "iTerm: Production." Repeat for "iTerm: Staging," "iTerm: Local," "iTerm: Screenshare." Now you have four Shortcuts, each one line of AppleScript long.
In Swik, build a sub-menu wedge labelled "iTerm profiles" and put each Shortcut on a position. Top wedge for the one you reach for hourly. Bottom wedge for the once-a-week one. After a few days your hand stops thinking about which direction means which profile — that is spatial memory doing its job.
The same pattern works with Terminal.app if you prefer it. The AppleScript is:
tell application "Terminal" to do script "ssh prod-web-01"
Terminal does not have profiles in the iTerm sense, but do script with no terminal argument opens a new window and runs the command in it.
SSH targets on a wedge
This is where the time-saving compounds. If you SSH into the same five hosts every day — a prod box, a staging box, a build server, a database jump host, a personal VPS — each one belongs on a wedge.
Two ways to wire it. Pick whichever fits your existing setup.
Option A: AppleScript via iTerm. One Shortcut per host. Each Shortcut runs:
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "ssh prod-web-01"
end tell
end tell
A few lines, but it gives you a fresh window for each connection so you can have all five SSH targets open simultaneously without crowding tabs. Save as "SSH prod-web-01" etc., wire each to a wedge.
Option B: Shell out via Shortcuts. If your ~/.ssh/config already has clean Host blocks, the Shortcut can be even simpler — a "Run Shell Script" action that runs open -a iTerm followed by an AppleScript step that pipes the ssh command in. Or you can lean on iTerm2's command URL handling, which can ssh to a host when one is part of the URL — useful if you want a Shortcut to open a clipboard URL in iTerm2.
For most setups, Option A is enough. The AppleScript surface is older but it is rock-solid, and for "open a window, run this command" it is the shortest path.
tmux sessions on a wedge
If you live in tmux, your real "open the right terminal" is "attach to the right session." The Shortcut for that is the same shape:
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "tmux a -t work"
end tell
end tell
One Shortcut per named session. work, infra, scratch, whatever you actually have. Each on a wedge in a "tmux" sub-menu.
If you have one long-running tmux session that contains everything, the wedge is even simpler — a single "Attach" wedge that opens a window and runs the attach. The radial menu becomes the "drop me back into my work" button you reach for after lunch, after a meeting, after a context switch.
Hotkey Window vs radial menu — they are not competitors
iTerm2's Hotkey Window is one of the best terminal features on the Mac. Press a key, a window slides down. Press it again, it goes away. If your only goal is "I need a shell, now," the Hotkey Window beats anything.
The radial menu solves a different problem: "I need the right shell, now." Different SSH host, different profile, different tmux session, different working directory. The Hotkey Window gives you whatever your default profile is. The radial menu gives you a choice in a single flick.
| Job | Best tool |
|---|---|
| Open a generic shell in two seconds | iTerm2 Hotkey Window |
| Open a specific SSH target | Radial menu wedge |
| Open a specific iTerm profile | Radial menu wedge |
| Re-attach to a named tmux session | Radial menu wedge |
| Hide the terminal again | iTerm2 Hotkey Window |
| Quick scratch shell for a one-liner | iTerm2 Hotkey Window |
| Switch which terminal app you are in | Radial menu wedge |
Run both. They are bound to different triggers and they cover non-overlapping motions.
The Python API for the iterative cases
iTerm2's Python API is the actively maintained automation surface — the AppleScript layer is stable but no longer receiving new features. For most "open a profile" or "ssh to a host" cases, AppleScript is enough and shorter. The Python API is the right tool when you need:
- Session-aware behaviour. "If a tab named 'logs' is already open, focus it; otherwise create one." That is a few lines of Python and not really expressible in AppleScript.
- Layout reconstruction. Open a window with a specific split arrangement — left pane top half a log tail, right pane an editor, bottom pane a shell.
- Bulk SSH. Open one window with a tab per host, each pre-running its own ssh.
For these, write the script once, save it somewhere on disk, and call it from a Shortcut via "Run Shell Script." The wedge in Swik does not change shape — it is still a Run Shortcut wedge — only the work the Shortcut does gets bigger.
A worked layout for a backend developer
Five top-ring wedges, two sub-menus. This is what a real terminal-heavy day might look like.
| Ring | Wedges |
|---|---|
| Top ring (5) | iTerm2 (default profile) · Editor · Browser · Slack · Notes |
| SSH sub-menu | prod-web-01 · staging-web-01 · build-server · db-jump · personal-vps |
| iTerm profiles sub-menu | Production · Staging · Local · Screenshare · Logs |
| tmux sub-menu | work · infra · scratch · oncall · attach last |
That is one trigger, three sub-menus, every common terminal destination one or two flicks away. The top ring still has the rest of your day on it — Swik doesn't become "the terminal launcher," it becomes the one launcher with a terminal section.
Context profiles for on-call vs build days
If your work splits cleanly — Monday is on-call, Tuesday is feature work — Swik's context-aware profiles can swap the menu based on Wi-Fi, display, or time of day. Two patterns I have seen developers use:
- On-call profile. Top ring promotes the alerting dashboard, the runbook wiki, and the prod SSH wedge. SSH sub-menu is reordered with the most-paged hosts at the top.
- Build day profile. Top ring promotes the editor, the local dev iTerm profile, and the build-server SSH. Production SSH demoted to the sub-menu so you cannot fat-finger into it.
Profile switches happen automatically based on the trigger. There is no "switch profile" wedge to remember to press. You walk in, plug in the external display, the on-call ring is what pops up.
What this is not
Worth being explicit:
- Not an iTerm2 plugin. Swik runs at OS level. It does not see your tabs, sessions, or scrollback. Everything it does to iTerm2, it does through AppleScript or Shortcuts that you wrote.
- Not a tmux replacement. tmux is doing the session management; Swik is just the one-flick way to attach. If you want session management, learn tmux.
- Not a typed launcher. If your terminal use is mostly "I want to ssh to a host I just thought of," typing it in Raycast or Alfred is faster than building a wedge for it. Wedges are for the things you do constantly. The long tail belongs in a typed launcher or in
~/.ssh/config. - Not a scripting environment. Apple Shortcuts is. The wedge is the trigger.
That sharpness is the point. Swik puts a button on the desk; you decide what the button does. For terminal users, the buttons turn out to be the SSH targets, the profiles, and the sessions you already type by reflex — and turning each of those reflexes into a flick is a quietly significant upgrade to a working day.
Frequently asked questions
Does Swik integrate directly with iTerm2 or Terminal?
No. Swik has no built-in iTerm2 or Terminal integration. The wiring is done by you, through Apple Shortcuts that run AppleScript or shell commands. iTerm2 has long-standing AppleScript support — for example, tell application "iTerm" to create window with profile "Production" — and Terminal.app responds to do script. Swik's job is to put a wedge on a hotkey or mouse button that fires that one-line Shortcut.
How is this different from iTerm2's Hotkey Window?
They solve different problems. The Hotkey Window gets you a terminal fast — one keystroke and the window drops down. A radial menu gets you the right terminal fast — one flick selects which SSH target, which profile, or which tmux session. Most heavy terminal users keep the Hotkey Window for the generic "I need a shell now" case and use a Swik wedge when the shell needs to be a specific one.
Can I attach to a tmux session from a wedge?
Yes, via a Shortcut. Build an Apple Shortcut that opens iTerm2 (or Terminal) and runs tmux a -t sessionname. Bind that Shortcut to a wedge in Swik and the whole sequence — open terminal, attach to the named session — happens in one flick. You can have one wedge per session, or one wedge that opens a sub-menu of sessions.
What about iTerm2's Python API?
iTerm2's Python API is more powerful than its AppleScript layer and is the actively maintained route for new automation. You can call a Python script from an Apple Shortcut (via "Run Shell Script") and bind that Shortcut to a wedge. For most day-to-day "open this profile" or "ssh to this host" cases, the AppleScript one-liner is enough. Reach for the Python API when you need session inspection, tab management, or anything iterative.
Swik — a radial menu for macOS
Launch anything. One gesture. Free for five wedges, $9 one-time for unlimited. Requires macOS 14 Sonoma or later.
Download for macOS