Fish functions for jj workspace management (flakes-rhqy)
Convention-based jj workspace management via fish shell functions. All workspaces at ~/workspaces/
Functions
| Abbr | Full name | Behavior |
|---|---|---|
| wl | workspace-list | List all workspaces across all projects with bookmark + dirty/conflict status |
| w | workspace-cd | cd to a workspace + show brief status. Tab-completes |
| wc | workspace-create | From inside a repo, create ~/workspaces/ |
| workspace-delete | (no abbr) | Forget + remove a workspace |
Design Details
Convention
- All workspaces at ~/workspaces/
/ = basename of the main repo root - Default workspace = the main repo itself
Registry (~/.config/workspaces.conf)
- Maps project name to main repo path (e.g. llm-triage=/home/yj/code/llm-triage)
- Auto-populated by wc on first use
- Needed to discover default workspace / run jj commands from the right root
workspace-list (wl)
- Iterates all registered projects
- For each: runs jj workspace list from main repo, then for each workspace shows:
- Workspace name (default or feature name)
- Path (main repo or ~/workspaces/
/ ) - Bookmark name (or ‘no bookmark’)
- Change-id (short)
- Status: clean / dirty / conflicts
- Grouped by project
workspace-cd (w)
- w
/ → cd to workspace path + print one-line status (bookmark, change-id, dirty/conflicts) - w
/default → cd to main repo root - Tab completion for all
/ combos - w with no args → do nothing
workspace-create (wc)
- Must be run from inside a jj repo
- wc
→ jj workspace add ~/workspaces/ / - Auto-registers project in ~/.config/workspaces.conf if not present
- cd to the new workspace after creation
workspace-delete
- workspace-delete
/ → jj workspace forget (from main repo) + rm -rf the directory - No abbreviation (destructive operation)
- Tab completion same as w
Tasks
- Create workspace-list.fish function
- Create workspace-cd.fish function with completions
- Create workspace-create.fish function
- Create workspace-delete.fish function
- Add abbrs (wl, w, wc) to abbrs.nix
- Wire functions into fish module via nix (autowired automatically)