Launch and orchestrate multiple AI CLI tools in parallel tmux sessions.
Modern developers use more than one AI coding assistant -- Claude Code, Gemini CLI, GitHub Copilot, AIChat, and the list keeps growing. Switching between terminal tabs is tedious, and there is no simple way to run them side-by-side, share context between them, or broadcast the same prompt to all of them at once.
cli-switch solves this by launching your chosen AI CLIs in a single tmux session with dedicated panes, a shared buffer for cross-pane copy/paste, broadcast messaging, synchronized typing, and a status bar showing every available keybinding.
- Multi-tool launch -- start Claude, Gemini, Copilot, and AIChat (or any subset) in one command.
- Configurable layouts -- side-by-side, stacked, tiled, main-horizontal, and main-vertical arrangements.
- Shared buffer -- capture output from any pane and paste it into another. The buffer is persisted to disk with timestamped history.
- Broadcast -- send the same prompt to every pane simultaneously, from a keybinding or from another terminal.
- Synchronized typing -- toggle sync mode so keystrokes go to all panes at once. A bright
SYNC ONindicator appears in the status bar when active. - Clickable action menu -- click anywhere on the status bar or press
Ctrl-b Spaceto open a popup menu with all actions (capture, paste, broadcast, sync, kill, layout switching, and more). - Mouse support -- click to focus a pane, drag to resize, scroll to review history. Drag to select text and it is automatically copied to the system clipboard (macOS).
- Selective kill -- kill individual panes by index or tool name without tearing down the whole session.
- Status bar -- styled bottom bar showing
[MENU]button, session info, pane count, keybinding hints, sync indicator, and a clock. - YAML config file -- set default tools, layout, session name, and keybindings in
.cli-switch.yaml. - Multiple concurrent sessions -- launch as many sessions as you want. Names auto-increment (
ai-switch,ai-switch-2,ai-switch-3, ...) so sessions never collide. - Session management -- list all active sessions, stop individual sessions by name, or tear down everything with
--all. - CLI subcommands -- broadcast, capture, paste, kill, stop, sessions, and status commands usable from any terminal.
| Tool | What it does | What cli-switch adds |
|---|---|---|
| tmux (raw) | Terminal multiplexer | cli-switch eliminates the manual setup -- no more split-pane, launch tools, configure keybindings every time |
| aichat | Multi-model CLI (switch models in one tool) | Single session, one model at a time. Cannot run models simultaneously or compare outputs side-by-side |
| mods (Charmbracelet) | Pipe-friendly AI CLI | Designed for scripting (cat file | mods "explain"), not interactive parallel sessions |
| fabric | AI prompt chaining | Sequential prompt pipelines, not parallel interactive sessions |
| aider | AI pair programming | Deep git integration but single-model, not a multi-tool orchestrator |
| Terminal tabs | What most people do today | No cross-session communication, no shared buffer, everything manual |
What cli-switch uniquely offers:
- Parallel interactive sessions -- run Claude, Gemini, and Copilot simultaneously and see all responses at once
- Cross-session communication -- capture output from one AI and paste it as input to another
- Broadcast -- ask the same question to multiple AIs at once and compare answers
- Zero lock-in -- it does not wrap or replace any AI CLI, it just orchestrates them side-by-side
When cli-switch shines:
- Comparing AI outputs -- broadcast "write me a function" to 3 tools, pick the best answer
- Cross-review workflows -- Claude writes code, Copilot reviews it, Gemini researches the approach
- Team standardization -- everyone gets the same multi-tool setup with
.cli-switch.yamlin the repo - AI evaluation -- testing the same prompts across models systematically
When you probably don't need it:
- You only use one AI CLI
- You prefer IDE-integrated AI (Cursor, Copilot in VS Code)
- You don't need side-by-side comparison
| Dependency | Minimum Version | Install |
|---|---|---|
| Node.js | 18.0+ | https://nodejs.org |
| tmux | any recent | brew install tmux (macOS) or apt install tmux (Linux) |
At least one supported AI CLI tool must be installed (see Supported Tools).
Option 1: Clone and link
git clone https://github.com/nakurian/cli_switch.git
cd cli-switch
npm install
npm linkOption 2: One-liner
curl -fsSL https://raw.githubusercontent.com/nakurian/cli_switch/main/install.sh | bashcli-switchThis launches the default tool set (claude, gemini, copilot) in a tiled tmux layout. You will be attached to the session automatically.
# Launch all defaults (from config or claude + gemini + copilot)
cli-switch
# Launch specific tools
cli-switch claude gemini
# Choose a layout
cli-switch claude gemini copilot --layout horizontal
cli-switch claude gemini copilot --layout vertical
cli-switch claude gemini copilot --layout main-vertical
# Use a custom session name
cli-switch --session my-sessionAvailable layouts: horizontal (side by side), vertical (stacked), tiled (default), main-horizontal, main-vertical. You can also switch layouts at any time from the action menu.
Click anywhere on the status bar (the bottom bar) to open the action menu. You can also press Ctrl-b Space from the keyboard.
The menu provides one-click access to:
- Capture / Paste (shared buffer)
- Broadcast to all panes
- Toggle sync typing
- Kill pane / Quit all
- Switch layout (side by side, stacked, tiled)
- Detach
All keybindings use the tmux prefix (default Ctrl-b), followed by the key listed below. These are also displayed in the status bar.
| Keybinding | Action |
|---|---|
Ctrl-b + Space |
Open the action menu (same as clicking status bar) |
Ctrl-b + S |
Capture the last 50 lines from the active pane to the shared buffer |
Ctrl-b + P |
Paste the shared buffer into the active pane |
Ctrl-b + B |
Open a prompt and broadcast the typed text to all panes |
Ctrl-b + Y |
Toggle synchronized typing (keystrokes go to all panes) |
Ctrl-b + x |
Kill the active pane |
Ctrl-b + Q |
Quit the entire session (with confirmation prompt) |
Ctrl-b + d |
Detach from the session (keeps it running in the background) |
Ctrl-b + arrow keys |
Switch focus between panes |
| Click status bar | Open the action menu |
| Click pane | Select/focus a pane |
| Drag to select text | Copy selection to system clipboard (macOS) |
| Drag pane border | Resize panes |
When sync mode is active, a bright SYNC ON badge appears in the status bar. Press Ctrl-b Y again (or use the menu) to turn it off.
While a cli-switch session is running, you can control it from a separate terminal window:
# Broadcast a prompt to every pane
cli-switch broadcast "review this code for security issues"
# Capture output from a specific pane (default: pane 0, last 50 lines)
cli-switch capture -p 0 -n 100
# Paste the shared buffer into a specific pane
cli-switch paste -p 1
# Kill a specific pane by index or tool name
cli-switch kill 0
cli-switch kill claude
cli-switch kill 0 2
# Kill all panes (tears down the session)
cli-switch kill all
# List all active cli-switch sessions
cli-switch sessions
# Stop a specific session by name
cli-switch stop ai-switch-2
# Stop the default session
cli-switch stop
# Stop ALL cli-switch sessions at once
cli-switch stop --all
# Check session status and list active panes
cli-switch statusA typical cross-tool review workflow:
- Launch Claude and Copilot side by side:
cli-switch claude copilot --layout horizontal
- Ask Claude (pane 0) to write a function.
- Capture Claude's output: click the status bar and select "Capture to buffer" (or press
Ctrl-b S). - Switch to Copilot's pane: click on it.
- Paste the captured output: click the status bar and select "Paste from buffer" (or press
Ctrl-b P). - Ask Copilot to review the pasted code.
- Or skip the manual steps and broadcast the same question to both: use the menu's "Broadcast to all" (or press
Ctrl-b B).
You can launch multiple cli-switch sessions concurrently. Each new session gets an auto-incremented name:
# Terminal 1 — gets session "ai-switch"
cli-switch claude gemini
# Terminal 2 — gets session "ai-switch-2" (auto-incremented)
cli-switch copilot aichat
# Terminal 3 — gets session "ai-switch-3"
cli-switch claudeManage them from any terminal:
# See all running sessions with status and age
cli-switch sessions
# ai-switch (attached, 12m — claude, gemini)
# ai-switch-2 (detached, 3m — copilot, aichat)
# ai-switch-3 (attached, 1m — claude)
# Total: 3 session(s)
# Stop a specific session
cli-switch stop ai-switch-2
# Stop all sessions at once
cli-switch stop --allYou can also force a specific session name with -s:
cli-switch claude gemini -s my-projectcli-switch looks for a .cli-switch.yaml file in the following locations (first match wins):
- Current working directory:
./.cli-switch.yamlor./.cli-switch.yml - Home directory:
~/.cli-switch.yamlor~/.cli-switch.yml
If no config file is found, built-in defaults are used. CLI flags always override config file values.
# cli-switch configuration
# Which AI CLI tools to launch (in order)
tools:
- claude
- gemini
- copilot
# Layout: horizontal, vertical, tiled, main-horizontal, main-vertical
layout: tiled
# tmux session name
session_name: ai-switch
# Keybindings (used with tmux prefix, default Ctrl-b)
keybindings:
capture: S
paste: P
broadcast: B
sync_toggle: YBuilt-in defaults < .cli-switch.yaml file < CLI flags.
For example, if your config file sets layout: vertical but you run cli-switch --layout tiled, the tiled layout is used.
| Key | Tool | Command | Install |
|---|---|---|---|
claude |
Anthropic Claude Code | claude |
https://docs.anthropic.com/en/docs/claude-code |
gemini |
Google Gemini CLI | gemini |
https://github.com/google-gemini/gemini-cli |
copilot |
GitHub Copilot CLI | copilot |
gh extension install github/gh-copilot |
aichat |
AIChat (multi-model) | aichat |
https://github.com/sigoden/aichat |
cli-switch auto-detects which tools are installed. Tools that are not found on PATH are skipped with a warning.
To add a new AI CLI tool, edit the TOOL_REGISTRY object in src/tools.js:
const TOOL_REGISTRY = {
// ... existing tools ...
mytool: {
name: 'MyTool',
command: 'mytool', // The command that launches the tool
description: 'My custom AI CLI tool',
color: '#FF6B6B', // Color used for pane styling (hex)
},
};The command value must be an executable on your PATH. After adding the entry, you can launch it with:
cli-switch mytool claudeOr add it to your .cli-switch.yaml:
tools:
- claude
- mytoolcli-switch is a thin orchestration layer built on top of tmux.
-
Session creation --
tmux new-sessioncreates a detached session, andsplit-windowadds a pane for each requested tool. The configured layout (select-layout) arranges them. If a session with the requested name already exists, the name is auto-incremented (e.g.,ai-switch-2) so multiple sessions can run concurrently without conflict. -
Tool launch -- Each pane receives a
send-keyscommand that starts the corresponding AI CLI (e.g.,claude,gemini). -
Shared buffer -- Capture (
capture-pane) writes pane output to~/.cli-switch/shared-buffer.txt. Paste reads that file back viaload-bufferandpaste-buffer. Every capture is also saved with a timestamp in~/.cli-switch/history/. -
Broadcast -- Iterates over all panes with
send-keysto deliver the same prompt to each tool. -
Keybindings -- Custom tmux key bindings are registered with
bind-keyat session startup. They invokerun-shellcommands that perform capture, paste, and broadcast operations. -
Status bar -- tmux
set-optionconfigures a styled status bar with a[MENU]button, session info, pane count, keybinding hints, aSYNC ONindicator, and a clock. -
Mouse -- tmux mouse mode is enabled so you can click panes, drag borders, scroll, and click the status bar to open the action menu. Dragging to select text copies it to the system clipboard via
pbcopy(macOS) and keeps the selection visible. -
Action menu --
display-menucreates a popup menu triggered by clicking the status bar or pressingCtrl-b Space. The menu provides all actions without needing to remember keybindings.
Contributions are welcome. To get started:
- Fork the repository and create a feature branch.
- Make your changes. Keep commits focused and well-described.
- Run the test suite:
npm test - Open a pull request with a clear description of what you changed and why.
Please follow the existing code style. The project uses ES modules ("type": "module" in package.json) and has no build step.
If you encounter a bug or have a feature request, open an issue on GitHub with:
- Your OS and tmux version (
tmux -V). - Your Node.js version (
node -v). - Steps to reproduce the problem.
MIT