diff --git a/.chezmoidata/packages.yaml b/.chezmoidata/packages.yaml index 51d583c..0db438a 100644 --- a/.chezmoidata/packages.yaml +++ b/.chezmoidata/packages.yaml @@ -152,3 +152,5 @@ packages: - crush # omp: prebuilt release binaries; not in the mise registry - github:can1357/oh-my-pi + # workmux: worktree + tmux session per agent (~/.config/workmux, prefix w) + - workmux diff --git a/docs/shell/scripts.md b/docs/shell/scripts.md index e530f3f..df375f0 100644 --- a/docs/shell/scripts.md +++ b/docs/shell/scripts.md @@ -54,6 +54,7 @@ Several scripts below also exist as fish functions of the same name (`ai`, `c2p` | [`projects-sync`](#projects-sync) | bash | Symlink every `~/Code` repo into `~/Projects` | | [`pj-palette`](#pj-palette) | bash | pj's tasks plus quick actions as a tmux-palette source | | [`tmux-sessions`](#tmux-sessions) | bash | Session/window/zoxide switcher as a tmux-palette source | +| [`workmux-palette`](#workmux-palette) | bash | workmux agents and worktrees as a tmux-palette source | | [`yazi-nvim-open`](#yazi-nvim-open) | sh | yazi opener that targets the host Neovim | ## ai @@ -475,6 +476,35 @@ pj-palette's background task sessions (`@pj_task`) are left out. Sessions are ta **Needs:** tmux, `jq`, `zoxide`. +## workmux-palette + +```sh +workmux-palette +workmux-palette --add BRANCH +workmux-palette --popup DIR CMD… +workmux-palette --do DIR CMD… +``` + +The source of the **Workmux** [tmux command palette](../terminal/tmux.md#command-palette) (`palettes/workmux.json`) for [workmux](../tools/workmux.md). Open it with tmux `prefix w` or the "Workmux" item in the main palette. + +With no arguments it prints palette items as JSON, grouped by category: + +| Group | Items | Action | +| --- | --- | --- | +| Agents | Every agent `workmux status --all --json` tracks in this tmux server: waiting (yellow), done (green), working (blue), then idle, most recent first. Title `/`, description status, time since the change, and the pane title | `switch-client` to the agent's pane | +| Worktrees: `` | The active pane's repo's worktrees (`workmux list --json`, main checkout left out): branch, open/closed, dirty, path. Open ones are green | `workmux open` (starts the session if closed) | +| New | **New worktree from a prompt**, when the pane is in a repo | `workmux add -A -e` in a popup: `$EDITOR` for the prompt, omp names the branch | +| Workmux | **Dashboard** (90% popup), **Sidebar** (toggle), **Last done** (`workmux last-done`) | | +| Close | One per open worktree | `workmux close`: ends the session, keeps worktree and branch | +| Merge | One per worktree | `workmux merge` in a popup | +| Remove | One per worktree | `workmux remove` in a popup (asks before deleting unmerged commits) | + +**`--add BRANCH`** is the palette's `query` item: the typed text, listed after the matches, becomes `workmux add BRANCH` in the active pane's directory, so a branch name that matches nothing creates its worktree and session and switches to it. + +**`--popup DIR CMD…`** runs CMD in DIR in an 80% × 60% popup (argv form, so nothing is re-parsed by a shell or by tmux formats). The popup closes when CMD succeeds; on failure it shows `[exit N]` and waits for a key. **`--do DIR CMD…`** runs CMD in place and shows the last output line as a tmux message when it fails. + +**Needs:** tmux, `jq`, `git`, `workmux`. + ## yazi-nvim-open ```sh diff --git a/docs/terminal/tmux.md b/docs/terminal/tmux.md index 33f73e8..1a6598f 100644 --- a/docs/terminal/tmux.md +++ b/docs/terminal/tmux.md @@ -43,6 +43,7 @@ These settings are what [yazi](../tools/yazi.md) needs inside tmux. `allow-passt | `prefix /` | Copy mode, then search upward | | `prefix o` | Sessions palette ([`tmux-sessions`](../shell/scripts.md#tmux-sessions)): fuzzy-find the other sessions, every window of every session, zoxide's and `~/.config`'s directories, and Rename/Kill items per session. Typed text that is not a session starts one by that name in its zoxide match | | `prefix t` | Project Tasks palette ([`pj-palette`](../shell/scripts.md#pj-palette)): install/dev/sync/make/compose quick actions plus every `pj` task. One-off tasks run in a full-width bottom split (25% of the window); dev servers and `docker compose up` run in a background `:` session shown in a popup (`q` hides, `ctrl-c` asks `y/n` then stops), listed under Running to reopen | +| `prefix w` | Workmux palette ([`workmux-palette`](../shell/scripts.md#workmux-palette)): tracked agents by status, the repo's worktrees with Close/Merge/Remove, new worktree from the typed branch or a prompt, dashboard, sidebar, last-done. Replaces tmux's `choose-tree`, which the Sessions palette covers. See [workmux](../tools/workmux.md) | | `prefix y` / `prefix e` | Yazi / Neovim in a new window in the pane cwd (Ghostty `ctrl+shift+f` / `ctrl+shift+e`) | | `prefix g` | Lazygit in a 90% popup in the pane cwd (Ghostty `ctrl+shift+g`) | | `prefix a` | omp in a background session `:omp` (pane cwd), shown in a popup docked bottom-right (35% × 60%) and listed in the [omp palette](../shell/scripts.md#pj-palette) and under Running in the tasks palette. In the popup, `ctrl-c` hides it and `ctrl-q` quits omp. Inside any background-task popup, `prefix a` hides it too, so Ghostty `ctrl+shift+a` toggles omp | @@ -82,6 +83,8 @@ Each window reads `