Dev Tools
Immich Photo Manager AI-powered photo management for Immich
DevHunt

crex(cmux-resurrect)

Save, restore, and template your terminal workspaces — for cmux and Ghostty.

Ghostty cmux macOS MIT License Open Source v1.13.0

The Problem

You spent an hour setting up the perfect terminal layout — tabs, panes, directories, running processes. Then your Mac reboots. Gone. Neither cmux nor Ghostty can bring back what they never saved.

The Solution

crex save. crex restore. That's it. Two commands, entire workspace back. 16 templates, Markdown Blueprints, auto-save daemon. Stop rebuilding.

crex save my-day — snapshot and restore your terminal layout

Install with Homebrew (recommended)

brew install drolosoft/tap/crex

That's it — both crex and cmux-resurrect are ready to use. No Go toolchain required.

Alternative: install with Go (requires toolchain)
go install github.com/drolosoft/cmux-resurrect/cmd/crex@latest

First time? Run crex setup

crex setup # interactive guided configuration crex setup --defaults # accept all defaults (CI/scripting)

Try it

crex save my-day # snapshot your current layout crex save my-day -d "Friday deep work" # with a description crex restore my-day # bring it all back crex tui # interactive shell
crex setup wizard, save, and list — getting started in seconds
crex interactive shell — help, list, restore, templates, browse mode

Run crex tui — or just crex when config exists — to drop into the interactive shell. A crex❯ prompt gives you full access to all commands without leaving your terminal.

3-Level Tab Completion

Press Tab to discover commands with icons and descriptions. Navigate with Tab/Shift-Tab/Arrows, go back with Escape. Works at all 3 levels: commands → subcommands → arguments. Layout names, templates, and Blueprint entries auto-complete.

crex❯ [Tab] see all available commands crex❯ bp [Tab] explore bp subcommands crex❯ restore [Tab] auto-complete layout names crex❯ use [Tab] list all 16 templates crex❯ settings banner set configure banner style

Details that matter

Listings show numbered items — use the number in any follow-up command. Arrow keys browse listings inline. The shell adapts to your terminal's dark or light theme automatically.

  • Phoenix farewell messages on exit
  • Confirmation dialogs for destructive operations
  • Smart prompt retention: errors keep your command so you can fix args without retyping
  • settings group to configure banner, restore-mode, and preferences from the shell

Full Layout Capture

Tabs, panes, CWDs, pinned state, and active tab — all captured to a single TOML file.

crex save my-day -d "Friday deep work"

Two-Level Restore Picker

Browse layouts with arrows, drill into the exact workspace with →/Tab. Jump directly to any item with digit keys 1-9. Restore a single workspace without touching the rest.

crex restore

Smart Sync Restore

Restore detects your current tab state and only asks when it matters. From a fresh terminal, it restores with zero prompts. With matching tabs, it offers to keep them or recreate from the layout. No unnecessary questions.

crex restore my-day

Blueprint Management

Your ideal terminal setup, declared in Obsidian-compatible Markdown.

crex bp add webapp ~/projects/webapp --template dev

Template Gallery

16 built-in templates — from simple splits to full IDE setups. Preview and customize.

crex template use claude ~/projects/my-app

Watch Daemon

Background auto-save with content-hash deduplication. Zero maintenance.

crex watch --daemon

3-Level Tab Completion

Press Tab in the interactive shell to discover commands, subcommands, and arguments. Icons and descriptions on every option. Completions cached with 2s TTL.

crex❯ bp [Tab] → add · list · remove · show

Shell Completion

Dynamic tab completion for your shell (bash, zsh, fish). Zero-config with Homebrew.

crex restore <TAB> → my-day production autosave

Dry-Run Preview

Inspect every command before it runs — cmux CLI or Ghostty AppleScript.

crex restore my-day --dry-run

Setup Wizard

Guided configuration. Detects your backend, creates config, and gets you started in seconds.

crex setup

Adaptive Theme

Auto-detects dark or light background. Three banner styles: flame, classic, plain.

CREX_BANNER=flame crex

Layout Descriptions

Annotate each layout — useful context for teams sharing sessions.

crex save api -d "backend API — reads postgres"

Browser Panes

Save and restore browser panes with their URLs. On cmux, they're created as native browser panels; on Ghostty, the URL opens in the system browser.

crex show my-day → 🌐 https://localhost:3000

Foreground Command Detection

Auto-detects the foreground process in each pane — npm run dev, nvim, htop, make watch, and more. Commands are saved and restored without manual configuration. They don't pollute your shell history.

crex save my-day → npm run dev · nvim · 🌐 localhost:3000

AI Session Auto-Detection

Detects Claude Code, OpenCode, and Codex sessions automatically. Each session resumes exactly where you left off, with the correct session ID. CWD-matched sessions get priority over fallbacks.

crex save → claude --resume 90d6d97b...

Why crex?

tmux-resurrect proved that session persistence is essential. Every multiplexer eventually gets one — crex is that tool for cmux and Ghostty.

