Skip to content

Latest commit

Β 

History

History
106 lines (80 loc) Β· 3.93 KB

File metadata and controls

106 lines (80 loc) Β· 3.93 KB

themux

A native Linux terminal multiplexer for AI coding agents β€” port of cmux functionality to Linux.

Status: Pre-alpha development

What is themux?

themux combines a GPU-accelerated terminal emulator (Ghostty), in-app browser (WebKitGTK), vertical workspace tabs, split panes, notification system, and extensive scripting API into one native Linux application built with Rust and GTK4.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              GTK4 UI Layer                   β”‚
β”‚  Sidebar β”‚ Split Panes β”‚ Tab Bar β”‚ Browser   β”‚
β”‚  Ghostty GTK Terminal Widget (GPU-accelerated)β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚           Rust Application Core              β”‚
β”‚  Workspace Manager β”‚ Socket Server β”‚ Config   β”‚
β”‚  Session Persist   β”‚ Notifications  β”‚ Agents  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚           IPC / Protocols                    β”‚
β”‚  Unix Socket (JSON-RPC V2) β€” cmux-compatible β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚       Cross-Platform Components              β”‚
β”‚  cmuxd-remote (Go) β”‚ CLI (Rust) β”‚ Tests (Python)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

themux/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ themux-core/       # Business logic: workspace model, config, session, layout
β”‚   β”œβ”€β”€ themux-socket/     # Unix socket server, V2 JSON-RPC protocol, event bus
β”‚   β”œβ”€β”€ themux-cli/        # CLI binary (workspace, surface, browser, vm, ssh, tmux compat)
β”‚   β”œβ”€β”€ themux-agent/      # Agent hooks: Claude Code, Codex, OpenCode, Hermes
β”‚   β”œβ”€β”€ themux-notify/     # OSC detection, desktop notification bridge
β”‚   └── themux-app/        # GTK4 application binary
β”œβ”€β”€ ui/                    # GTK4 UI definitions, CSS, layouts
β”œβ”€β”€ ghostty/               # Ghostty terminal engine (git submodule)
β”œβ”€β”€ daemon/                # cmuxd-remote Go daemon (cross-platform)
β”œβ”€β”€ data/                  # Default config, JSON schemas
β”œβ”€β”€ tests/                 # Python integration tests (protocol-compatible)
β”œβ”€β”€ scripts/               # Build, setup, test scripts
└── docs/                  # Architecture, protocol docs, contributing

Quick Start

Prerequisites

  • Rust 1.85+
  • GTK4 development libraries
  • WebKitGTK 6.0 development libraries
  • Zig 0.14+ (for Ghostty build)
  • Go 1.22+ (for cmuxd-remote)
  • Python 3.10+ (for tests)

Build

# Install dependencies (Fedora)
sudo dnf install gtk4-devel webkit2gtk4.1-devel libadwaita-devel \
                 zig go python3-devel

# Clone with submodules
git clone --recurse-submodules https://github.com/themux-app/themux.git
cd themux

# Setup (builds Ghostty, cmuxd-remote)
./scripts/setup.sh

# Build everything
make build

# Or: build just the CLI
cargo build --release -p themux-cli

# Or: build the GTK app
make build-app

Run

# Launch the GUI
./scripts/run.sh

# Or: use the CLI directly
./target/release/themux new-workspace --cwd ~/projects/my-app
./target/release/themux list-workspaces
./target/release/themux send --workspace 1 "echo hello"

Compatibility

themux targets protocol compatibility with cmux's V2 JSON-RPC socket API. The Python test suite from cmux's tests_v2/ runs against themux to verify compatibility.

License

GPL-3.0-or-later. See LICENSE.

Commercial licenses available for organizations that cannot comply with GPL.