How scottdsnr/tmux-workspace-manager works
tmux-workspace is a YAML-driven CLI and interactive manager for defining, validating, editing, and starting or stopping tmux workspaces. The main workflow selects a profile, resolves its workspace/window/pane configuration, creates tmux windows and panes with commands and inherited environment, then attaches; stopping signals panes, runs teardown commands, and kills the session. The README also documents settings, legacy migration, and self-update. Some implementation excerpts are partial, so uncertain internal wiring is omitted.
Main entry points: main.go Command router · workspace.go Workspace lifecycle · config.go Profile configuration · tui_app.go TUI controller
Components 18
CLI and TUI
- Command router
cmd/twm/main.go - Workspace dashboard
cmd/twm/tui_dashboard.go - TUI controller
cmd/twm/tui_app.go - Progress and confirmation
cmd/twm/tui_progress.go
Profiles and settings
- Profile wizard
cmd/twm/tui_wizard.go - Profile editing
cmd/twm/wizard.go - Profile configuration
cmd/twm/config.go - Settings form
cmd/twm/tui_settings.go - Settings management
cmd/twm/settings.go - Profile validation
cmd/twm/config.go
Session lifecycle
- Workspace lifecycle
cmd/twm/workspace.go - tmux command adapter
cmd/twm/tmux.go
Maintenance
- Legacy migration
cmd/twm/upgrade.go - Self updater
cmd/twm/update.go
Other components
- Terminal user
- tmux server
- External editor
- GitHub releases
Connections 26
- Terminal user → Command router: runs commands
- Command router → Workspace dashboard: opens dashboard
- Command router → Workspace lifecycle: starts or stops
- Command router → Profile wizard: creates profile
- Command router → Profile editing: edits or lists
- Command router → Profile validation: validates profile
- Command router → Settings form: opens settings
- Command router → Settings management: edits settings
- Command router → Legacy migration: runs migration
- Command router → Self updater: checks update
- Workspace dashboard → Profile editing: loads summaries
- Workspace dashboard → TUI controller: requests screens
- TUI controller → Profile wizard: hosts wizard
- TUI controller → Settings form: hosts form
- TUI controller → Progress and confirmation: shows operation progress
- Profile wizard → Profile configuration: saves profile
- Profile editing → Profile configuration: loads and saves
- Profile validation → Profile configuration: reads profile
- Settings form → Settings management: saves preferences
- Workspace lifecycle → Profile configuration: loads profile
- Workspace lifecycle → Settings management: reads preferences
- Workspace lifecycle → tmux command adapter: builds and tears down
- tmux command adapter → tmux server: creates panes and sessions
- Workspace lifecycle → External editor: opens raw profile
- Legacy migration → Profile configuration: merges profiles
- Self updater → GitHub releases: checks and downloads