tmux-resurrect crex
Saves/restores tmux sessions Saves/restores cmux & Ghostty sessions
tmux only cmux + Ghostty — auto-detected, zero config
CLI commands only Interactive shell with Tab Completion — crex❯ REPL
Plugin configuration Blueprint — Markdown files, Obsidian-compatible
Manual pane recreation 16 built-in templates — layouts + workflows + custom Blueprints
Terminal panes only Browser panes — save and restore URLs
No process detection Foreground detection — npm, nvim, htop, make...
No AI support AI session resume — Claude, OpenCode, Codex
N/A ASCII diagram previews in terminal
Manual setup crex template use <name> — instant workspace
Destructive restore Smart sync — keeps matching tabs, creates missing ones
Manual saves Watch daemon — deduped, zero-maintenance
Edit config files crex template customize — fork any template
Edit config files CLI — add, remove, toggle from terminal

Supported Backends

crex auto-detects your terminal — no flags, no configuration.

cmux

cmux.dev

Full support since v1.0

Save, restore, templates, Blueprint, watch, dry-run

Ghostty

NEW ghostty.org

Full support since v1.3

Save, restore, templates, Blueprint, watch, dry-run

crex auto-detects your terminal — no flags needed. The same commands work in cmux or Ghostty.

16 Ready-to-Use Workspace Templates

From simple two-pane splits to full IDE layouts. Browse, preview, and create workspaces in seconds. Inspired by shadcn: copy it, it's yours.

crex template list — 16 templates grouped by Layouts and Workflows

Pure pane geometry — no commands, language-agnostic

expand all · collapse all
cols 2 Side-by-side columns
┌──────────┬───────────────────────┐
│          │                       │
│  main *  │  shell                │
│          │                       │
└──────────┴───────────────────────┘
main → right
rows 2 Stacked rows
┌──────────────────────────────────┐
│  main *                          │
├──────────────────────────────────┤
│  shell                           │
└──────────────────────────────────┘
main → down
sidebar 2 Main area with sidebar
┌──────┬───────────────────────────┐
│      │                           │
│ side │  main *                    │
│      │                           │
└──────┴───────────────────────────┘
main → right
shelf 3 Big top, two bottom
┌──────────────────────────────────┐
│  main *                          │
│                                  │
├────────────────┬─────────────────┤
│  shell         │  shell          │
└────────────────┴─────────────────┘
main → down → right
aside 3 Big left, two stacked right
┌──────────┬───────────────────────┐
│          │  shell                │
│  main *  │                       │
│          ├───────────────────────┤
│          │  shell                │
└──────────┴───────────────────────┘
main → right → down
triple 3 Three columns
┌──────────┬──────────┬──────────┐
│          │          │          │
│  main *  │  shell   │  shell   │
│          │          │          │
└──────────┴──────────┴──────────┘
main → right → right
quad 4 2x2 grid
┌────────────────┬─────────────────┐
│  main *        │  shell          │
├────────────────┼─────────────────┤
│  shell         │  shell          │
└────────────────┴─────────────────┘
main → right → down → down
dashboard 4 Big top, three bottom
┌──────────────────────────────────┐
│  main *                          │
│                                  │
├──────────┬──────────┬──────────┤
│  shell   │  shell   │  shell   │
└──────────┴──────────┴──────────┘
main → down → right → right
ide 4 Full IDE layout
┌────────┬─────────────────────────┐
│        │  shell *                │
│  main  │                         │
│        ├────────────┬────────────┤
│        │  shell     │  shell     │
└────────┴────────────┴────────────┘
main → right → down → right
crex template show dashboard — ASCII diagram preview of a 4-pane layout

Opinionated tool combos for common terminal activities

expand all · collapse all
🤖 claude 3 AI pair-programming with Claude Code
┌──────────┬───────────────────────┐
│          │  claude *             │
│  lazygit │                       │
│          ├───────────────────────┤
│          │  shell                │
└──────────┴───────────────────────┘
main → right → down · ai, git, development
💻 code 3 General-purpose coding workspace
┌──────────┬───────────────────────┐
│          │  lazygit              │
│  main *  │                       │
│          ├───────────────────────┤
│          │  watch -n 5 'ls...'   │
└──────────┴───────────────────────┘
main → right → down · git, development
🔭 explore 2 Navigate and understand a codebase
┌──────────┬───────────────────────┐
│          │                       │
│  main *  │  git log --oneline... │
│          │                       │
└──────────┴───────────────────────┘
main → right · git, discovery
📊 system 2 Monitor system health and resources
┌──────────┬───────────────────────┐
│          │                       │
│  htop    │  df -h                │
│          │                       │
└──────────┴───────────────────────┘
main → right · monitoring, sysadmin
📜 logs 3 Tail multiple log streams side-by-side
┌──────────┬──────────┬──────────┐
│          │          │          │
│  syslog* │  dmesg   │  shell   │
│          │          │          │
└──────────┴──────────┴──────────┘
main → right → right · monitoring, debugging
🌐 network 2 Debug connectivity and API endpoints
┌──────────┬───────────────────────┐
│          │                       │
│  main *  │  curl -s ifconfig.me  │
│          │                       │
└──────────┴───────────────────────┘
main → right · networking, debugging
📟 single 1 Minimal single-pane terminal
┌──────────────────────────────────┐
│                                  │
│  main *                          │
│                                  │
└──────────────────────────────────┘
main · basic
crex template show code — workflow template with lazygit and watch commands
# Browse the gallery crex template list # Preview with ASCII diagram crex template show claude # Create workspace instantly crex template use claude ~/projects/my-app # Fork and customize crex template customize claude

