Managed worktree lifecycle
Create, open, close, remove, and merge worktrees through one dashboard or the CLI while keeping branch metadata and runtime state in sync.
webmux is a Bun-powered dashboard and CLI for managing parallel AI coding worktrees. It owns the worktree lifecycle, tmux layout, runtime env materialization, service health checks, and linked PR or issue context.
Create, open, close, remove, and merge worktrees through one dashboard or the CLI while keeping branch metadata and runtime state in sync.
Each worktree can launch an agent pane plus shell or command panes so the browser mirrors the tmux layout you actually use for development.
GitHub PR state, CI checks, and review comments are surfaced alongside each worktree instead of living in a separate tab.
webmux allocates ports per worktree, polls configured services, and can expose direct service URLs through urlTemplate.
Profiles can run directly on the host or inside managed Docker containers with mounts, env passthrough, and per-profile prompts.
Linear issues and linked repos can be attached to worktrees so branch context, PRs, and external repo status stay visible together.
webmux init expects a git repository and checks the local toolchain before it writes configuration. The dashboard itself is started with webmux serve.
CLI runtime, package manager, and backend runtime.
webmux init enforces Bun >= 1.3.5.
Worktree creation, branch management, and repository root discovery.
Session and pane orchestration behind the dashboard and CLI open/add flows.
Helper runtime used by the event bridge for managed agent hooks.
Optional, but enables GitHub PR, CI, and review-comment context in the UI.
If installed, webmux init also checks gh auth status.
Optional, but required for docker runtime profiles and sandbox mounts.
This is the shortest path from a fresh machine to a working browser dashboard on http://localhost:5111.
webmux runs on Bun and launches your dashboard locally.
Installs the webmux binary into your global Bun bin directory.
Create a project config in the repository you want to manage.
Checks dependencies, verifies Bun, optionally checks gh auth status, then creates or adapts .webmux.yaml at the git root.
Launch the local app and open the UI in your browser.
Starts the dashboard on http://localhost:5111 unless you override the port with --port or PORT.
Use the dashboard to spin up an agent, terminal panes, and ports.
Each managed worktree gets metadata, runtime env materialization, and a tmux layout based on the selected profile.
The root command surface includes dashboard serving, setup, service management, shell completion, and lifecycle-aware worktree subcommands.
Start the dashboard server for the current project.
Interactive project setup for .webmux.yaml.
Manage webmux as a user-level service on Linux or macOS.
Upgrade the globally installed CLI with Bun.
Emit shell completion setup for bash or zsh.
Create a managed worktree through the same lifecycle the dashboard uses.
List managed worktrees, open or closed state, and saved profile / agent metadata.
Open an existing worktree session and rebuild its tmux layout.
Close the tmux session for a worktree without deleting the worktree directory.
Delete a managed worktree and run preRemove if configured.
Merge the worktree branch into workspace.mainBranch and remove the worktree.
.webmux.yaml is loaded from the git root and normalized into the final project config shape. The example below includes services, profiles, docker mounts, startup envs, integrations, lifecycle hooks, and auto naming.
These tables reflect the current config parser and defaults in the codebase rather than a hand-maintained marketing summary.
Top-level project identity and default workspace behavior. These values are loaded from the git root containing .webmux.yaml.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | no | Webmux | Project name shown in the sidebar and browser title. |
| workspace.mainBranch | string | no | main | Base branch used for merge targets and new worktrees. |
| workspace.worktreeRoot | string | no | ../worktrees | Relative or absolute directory where managed worktrees are created. |
| workspace.defaultAgent | claude | codex | no | claude | Default agent kind used when a worktree does not specify one explicitly. |
Service definitions drive port allocation, health checks, and optional direct links in the UI.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| services[].name | string | yes | - | Display name shown in the dashboard. |
| services[].portEnv | string | yes | - | Runtime env key where the allocated port is injected. |
| services[].portStart | number | no | - | Base port for auto-allocation across worktrees. |
| services[].portStep | number | no | 1 | Increment between worktree slots when ports are auto-allocated. |
| services[].urlTemplate | string | no | - | Expanded with runtime env values to generate a clickable service URL. |
Profiles describe how a worktree runs: runtime, env passthrough, pane layout, prompts, and optional docker settings.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| profiles.<name>.runtime | host | docker | yes | - | Execution runtime for the profile. |
| profiles.<name>.envPassthrough | string[] | no | [] | Host env vars forwarded into the agent or container runtime. |
| profiles.<name>.systemPrompt | string | no | - | Prompt template applied to the agent for that profile. |
| profiles.<name>.yolo | boolean | no | - | Enables permissive execution flags for compatible agent CLIs. |
| profiles.<name>.image | string | conditional | - | Docker image name. Required when runtime is docker. |
| profiles.<name>.mounts[] | MountSpec[] | no | - | Host/container mounts for docker profiles. |
| profiles.<name>.panes[] | PaneTemplate[] | yes | - | Ordered tmux pane layout for the worktree session. |
Pane entries control what opens in tmux, while mount specs shape docker filesystem access.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| panes[].id | string | no | pane-N | Stable pane identifier used by the session layout. |
| panes[].kind | agent | shell | command | yes | - | Pane behavior. command requires a startup command string. |
| panes[].split | right | bottom | no | - | Split direction relative to the previously created pane. |
| panes[].sizePct | number | no | - | Optional pane size percentage for the split. |
| panes[].focus | boolean | no | - | Marks the pane that should receive initial focus. |
| panes[].command | string | conditional | - | Startup command for command panes. |
| panes[].cwd | repo | worktree | no | - | Whether the pane starts in the repository root or the worktree root. |
| mounts[].hostPath | string | yes | - | Host path to mount into docker. |
| mounts[].guestPath | string | no | - | Container mount path. When omitted, the host path is reused. |
| mounts[].writable | boolean | no | false | When true, the mount is read-write instead of read-only. |
These sections enrich the runtime environment and hook webmux into related tools and repositories.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| startupEnvs.<KEY> | string | boolean | no | {} | Additional env vars materialized into the managed worktree runtime. |
| integrations.github.linkedRepos[].repo | string | yes | - | GitHub repo slug used for linked PR and CI context. |
| integrations.github.linkedRepos[].alias | string | no | - | Short label shown in the UI. Defaults to the repo basename. |
| integrations.github.linkedRepos[].dir | string | no | - | Optional repo path used for editor or deep-link integrations. |
| integrations.linear.enabled | boolean | no | true | Turns Linear issue fetching on or off globally. |
Automation sections that run scripts or generate branch names for new worktrees.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| lifecycleHooks.postCreate | string | no | - | Shell command run after a managed worktree is created but before panes start. |
| lifecycleHooks.preRemove | string | no | - | Shell command run before a managed worktree is removed. |
| auto_name.provider | claude | codex | yes | - | CLI backend used for branch-name generation. |
| auto_name.model | string | no | - | Optional model name passed through to the selected CLI. |
| auto_name.system_prompt | string | no | - | Overrides the built-in branch naming prompt. |
The details below are the implementation-level behaviors that matter when you automate webmux, write lifecycle hooks, or rely on generated branch names and port allocation.
webmux writes runtime env files for managed worktrees and injects these variables into panes and lifecycle hooks.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| WEBMUX_WORKTREE_ID | string | set by webmux | - | Stable worktree identifier used by the control plane and runtime metadata. |
| WEBMUX_BRANCH | string | set by webmux | - | Resolved branch or worktree name for the managed worktree. |
| WEBMUX_PROFILE | string | set by webmux | - | Selected profile name for that worktree. |
| WEBMUX_AGENT | string | set by webmux | - | Resolved agent kind, such as claude or codex. |
| WEBMUX_RUNTIME | string | set by webmux | - | Resolved runtime kind, such as host or docker. |
| WEBMUX_WORKTREE_PATH | string | set by webmux | - | Absolute filesystem path to the managed worktree. |
| WEBMUX_CONTROL_URL | string | managed panes | - | Internal control endpoint used by the agent runtime event bridge. |
| WEBMUX_CONTROL_TOKEN | string | managed panes | - | Bearer token for authenticated control-plane event posts. |
The browser dashboard keeps the common worktree actions on a small, memorable set of keyboard shortcuts.