A modern terminal workspace control plane over tmux.
agentmux is a keyboard-first TUI that wraps tmux — providing a session browser, pane preview, command palette, and workspace launcher all from one interface. It does not replace tmux. It makes tmux faster to navigate.
⣿ agentmux 3 sessions
╭──────────── Sessions ─────────────╮╭──────────── Preview ──────────────────────╮
│ ● main (3 win) 2h ││ main ~/code/agentmux │
│ api (1 win) 5h ││ │
│ deploy (2 win) 1d ││ $ go test ./... │
│ ││ ok agentmux/internal/config 0.01s │
│ ││ ok agentmux/internal/store 0.06s │
│ ││ ok agentmux/internal/adapters 0.00s │
│ ││ ok agentmux/internal/tui/views 0.00s │
╰───────────────────────────────────╯╰────────────────────────────────────────────╯
↑↓/jk nav │ enter attach │ n new │ x kill │ r rename │ / search │ ? help │ q quit
curl -fsSL https://amux.coder.company/install.sh | shThis auto-detects your OS/arch, downloads the latest release, and installs
agentmux + atmux to /usr/local/bin.
Install to a custom directory:
INSTALL_DIR=~/.local/bin curl -fsSL https://amux.coder.company/install.sh | shgit clone https://github.com/coder-company/agentmux
cd agentmux
make installmake build # produces ./agentmux binaryIf you prefer not to use the installer, add an alias:
# bash / zsh (~/.bashrc or ~/.zshrc)
alias atmux="agentmux"
# fish (~/.config/fish/config.fish)
alias atmux agentmux| Dependency | Version |
|---|---|
| Go | 1.21+ (only for building from source) |
| tmux | 3.0+ |
agentmux # full-screen interactive mode
atmux # same thing, shorter nameagentmux list # List all tmux sessions
agentmux new myproject # Create a detached session
agentmux new api --dir ~/code # Create with a working directory
agentmux attach myproject # Attach to a session (replaces process)
agentmux kill myproject # Kill a session
agentmux init # Generate default config file
agentmux --version # Print version
agentmux --help # Print helpAll CLI commands check for tmux before running and produce clear error messages with installation instructions if tmux is missing.
The TUI has four modes:
Two-panel layout:
- Left panel: Session list with name, window count, relative creation time, and attached indicator (
●) - Right panel: Live pane capture from the selected session (last 40 lines)
A header shows the app brand and total session count. A footer shows context-aware keybindings.
A centered overlay with fuzzy search over:
- Actions: new session, kill, rename, refresh, workspaces, help, quit
- Workspace launchers from your config
- Active sessions for quick attach
Fuzzy matching is character-order-aware (typing "ns" matches "New Session").
A centered overlay listing workspaces from your config. Press tab to drill
into workspace commands. Pressing enter creates a tmux session named
workspace-command (e.g., api-run) in the workspace root directory.
A categorized keybinding reference. Press ? or esc to dismiss.
| Key | Action |
|---|---|
↑ / k |
Move cursor up |
↓ / j |
Move cursor down |
gg |
Jump to top |
G |
Jump to bottom |
| Key | Action |
|---|---|
enter |
Attach to selected session |
n |
Create new session (auto-named) |
x |
Kill session (asks y/n) |
r |
Rename session inline |
R |
Refresh session list |
| Key | Action |
|---|---|
/ |
Open command palette |
p |
Open workspace launcher |
? |
Toggle help overlay |
esc |
Close any overlay |
q |
Quit |
Ctrl+C |
Quit |
| Key | Action |
|---|---|
↑/↓ |
Navigate results |
enter |
Execute action |
esc |
Close palette |
| Type | Fuzzy filter |
backspace |
Delete character |
| Key | Action |
|---|---|
↑/↓/j/k |
Navigate |
tab |
Toggle commands list |
enter |
Launch workspace/command |
esc |
Back to sessions |
Configuration lives at ~/.config/agentmux/config.toml.
Run agentmux init to generate a starter file with commented examples.
[[workspaces]]
name = "api"
root = "~/code/api"
[[workspaces.commands]]
name = "run"
cmd = "go run ./cmd/server"
[[workspaces.commands]]
name = "test"
cmd = "go test ./..."
[[workspaces]]
name = "frontend"
root = "~/code/web"
[[workspaces.commands]]
name = "dev"
cmd = "npm run dev"
[[workspaces.commands]]
name = "build"
cmd = "npm run build"
[[workspaces]]
name = "infra"
root = "~/code/infra"agentmux validates your config on load:
- Each workspace must have a non-empty
nameandroot - Workspace names must be unique
- Command names within a workspace must be unique
- Command
cmdfields must be non-empty ~and~/pathare expanded to your home directory
Invalid configs are silently skipped (the TUI still works, just without workspaces).
When launching from the workspace view:
- Selecting a workspace creates a session named after the workspace (e.g.,
api) - Drilling into commands and selecting one creates
workspace-command(e.g.,api-run)
cmd/agentmux/ CLI entrypoint (main.go)
internal/
app/ Application wiring, TUI lifecycle, exec attach
adapters/tmux/ tmux CLI wrapper, session parser, name validation
commands/ Cobra subcommands: list, new, attach, kill, init
config/ TOML loader, validation, InitDefault, expandHome
core/ Domain models: Session, Workspace, Command
store/ SQLite state: recent sessions, schema migrations
tui/ Bubble Tea app shell, main Update/View loop
components/ Header, footer, session list, preview pane
styles/ Lip Gloss color palette and style definitions
views/ Sessions view, command palette, launcher, help overlay
| Decision | Rationale |
|---|---|
\x1f as tmux format delimiter |
Pipes (|) appear in file paths; Unit Separator never does |
syscall.Exec for attach |
Clean process replacement — no orphan parent process |
SQLite via modernc.org/sqlite |
Pure Go, no CGO required, works everywhere |
| Schema versioning in store | Forward-compatible migrations without breaking existing DBs |
| Corrupt DB auto-recovery | Renamed to .corrupt.<timestamp> and recreated fresh |
| Session name validation | Rejects ., :, leading -, empty, >128 chars — tmux reserved characters |
| File | Purpose |
|---|---|
~/.config/agentmux/config.toml |
Workspace definitions |
~/.local/share/agentmux/state.db |
SQLite: recent sessions, schema version |
The SQLite database is optional — agentmux works fine without it (store errors are non-fatal).
make check # gofmt + go vet + go test -race + go build
make test # go test -race ./...
make build # build binary with version from git
make smoke # build + run CLI smoke test against tmux
make clean # remove binary
make install # install to PREFIX/bin (default: /usr/local)
make uninstall # remove from PREFIX/bin| Package | Tests |
|---|---|
adapters/tmux |
Parser: normal, empty, malformed, spaces, unicode, pipes, zero windows, long names. Validation: 10 cases |
config |
Load, missing file, expand home (bare + path), validation: missing name/root, duplicates, empty cmd, InitDefault |
store |
Round-trip, corrupt recovery, ping, schema version, idempotent migration |
tui/components |
Session list navigation, empty list safety, cursor clamping, relativeTime |
tui/views |
Fuzzy matching (14 cases), palette query/filter, navigation, type/backspace |
All tests are deterministic and do not require tmux.
GitHub Actions runs on push/PR to main:
gofmtcheckgo vetgo test -racego build- CLI smoke test
agentmux: tmux is not installed or not in PATH
Install tmux:
macOS: brew install tmux
Debian: sudo apt install tmux
Arch: sudo pacman -S tmux
If your config has a syntax error, agentmux logs it and runs without workspaces.
Fix the TOML syntax and restart. Validation errors name the specific workspace
and field (e.g., workspace "api": missing root directory).
If the SQLite database is corrupted, agentmux automatically:
- Renames the corrupt file to
state.db.corrupt.<timestamp> - Creates a fresh database
- Prints a message to stderr
No data loss of tmux sessions — only the "recently used" ordering is reset.
If the terminal is narrower than ~50 columns or shorter than ~8 rows, agentmux shows a "Terminal too small" message instead of crashing. Resize to continue.
agentmux rejects session names containing . or : (tmux uses these as separators)
and names starting with - (tmux flag ambiguity). Spaces, unicode, hyphens, and
underscores are all allowed.
Releases use GoReleaser:
git tag v0.2.0
git push --tags
goreleaser releaseProduces binaries for linux/darwin on amd64/arm64 with checksums.
MIT — see LICENSE.