Blueprints

Blueprints are Markdown documents with two sections — Projects and Templates. Compatible with Obsidian and any Markdown editor. Checkboxes control which entries get created. Templates define reusable pane layouts.

📄 workspaces.md
## Projects **Icon | Name | Template | Pin | Path** - [x] | 🚀 | Homepage | fullstack | yes | ~/projects/webapp | - [x] | ⚙ | API Server | dev | yes | ~/projects/api | - [ ] | 📓 | notes | single | no | ~/documents/notes | ## Templates ### fullstack - [x] main terminal: `npm run dev` (focused) - [x] split right browser: `http://localhost:3000` - [x] split down: `nvim CLAUDE.md` ### dev - [x] main terminal (focused) - [x] split right: `npm run dev` - [x] split right: `lazygit`
crex import-from-md # create tabs/workspaces from Blueprint crex export-to-md # capture live state to Blueprint
crex import-from-md success — 9 workspaces created from a Blueprint

Commands

Command Alias Description
crex tuicrexLaunch interactive shell (also: just type crex)
crex setupGuided first-run configuration wizard
crex save [name]Capture current layout to TOML
crex restore [name]Recreate tabs, pane arrangements, and commands
crex listlsList saved layouts with tab/workspace count
crex show <name>Display layout details (--raw for TOML)
crex edit <name>Open layout in $EDITOR
crex delete <name>rmDelete a saved layout
crex import-from-mdCreate entries from a Blueprint Markdown file
crex export-to-mdExport live terminal state to Blueprint Markdown
crex watchAuto-save daemon with start/stop/status management
crex blueprint addbp addAdd entry to Blueprint
crex blueprint removebp rmRemove entry from Blueprint
crex blueprint listbp lsList Blueprint entries
crex blueprint togglebp toggleEnable/disable a Blueprint entry
crex template listtpl lsList available templates
crex template show <name>tpl showPreview a template with ASCII diagram
crex template use <name> [path]tpl useCreate tab/workspace from a template
crex template customize <name>tpl editFork a template for customization
crex completion [bash|zsh|fish]Generate completion script for your shell
crex settings restore-mode set <mode>Set restore mode: ask, replace, or add
crex settings restore-mode getShow the current restore mode
crex settings restore-mode listList all available restore modes
crex versionPrint version, commit, build date

Configuration

Everything is zero-config by default — banner style auto-detects, colors adapt, terminal background is sniffed via OSC 11. Tune it anyway:

# ~/.config/crex/config.toml banner_style = "flame" # or "classic" or "plain" restore_mode = "ask" # or "replace" (overwrite) or "add" (append)

Two environment variables override detection when you need determinism (tmux passthrough, CI, screenshots):

CREX_THEME=light|dark # override terminal background detection CREX_BANNER=flame|classic|plain # override banner rendering mode

Tab Completion in Action

Completions are installed automatically with Homebrew. Layout names come from your actual saved sessions — not a static list.

crex res<TAB> → restore crex restore <TAB> → my-day production autosave crex save --<TAB> → --force --quiet --verbose
crex template use — shell completion dropdown with all 16 templates

Documentation

Deep dives, authoring guides, and the full command reference.

Platform Compatibility

crex runs wherever cmux or Ghostty runs. Auto-detects your terminal — no flags, no configuration, no compatibility surprises.

Platform Architecture Status
macOS (Apple Silicon)M1, M2, M3, M4✅ Tested
macOS (Intel)x86_64✅ Tested
Linuxx86_64 / ARM64⚪ Compiles only (no backend yet)

Built With

crex is a single Go binary with no runtime dependencies.

  • Go 1.26 — Fast compilation, single binary output
  • Cobra — CLI framework for commands and flags
  • go-toml/v2 — Configuration file parsing
  • Lipgloss — Styled CLI output with colors
  • Bubble Tea + Huh — Interactive shell, TUI components, browse mode
  • 387 tests — Comprehensive test suite with unit, wiring, and E2E coverage
Gimme a coffee 😋
Buy Me A Coffee

I build tools I wish existed, then give them away.
If one of them saved you time, a coffee keeps the next one coming.

Buy Me A Coffee QR

Ready to save your workspaces?

crex is free, open source, and ready to use.

42 Or gimme a star 🤗