Skip to content

drolosoft/cmux-resurrect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

176 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

crex logo

crex (cmux-resurrect)

CI Go Report Card Go Reference codecov License: MIT Homebrew GitHub Release cmux

Save, restore, and template your terminal workspaces β€” for cmux and Ghostty.

Inspired by tmux-resurrect, crex was born to do for cmux what tmux-resurrect does for tmux β€” and then went further. With an interactive shell, a template gallery, Blueprints, and a watch daemon, crex saves your entire layout and brings it back: all your tabs, pane arrangements, working directories, pinned state, and startup commands. Named after the corncrake (Crex crex), a bird that returns to the same ground year after year β€” your terminal's own phoenix.

crex demo


πŸš€ Quick Start

Install with Homebrew (recommended)

brew install drolosoft/tap/crex            # preferred
brew install drolosoft/tap/cmux-resurrect  # legacy alias β€” same formula

Both crex and cmux-resurrect commands are ready to use (cmux-resurrect is the legacy name), with shell completions installed automatically. No Go toolchain required. macOS only (both cmux and Ghostty's AppleScript API are macOS-native).

Install with go install

go install github.com/drolosoft/cmux-resurrect/cmd/crex@latest

For building from source, see docs/building.md.

Enable Shell Completion

Homebrew users get completions automatically. For manual installs, add one line to your shell config:

eval "$(crex completion zsh)"    # zsh β€” add to ~/.zshrc
eval "$(crex completion bash)"   # bash β€” add to ~/.bashrc
crex completion fish | source    # fish β€” run once

Now crex <TAB> shows all commands, crex restore <TAB> completes your saved layout names, and flags like --mode complete their values. See docs/shell-completion.md for the full guide.

Try it

crex setup                                # guided first-run configuration
crex save my-day                          # snapshot your current layout
crex save my-day -d "Friday deep work"    # with a description
crex tui                                  # interactive shell

crex quick start


πŸ’Ύ Save & Restore

crex save my-day                          # snapshot your layout
crex save my-day -d "Friday deep work"    # add a description (preserved across re-saves)
crex restore my-day                       # bring it all back

Every tab, pane arrangement, CWD, pinned state, and startup command β€” captured and restored. Layouts are saved to ~/.config/crex/layouts/.

crex save my-day

πŸ§™ Setup Wizard

First time? crex setup walks you through everything:

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

The wizard auto-detects your terminal backend (cmux or Ghostty), creates a default config.toml if missing, and sets up the layouts directory. One command and you're ready to go.

πŸ–₯️ Interactive Shell

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.

crex❯ ls                     list saved layouts
crex❯ restore 2              restore by number
crex❯ now                    show live terminal state
crex❯ templates              browse the gallery
crex❯ use claude             create workspace from template
crex❯ bp list                list Blueprint entries
crex❯ help                   show all commands

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.

crex interactive shell

πŸ“₯ Blueprints

Define your terminal layout in Obsidian-compatible Markdown. Import creates only what's missing β€” it's idempotent.

## Projects
**Icon | Name | Template | Pin | Path**

- [x] | 🌐 | webapp    | dev     | yes | ~/projects/webapp
- [x] | βš™οΈ | api       | dev     | yes | ~/projects/api-server
- [x] | πŸ§ͺ | tests     | go      | yes | ~/projects/testing

## Templates

### 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 in action

For the full Blueprint format and CLI management (bp add, bp list, bp toggle), see docs/blueprint.md.

πŸ“¦ Template Gallery

crex ships with 16 ready-to-use templates for common developer workflows.

Layout Templates Workflow Templates
β–₯ cols β€” side-by-side πŸ€– claude β€” Claude Code pair-programming
β–€ rows β€” stacked πŸ’» code β€” general coding
β—§ sidebar β€” main + side πŸ”­ explore β€” navigate codebase
⊀ shelf β€” big top, 2 bottom πŸ“Š system β€” monitor health
⊒ aside β€” big left, 2 right πŸ“œ logs β€” tail streams
β…’ triple β€” three columns 🌐 network β€” debug connectivity
⊠ quad β€” 2Γ—2 grid πŸ“Ÿ single β€” minimal terminal
β—± dashboard β€” top + 3 bottom
⧉ ide β€” full IDE layout
crex template list                    # browse all templates
crex template show claude             # preview with ASCII diagram
crex template claude ~/project        # create workspace instantly (shortcut)
crex template customize claude        # fork to your Blueprint

crex template list showing 16 templates grouped by Layouts and Workflows

Templates are starting points. Run crex template customize <name> to fork any template and make it yours.

See docs/templates.md for the full gallery with diagrams.

Supported Backends

Backend Status Platform Tested versions Detection
cmux Full support (original backend) macOS 0.62.1, 0.63.2 Auto-detected via CMUX_SOCKET_PATH
Ghostty Full support (AppleScript API) macOS 1.3 Auto-detected when Ghostty is running

macOS only. Both backends rely on macOS-native APIs (cmux is a macOS terminal multiplexer; the Ghostty backend uses AppleScript). Linux support will follow once Ghostty ships a cross-platform scripting API (ghostty-org/ghostty#2353).

crex auto-detects your terminal backend β€” no flags needed. Just run your commands and crex figures out the rest:

crex save my-day        # works in cmux or Ghostty
crex restore my-day     # recreates layout in whichever backend you're in
crex template use dev   # same templates, any backend

All features β€” save, restore, import, export, templates, Blueprints β€” work identically across backends. The template gallery is 100% backend-agnostic.

Adaptive Themes β€” crex auto-detects your terminal's dark/light background and adjusts banner colors. Three styles available: flame (gradient, default), classic (solid green), plain (gray). Set banner_style in config.toml or use CREX_BANNER; override detection with CREX_THEME=dark|light. See Configuration.


✨ Why crex?

tmux-resurrect proved that session persistence is essential for any serious terminal multiplexer workflow. Every multiplexer eventually gets one β€” crex started as that tool for cmux, and now brings the same power to Ghostty.

tmux-resurrect crex
πŸ–₯️ CLI commands only Interactive shell β€” crex❯ REPL with browse mode, number refs, history
πŸ“ Plugin configuration Blueprints β€” Markdown files, Obsidian-compatible
🧩 Manual pane recreation 16 built-in templates + custom Blueprints
πŸ“₯ One-way restore Bidirectional β€” import from and export to Markdown
πŸ‘οΈ Execute immediately Dry-run mode β€” preview every command first
⏱️ Manual saves Watch daemon β€” background auto-save, deduped, shell hooks, zero-maintenance
πŸ“‹ Edit config files CLI blueprint management β€” add, remove, toggle from terminal
πŸ”€ Basic tab completion Dynamic completions β€” layout names, blueprint names, flag values (bash/zsh/fish)

πŸ“š Documentation

Doc Description
Commands Full command reference, flags, and recipes
Blueprints Blueprint format, templates, CLI management
Workflows Save/Restore vs Import, dry-run, side-by-side comparison
Configuration config.toml reference and defaults
Auto-Save & Daemon launchd, daemon mode, shell hooks
Template Gallery Built-in templates, ASCII previews, customization
Template Authoring Create and contribute custom templates
Shell Completion Setup, troubleshooting, what gets completed
Building from Source Makefile targets, cross-compilation, platform support
Architecture Internal design for contributors

🌟 Contributing

Contributions are welcome β€” bug fixes, new templates, feature ideas. Open an issue or submit a PR.

If crex saves your sessions, consider giving it a ⭐ on GitHub β€” it helps others discover the project.


β˜• Support

If crex saved you time or made your workflow easier, consider buying me a coffee β€” it keeps the next one coming!

Buy Me A Coffee


πŸ“œ License

MIT License β€” free to use, modify, and distribute.

Born from a real need: a crashed cmux session took an hour of carefully arranged workspaces with it. crex now protects your workspaces across both cmux and Ghostty β€” so that never happens again.

Forged by Drolosoft Β· Tools we wish existed

About

πŸ”„βœ¨πŸ–₯️ Session persistence for cmux β€” save, restore, and manage your terminal workspaces. Never lose your layout again.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors