Skip to content

Latest commit

 

History

History
93 lines (71 loc) · 3.28 KB

File metadata and controls

93 lines (71 loc) · 3.28 KB

sx

A small TUI for tmux sessions + git-worktree agent workflows. Each task gets its own git worktree (isolation) running in its own tmux session.

Install

go install github.com/m7medVision/sx@latest

Bound in ~/.tmux.conf:

bind-key s run-shell '$HOME/go/bin/sx'

Press prefix s to open it.

Keys

Key Action
enter switch to the selected session
ctrl-n new plain session (prompts for a name)
ctrl-w new git-worktree session (pick or type a branch)
ctrl-x kill the selected session (asks before removing a worktree)
r review the selected linked worktree (status and diff)
esc/q cancel
? show help
c edit config (global + per-project)

ctrl-w only appears inside a git repo. New worktrees go to <repo>/.worktrees/<branch> and .worktrees/ is auto-added to .gitignore.

Config

Worktrees are clean checkouts with no gitignored files. Tell sx what to bring in via ~/.config/sx/config.yaml and/or per-project .sx.yaml (project wins).

Press c to edit config from inside the TUI. The config view has two scopes, toggled with tab (only when you're inside a git repo):

  • global~/.config/sx/config.yaml
  • project.sx.yaml at the repo root

Keys in the config view:

Key Action
tab switch scope (global ↔ project)
/ move between worktree_dir, copy, symlink
a add a file (mini-fzf picker) or edit (worktree_dir / global scope)
d delete the highlighted glob
e edit the highlighted line (dir or globs)
enter save the active scope to disk
q/esc close without saving

When you press a on files.copy / files.symlink inside a git repo, a mini-fzf opens: type to fuzzy-filter, tab to multi-select, ↑/↓ or j/k to move, enter to add all marked (or the current line), esc to leave the picker. The footer flashes ✓ added N file(s) for ~2 seconds after each commit.

Edits apply to whichever scope is active; the other scope's file is untouched. Save writes only the configured fields, so agent-detection markers already in the file are preserved.

Reviewing linked worktrees

Select a linked worktree session and press r to inspect its Git status and diff from HEAD. The review screen labels linked worktrees explicitly; ordinary tmux sessions cannot enter it. Press enter only when you want to switch to that existing session. Review never merges, discards, or removes worktrees.

Optionally configure a review tool. Press e on the review screen to launch it explicitly in the selected worktree; SX_REVIEW_WORKTREE contains that path. For example:

review_command: code --reuse-window .
worktree_dir: .worktrees
files:
  copy:
    - .env
    - .env.*
  symlink:
    - node_modules