cmux Cheatsheet

Panes and Navigation

Use this cmux reference while you build software engineering projects, review code, or refresh the syntax you reach for most.

Splits and panes

A pane is a split container, a surface is one tab inside it. ⌘D splits right, ⌘⇧D splits down, and the CLI takes an explicit direction.

cmux new-split right
cmux new-split down --command "npm run dev"
cmux new-split right --pane pane:1 --focus true
cmux new-pane --type browser --url http://localhost:3000
cmux new-pane --direction down --type terminal
cmux list-panes
cmux list-pane-surfaces --pane pane:1
CommandPurpose
new-split <left|right|up|down>split from a surface
new-pane [--type terminal|browser|simulator]new pane with content
new-surface [--type ...] [--pane <h>]new tab inside a pane
close-surfaceclose one tab
focus-pane --pane <h>move focus
split-off --surface <h> <dir>pull a tab out into its own split
drag-surface-to-split --surface <h> <dir>same, as the drag gesture
toggle-split-zoom (shortcut)temporarily maximize a pane

Moving surfaces around

cmux move-surface --surface surface:7 --pane pane:2 --focus true
cmux reorder-surface --surface surface:7 --before surface:3
cmux move-tab-to-new-workspace --tab tab:2 --title "Scratch"
cmux swap-pane --pane pane:1 --target-pane pane:3
cmux break-pane --pane pane:2
cmux join-pane --target-pane pane:1 --pane pane:3

move-surface accepts --before, --after, or --index <n> for ordering, and --workspace or --window to move across containers. break-pane and join-pane are the tmux-compatible spellings of pull-out and merge.

Tabs inside a pane

tab-action is the horizontal tab context menu.

--actionEffect
rename · clear-namewith --title
close-left · close-right · close-othersbulk close
new-terminal-right · new-browser-rightadd a sibling tab
reload · duplicatefor browser and terminal tabs
pin · unpin · mark-unreadtab state
cmux tab-action --action rename --title "server" --tab tab:2
cmux rename-tab surface:4 "tests"

tab-action and rename-tab also accept tab:<n> and default to CMUX_TAB_ID when it is set.

Resizing and reading panes

cmux resize-pane --pane pane:2 -R --amount 10
cmux read-screen --surface surface:3
cmux read-screen --surface surface:3 --scrollback --lines 200
cmux capture-pane --surface surface:3 --lines 50
cmux send --surface surface:3 "npm test"
cmux send-key --surface surface:3 enter
cmux clear-history --surface surface:3

resize-pane takes -L, -R, -U, -D like tmux. app.paneResizeStepPixels controls how far the keyboard resize shortcuts move, default 20 pixels. send writes text with no newline, so pair it with send-key enter.

The right sidebar

The right sidebar carries files, find, sessions, feed, and the dock, and is scriptable.

cmux right-sidebar toggle
cmux right-sidebar files
cmux right-sidebar find --no-focus
cmux right-sidebar mode
cmux sidebar-state --json

Modes are files, find, vault, sessions, feed, and dock. Custom sidebars are a beta feature: drop a SwiftUI-style file in ~/.config/cmux/sidebars/, then right-click the sidebar button to pick it, and validate with cmux sidebar validate. Custom right-sidebar terminal controls come from .cmux/dock.json in a project or ~/.config/cmux/dock.json.

Browser panes

The browser is a pane type, and ⌘⇧L splits one next to a terminal.

cmux browser open http://localhost:3000
cmux browser open-split http://localhost:5173
cmux browser goto https://example.com --snapshot-after
cmux browser snapshot --interactive
cmux browser click "button[type=submit]"
cmux browser fill "#email" me@example.com
cmux browser eval "document.title"
cmux browser console list
cmux browser screenshot --out /tmp/shot.png
cmux browser devtools toggle

Navigation shortcuts inside a browser pane mirror a real browser: ⌘L address bar, ⌘[ and ⌘] back and forward, ⌘R reload, ⌥⌘I devtools, ⌥⌘C console. Disable the browser entirely with cmux disable-browser, and check state with cmux browser-status.

Inspecting the layout

cmux tree --all
cmux top --processes --sort cpu
cmux memory --all
cmux identify --json
cmux surface-health

tree prints windows, workspaces, panes, and surfaces with the refs every other command accepts. top adds process and resource usage per surface, with --format tree|tsv for scripting, and memory groups terminal memory use.