Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents https://cmux.com
Find a file
Lawrence Chen 97085be775
Remove index-based CLI APIs, make commands workspace-relative (#89)
* Remove index-based CLI APIs and make commands workspace-relative

Migrate 14 CLI commands from v1 text protocol to v2 JSON-RPC, making them
workspace-relative via CMUX_WORKSPACE_ID env var fallback. Update 7 more
commands to use normalize functions instead of legacy resolvers. Remove dead
code (5 structs, 5 parsers, 3 functions). Add regression tests.

Commands migrated v1→v2: send, send-key, send-panel, send-key-panel,
new-split, new-pane, new-surface, close-surface, list-panes,
list-pane-surfaces, list-panels, surface-health, focus-pane, focus-panel.

Commands updated: move-workspace-to-window, list-workspaces,
close-workspace, select-workspace, trigger-flash, resolveWorkspaceId,
resolveSurfaceId.

* Fix CMUX_SURFACE_ID env fallback when --workspace is overridden

When --workspace is explicitly passed, don't fall back to CMUX_SURFACE_ID
from the caller's environment. The caller's surface belongs to a different
workspace, causing "surface not found" errors. Only use the env var fallback
when the workspace is implicit (from CMUX_WORKSPACE_ID or server default).

Affects: send, send-key, new-split, close-surface, trigger-flash, identify,
notify, claude-hook.

* Validate surface before close and respect -- option terminator in send

P1: close-surface now validates the surface handle exists before sending
surface.close, preventing silent fallback to focused surface when a stale
or mistyped ref is provided.

P2: parseOption now respects -- as an option terminator. send, send-key,
send-panel, send-key-panel strip the -- marker from payload args. This
prevents payload tokens like --workspace from being consumed as routing
flags (e.g. `cmux send -- echo --workspace foo` sends all text correctly).

* Fix test_send_workspace_relative: add to main() and send valid text

The test was never called from main() and sent empty string which would
raise immediately via _run_cli. Send a space character instead and add
the test to the main() call list.

* Respect --id-format in text output and resolve workspace refs across windows

Text-mode list commands (list-workspaces, list-panes, list-panels,
list-pane-surfaces, surface-health) now honor --id-format for plain output,
not just --json. Added textHandle() helper that picks ref/id/both based on
the selected format.

resolveWorkspaceId now enumerates all windows when resolving a workspace
ref, so notify/claude-hook work correctly in multi-window sessions where
the target workspace may be in a non-active window.

* Preserve escape-sequence semantics for send text

The v1 server unescaped \n, \r, \t in send payloads before injecting into
the terminal. The v2 surface.send_text handler sends text verbatim. Add
CLI-side unescapeSendText() to restore the same behavior: \n and \r map
to carriage return (Enter key), \t maps to tab. Applied to send and
send-panel commands.

* Reject malformed handles instead of passing through to server

All four normalize functions (window, workspace, pane, surface) now throw
a clear error for unrecognized handle formats instead of passing them
through. Previously, a typo like `--panel foo` would forward `foo` to the
server which would silently fall back to the focused surface.

* Allow cross-workspace surface refs in close-surface and strip plural ID arrays

Remove workspace-scoped pre-validation from close-surface so explicit
surface refs/UUIDs from other workspaces work without requiring
--workspace. The server resolves workspace from surface_id directly.
Malformed handles are already caught by normalizeSurfaceHandle.

Extend formatIDs to strip plural _ids/_refs array pairs (e.g.
surface_ids/surface_refs in pane.list output) based on --id-format,
matching the existing singular _id/_ref stripping behavior.

* Honor explicit --window over CMUX_WORKSPACE_ID env fallback

When --window is passed globally, skip the CMUX_WORKSPACE_ID env var
fallback so commands operate on the targeted window's selected workspace
instead of the caller's workspace from a different window. Affects all
migrated commands that use workspaceFromArgsOrEnv or inline env fallback.
2026-02-18 22:50:02 -08:00
.claude/commands Add /release-nightly skill and fix release skills (#85) 2026-02-18 20:14:17 -08:00
.github/workflows Merge pull request #83 from manaflow-ai/perf/portal-hosting-selected-mount 2026-02-18 22:31:45 -08:00
Assets.xcassets Add dev build branding and reload scripts 2026-01-28 01:20:48 -08:00
CLI Remove index-based CLI APIs, make commands workspace-relative (#89) 2026-02-18 22:50:02 -08:00
cmuxTests Speed up workspace switching: reduce portal churn and enforce selected z-order 2026-02-18 22:13:40 -08:00
cmuxUITests Rename test targets to cmuxTests and cmuxUITests 2026-02-18 21:19:56 -08:00
docs Add features table with images to README (#63) 2026-02-18 01:24:54 -08:00
ghostty@d641319cd9 Update submodules: ghostty upstream sync, homebrew cask bumps 2026-02-18 01:01:40 -08:00
GhosttyTabs.xcodeproj Bump version to 0.52.0 (#95) 2026-02-18 22:34:24 -08:00
homebrew-cmux@1da02f8acb fixes crashes and filedrop fatal issue 2026-02-18 20:46:31 -08:00
node_modules Update app and tooling 2026-01-29 17:36:26 -08:00
Resources Fix zsh git branch refresh race after cwd change (#71) 2026-02-18 20:36:27 -08:00
scripts Stabilize rapid workspace switching handoff 2026-02-18 21:17:53 -08:00
skills Add sidebar metadata (git branch, ports, logs, progress), fix localhost URL resolution, simplify analytics 2026-02-16 02:46:39 -08:00
Sources Merge pull request #83 from manaflow-ai/perf/portal-hosting-selected-mount 2026-02-18 22:31:45 -08:00
tests Improve terminal hosting depth and workspace mount policy 2026-02-18 19:55:41 -08:00
tests_v2 Remove index-based CLI APIs, make commands workspace-relative (#89) 2026-02-18 22:50:02 -08:00
vendor Restore lost bonsplit + button commits via merge 2026-02-18 02:17:46 -08:00
web Remove docs-site, add PostHog analytics to web (#66) 2026-02-18 04:00:04 -08:00
.gitignore Add /release-local skill and direnv setup 2026-02-17 21:33:11 -08:00
.gitmodules Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
.vercelignore Add Vercel ignore 2026-01-29 17:50:35 -08:00
AGENTS.md agents 2026-01-22 03:18:02 -08:00
bun.lock Update app and tooling 2026-01-29 17:36:26 -08:00
CHANGELOG.md Bump version to 0.52.0 (#95) 2026-02-18 22:34:24 -08:00
CLAUDE.md Rename test targets to cmuxTests and cmuxUITests 2026-02-18 21:19:56 -08:00
cmux-Bridging-Header.h Rename to cmux and add About panel 2026-01-26 03:05:03 -08:00
cmux.entitlements Bump version to 0.48.0 (#80) 2026-02-18 17:56:22 -08:00
CONTRIBUTING.md Rename test targets to cmuxTests and cmuxUITests 2026-02-18 21:19:56 -08:00
ghostty.h Initial commit: macOS terminal app with vertical tabs using libghostty 2026-01-22 01:16:24 -08:00
LICENSE Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
package.json Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
Package.resolved Initial commit: macOS terminal app with vertical tabs using libghostty 2026-01-22 01:16:24 -08:00
Package.swift Rename to cmux and add About panel 2026-01-26 03:05:03 -08:00
PROJECTS.md Reversion all 1.x.x to 0.x.x for pre-launch versioning 2026-02-17 18:31:05 -08:00
README.ar.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.bs.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.da.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.de.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.es.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.fr.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.it.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.ja.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.ko.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.md Add features table with images to README (#64) 2026-02-18 01:31:21 -08:00
README.no.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.pl.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.pt-BR.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.ru.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.th.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.tr.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.zh-CN.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.zh-TW.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
THIRD_PARTY_LICENSES.md add third-party licenses and update bonsplit submodule 2026-02-14 20:33:40 -08:00
TODO.md Update TODO with bugs, refactoring items, and UI improvements 2026-02-17 18:45:38 -08:00

cmux

A Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents

Download cmux for macOS

English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe

cmux screenshot

Features

Notification rings

Panes get a blue ring and tabs light up when AI agents need your attention
Notification rings

Notification panel

See all pending notifications in one place, jump to the most recent unread
Sidebar notification badge

In-app browser

Split a browser alongside your terminal with a scriptable API ported from agent-browser
Built-in browser

Vertical + horizontal tabs

Sidebar shows git branch, working directory, listening ports, and latest notification text. Split horizontally and vertically.
Vertical tabs and split panes
  • Scriptable — CLI and socket API to create workspaces, split panes, send keystrokes, and automate the browser
  • Native macOS app — Built with Swift and AppKit, not Electron. Fast startup, low memory.
  • Ghostty compatible — Reads your existing ~/.config/ghostty/config for themes, fonts, and colors
  • GPU-accelerated — Powered by libghostty for smooth rendering

Install

Download cmux for macOS

Open the .dmg and drag cmux to your Applications folder. cmux auto-updates via Sparkle, so you only need to download once.

Homebrew

brew tap manaflow-ai/cmux
brew install --cask cmux

To update later:

brew upgrade --cask cmux

On first launch, macOS may ask you to confirm opening an app from an identified developer. Click Open to proceed.

Why cmux?

I run a lot of Claude Code and Codex sessions in parallel. I was using Ghostty with a bunch of split panes, and relying on native macOS notifications to know when an agent needed me. But Claude Code's notification body is always just "Claude is waiting for your input" with no context, and with enough tabs open I couldn't even read the titles anymore.

I tried a few coding orchestrators but most of them were Electron/Tauri apps and the performance bugged me. I also just prefer the terminal since GUI orchestrators lock you into their workflow. So I built cmux as a native macOS app in Swift/AppKit. It uses libghostty for terminal rendering and reads your existing Ghostty config for themes, fonts, and colors.

The main additions are the sidebar and notification system. The sidebar has vertical tabs that show git branch, working directory, listening ports, and the latest notification text for each workspace. The notification system picks up terminal sequences (OSC 9/99/777) and has a CLI (cmux notify) you can wire into agent hooks for Claude Code, OpenCode, etc. When an agent is waiting, its pane gets a blue ring and the tab lights up in the sidebar, so I can tell which one needs me across splits and tabs. Cmd+Shift+U jumps to the most recent unread.

The in-app browser has a scriptable API ported from agent-browser. Agents can snapshot the accessibility tree, get element refs, click, fill forms, and evaluate JS. You can split a browser pane next to your terminal and have Claude Code interact with your dev server directly.

Everything is scriptable through the CLI and socket API — create workspaces/tabs, split panes, send keystrokes, open URLs in the browser.

Keyboard Shortcuts

Workspaces

Shortcut Action
⌘ N New workspace
⌘ 18 Jump to workspace 18
⌘ 9 Jump to last workspace
⌃ ⌘ ] Next workspace
⌃ ⌘ [ Previous workspace
⌘ ⇧ W Close workspace
⌘ B Toggle sidebar

Surfaces

Shortcut Action
⌘ T New surface
⌘ ⇧ ] Next surface
⌘ ⇧ [ Previous surface
⌃ Tab Next surface
⌃ ⇧ Tab Previous surface
⌃ 18 Jump to surface 18
⌃ 9 Jump to last surface
⌘ W Close surface

Split Panes

Shortcut Action
⌘ D Split right
⌘ ⇧ D Split down
⌥ ⌘ ← → ↑ ↓ Focus pane directionally
⌘ ⇧ H Flash focused panel

Browser

Shortcut Action
⌘ ⇧ L Open browser in split
⌘ L Focus address bar
⌘ [ Back
⌘ ] Forward
⌘ R Reload page
⌥ ⌘ I Open Developer Tools

Notifications

Shortcut Action
⌘ I Show notifications panel
⌘ ⇧ U Jump to latest unread

Find

Shortcut Action
⌘ F Find
⌘ G / ⌘ ⇧ G Find next / previous
⌘ ⇧ F Hide find bar
⌘ E Use selection for find

Terminal

Shortcut Action
⌘ K Clear scrollback
⌘ C Copy (with selection)
⌘ V Paste
⌘ + / ⌘ - Increase / decrease font size
⌘ 0 Reset font size

Window

Shortcut Action
⌘ ⇧ N New window
⌘ , Settings
⌘ ⇧ , Reload configuration
⌘ Q Quit

License

This project is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).

See LICENSE for the full text.