Skip to content

Commands

Command Behavior
bmux Create and attach to a fresh session in the current directory; bmux attach returns to an existing one
bmux new [--dir PATH] [--detach] NAME Create a named session; attach unless --detach is set
bmux attach [NAME] Attach by name, or to the most recently used session (the first in bmux list)
bmux project [DIR] Attach to the session started in DIR, creating one named after it if there is none; without DIR, open the new-session popup
bmux layout save [SESSION] Write the session’s windows, splits, pane directories and agents’ resume commands to .bmux.toml in its folder, and trust it; inside a pane, the pane’s session
bmux layout trust [DIR] Let DIR’s .bmux.toml (default: the current folder) run its commands, as it is now
bmux list Show sessions, state, window/pane/client counts, and starting directories, most recently used first
bmux rename OLD NEW Rename a session
bmux kill NAME Terminate the session and all its panes, without a confirmation prompt
bmux focus DIRECTION Move from the calling pane toward left, right, up, or down; used by editor mappings
bmux zoomed Print true if the calling pane’s window is zoomed, otherwise false; used by editor mappings to stay in a zoomed pane
bmux agent STATE [NAME] [-- COMMAND...] Report the calling pane’s agent as working, blocked, idle, or clear, optionally with the command that resumes its conversation; used by agent hooks
bmux agents [--json] List panes running a coding agent as SESSION:PANE targets, with state and seq
bmux capture [--json] TARGET Print a pane’s visible text; TARGET is SESSION, SESSION:PANE, SESSION:WINDOW. or SESSION:WINDOW.N (see targets)
bmux send TARGET [--if-seq N] (--key KEY | --text TEXT)... Type keys and text into one pane, in order; with --if-seq, only if its agent hasn’t changed state
bmux wait-agent [--state S,...] [--since SEQ] [--timeout D | --notify SESSION:PANE] [TARGET...] Wait until another agent pane is blocked or idle and print it as JSON; with --notify, keep running and type each change into a supervising agent’s pane while it’s idle
bmux split [TARGET] [-h | -v] [-c DIR] [-d] [-- COMMAND...] Split a pane side by side (-h) or stacked (-v, the default), in its directory or DIR, type COMMAND into the new shell and print the new pane’s target; -d keeps focus where it was. Without TARGET, the calling pane
bmux new-window [TARGET] [-n NAME] [-c DIR] [-d] [-- COMMAND...] Open a window in the target’s session, with the same options as split; prints the new pane
bmux select TARGET Focus a pane, bringing its window forward, or select a window (SESSION:WINDOW.)
bmux kill-pane TARGET, bmux kill-window TARGET Close a pane, or the target’s window, and their programs without asking
bmux resize [TARGET] left|right|up|down [CELLS] Move a pane’s divider, 5 cells unless CELLS says
bmux zoom [TARGET] Zoom or unzoom a pane
bmux rename-window [TARGET] NAME Rename the target’s window; an empty name shows its focused pane’s title
bmux list-panes [TARGET] [-a] [-F FORMAT | --json] List the panes of the target’s window (SESSION:WINDOW. or a pane), its whole session (SESSION), or every session (-a); without a target, the calling pane’s window. -F prints each pane as a format
bmux list-windows [TARGET] [-a] [-F FORMAT | --json] List the windows of the target’s session, or every session’s (-a); a window’s variables come from its focused pane
bmux display-message [TARGET] [-p] FORMAT Expand FORMAT for a pane (the calling pane by default): -p prints it; otherwise it shows in the notice box of every client attached to that session
bmux reload Tell the running server to reload config.toml and notify every attached client to reload theirs
bmux theme [NAME | --list] Switch the theme in config.toml and reload clients, or print every built-in theme with --list
bmux default-config Print every config.toml setting, commented out, with its default
bmux run-shell [-t TARGET] [-b] COMMAND Run a shell command for a pane (the calling pane by default): BMUX_* metadata env vars, shell-escaped #{...} variables and directory; exits with the command’s status. -b doesn’t wait
bmux if-shell [-t TARGET] CONDITION COMMAND [ELSE] Run CONDITION the same way, then COMMAND if it succeeded or ELSE if it failed
bmux pipe-pane [-t TARGET] [-o] [COMMAND] Copy everything the pane prints, escape sequences included, into COMMAND’s stdin, like tmux’s pipe-pane: bmux pipe-pane 'cat >> ~/${BMUX_SESSION}-${BMUX_PANE}.log'. COMMAND runs like run-shell’s; a new one replaces the old. No COMMAND stops piping; -o stops a piped pane and starts an unpiped one, so one key can toggle logging. Piping stops when the command exits or the pane closes. A command that can’t keep up loses output; the pane never waits for it
bmux guide Print the guide for coding agents: how to read, drive and watch panes
bmux capabilities Print the version, protocol version, commands and calling pane as JSON
bmux integration status [AGENT] List agent integrations: installed, update available, available (the agent is on PATH) or not found
bmux integration install [AGENT...] Install or update integrations; with no names, every one that is available or out of date
bmux integration uninstall AGENT... Remove what bmux installed for these agents
bmux restart Save sessions, stop the server and start this binary’s server, which restores them; attached clients reconnect
bmux update [--check] [--beta|--stable] Install the newest release after checking it against its checksums; --check only reports; --beta includes pre-releases; --stable steps back from a beta. See Updates
bmux version, bmux --version Print the version
bmux help, bmux --help, bmux -h Show help

Put new options before the name. --dir defaults to the current directory; the directory must exist. Relative paths are resolved from the invoking shell. --detach defaults to false. Use -- before a name beginning with a dash.

bmux new --dir ~/projects/api api
bmux new --detach logs
bmux list
bmux attach api
bmux rename api backend
bmux kill logs

bmux attach does not create a session when none exist. Start one with bmux or bmux new NAME. The server uses bmux --serve internally; normal use does not require launching it yourself.

Inside a bmux pane, bmux, bmux attach and bmux new NAME refuse to start a second client, like tmux checks $TMUX: a nested client would shrink into the pane and fight over keys. Switch with Ctrl-a s instead, create sessions with bmux new --detach NAME, or unset BMUX_SESSION to nest anyway.

list-panes -F, list-windows -F and display-message replace #{name} with the pane’s value, like tmux. ## is a literal #; unknown names expand to nothing. Booleans are 1 or 0.

Variable Value
session_name, session_id, session_path The session’s name, ID (BMUX_SESSION_ID) and starting directory
session_windows, session_attached Its window count and attached clients
window_index, window_name The pane’s window number and name, as its tab shows it: the window’s name, else its focused pane’s title, else shell
window_active, window_zoomed, window_panes Whether the window is the active one or zoomed, and its pane count
pane_id, pane_index, pane_target, pane_active The pane number, its position in the window, SESSION:PANE, and whether it’s the window’s focused pane
pane_current_path, pane_current_command The pane’s directory and the program in front of its shell (empty at the prompt)
pane_title, pane_width, pane_height Its title and size
pane_agent, pane_agent_state Its coding agent and that agent’s state, when it has one
pane_pipe Whether bmux pipe-pane is copying its output
bmux display-message -p '#{pane_current_path}'
bmux list-panes api -F '#{pane_target} #{pane_current_command}'
bmux list-windows -a -F '#{session_name}:#{window_index} #{window_name}'
bmux display-message api 'tests passed in #{window_name}'