@ogpoyraz/wtx 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -6
- package/completions/_wtx.zsh +19 -0
- package/completions/wtx.bash +4 -3
- package/completions/wtx.fish +6 -3
- package/dist/cli.mjs +2422 -1915
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,9 +80,11 @@ If origin already has a branch with that name owned by someone else, `wtx` warns
|
|
|
80
80
|
|
|
81
81
|
| Command | Args | Flags | Description |
|
|
82
82
|
|---|---|---|---|
|
|
83
|
-
| `create` | `<branch>` | `--repo`, `--base`, `--open`, `--ide`, `--track`, `--local`, `--agent <name>`, `--prompt <text>` | Create worktree(s), sync files, prepare deps, optionally spawn an agent |
|
|
83
|
+
| `create` | `<branch>` | `--repo`, `--base`, `--open`, `--ide`, `--track`, `--local`, `--agent <name>`, `--prompt <text>`, `--deps <strategy>` | Create worktree(s), sync files, prepare deps, optionally spawn an agent |
|
|
84
84
|
| `pull` | `<pr-link>` | `--repo` | Fetch a GitHub PR and create its worktree |
|
|
85
|
+
| `pull-branch` | `[branch]` | `--repo` | Fast-forward pull a worktree's branch (auto-detects repo from cwd) |
|
|
85
86
|
| `remove` | `<branch>` | `--repo`, `--force`, `--yes` | Remove worktree(s), clean empty dirs |
|
|
87
|
+
| `rename` | `<old-branch> <new-branch>` | `--repo` | Rename the branch and move the checkout to the matching new directory |
|
|
86
88
|
| `prune` | | `--repo`, `--force`, `--yes` | Remove worktrees whose PR has merged |
|
|
87
89
|
| `open` | `<branch>` | `--repo`, `--ide` | Open worktree in IDE |
|
|
88
90
|
| `rebase` | `<branch>` | `--repo` | Fetch base remote main, rebase worktree onto it |
|
|
@@ -139,6 +141,12 @@ Config lives at `~/.config/wtx/config.json`.
|
|
|
139
141
|
},
|
|
140
142
|
"my-go-service": {
|
|
141
143
|
"main_branch": "main"
|
|
144
|
+
},
|
|
145
|
+
"forked-lib": {
|
|
146
|
+
"check_prs": true,
|
|
147
|
+
"forge_provider": "github",
|
|
148
|
+
"pr_lookup_repo": "upstream-owner/lib",
|
|
149
|
+
"install_script": "pnpm install --frozen-lockfile"
|
|
142
150
|
}
|
|
143
151
|
}
|
|
144
152
|
}
|
|
@@ -159,10 +167,22 @@ Config lives at `~/.config/wtx/config.json`.
|
|
|
159
167
|
| `repos.<name>.fetch_main_on_create` | `true` | Fetch before creating so branches start fresh |
|
|
160
168
|
| `repos.<name>.sync_files` | `[]` | Files copied from main checkout on create and sync |
|
|
161
169
|
| `repos.<name>.post_create` / `post_sync` | `[]` | Hook commands; failures fail the command with a rerun hint |
|
|
170
|
+
| `repos.<name>.install_script` | `null` | Command run inside a worktree for `deps --install` and `create --deps install` (`{wt}`, `{branch}`, `{main}` expanded); when unset, the detected package manager performs a real install |
|
|
162
171
|
| `repos.<name>.deps.manager` | `"auto"` | Force a manager: `npm` `bun` `pnpm` `yarn` `go` `python` `cargo` |
|
|
163
172
|
| `repos.<name>.deps.strategy` | `"auto"` | `auto` `link` `symlink` `install` `off` — see below |
|
|
164
|
-
| `repos.<name>.
|
|
165
|
-
| `repos.<name>.
|
|
173
|
+
| `repos.<name>.check_prs` | `true` | Set `false` to skip all PR lookups for this repo's branches (no `gh` calls) |
|
|
174
|
+
| `repos.<name>.forge_provider` | `"auto"` | `"auto"` enables GitHub only when the origin remote is github.com; `"github"` forces GitHub even for other hosts (GitHub Enterprise) |
|
|
175
|
+
| `repos.<name>.pr_lookup_repo` | `null` | `owner/repo` override for where PRs are looked up — use when origin points at a fork or mirror |
|
|
176
|
+
|
|
177
|
+
#### PR lookup keys explained
|
|
178
|
+
|
|
179
|
+
PR visibility (`wtx prs`, the TUI badges, ownership tags, `prune`) is read-only via the `gh` CLI. Three per-repo keys tune it:
|
|
180
|
+
|
|
181
|
+
- **`check_prs`** — master switch. `false` disables every `gh` query for this repo; everything else keeps working.
|
|
182
|
+
- **`forge_provider`** — which forge hosts the project. `"auto"` only activates GitHub when your origin remote is `github.com`; set `"github"` to force it for GitHub Enterprise or custom domains.
|
|
183
|
+
- **`pr_lookup_repo`** — where to look PRs up, as `owner/repo`. Normally derived from origin; override when origin points at your fork but PRs live in the upstream repo.
|
|
184
|
+
|
|
185
|
+
Legacy configs using `pr`, `forge`, and `pr_repo` keep working — they are migrated automatically on load and rewritten in place on the next config save.
|
|
166
186
|
|
|
167
187
|
### Template variables
|
|
168
188
|
|
|
@@ -194,6 +214,8 @@ Hooks also receive `WTX_PORT` as an environment variable, as does `wtx exec`. Po
|
|
|
194
214
|
| `install` | Always a real install in the worktree |
|
|
195
215
|
| `off` | Leave dependencies alone |
|
|
196
216
|
|
|
217
|
+
Per-repo `install_script` overrides the install command entirely — useful for non-standard setups (`pnpm install --frozen-lockfile`, bootstrap scripts, codegen steps). It runs inside the worktree with the same `{wt}` / `{branch}` / `{main}` template expansion as hooks.
|
|
218
|
+
|
|
197
219
|
### Safe linking (the `auto` default)
|
|
198
220
|
|
|
199
221
|
When manifests match main, wtx creates a **real** `node_modules` directory in the worktree containing per-package symlinks into main's tree (scoped packages traversed, `.bin` linked). Package-manager operations inside the worktree replace links, never main's files — an `npm install` in one branch cannot damage another checkout. If replacing an existing directory fails mid-way, the original is restored rather than left missing.
|
|
@@ -259,7 +281,7 @@ wtx pull https://github.com/OGPoyraz/wtx/pull/11 # PR → worktree in one comm
|
|
|
259
281
|
wtx prune # remove worktrees whose PR merged
|
|
260
282
|
```
|
|
261
283
|
|
|
262
|
-
Lookups degrade gracefully: if `gh` is missing or unauthenticated you get a warning and everything else keeps working. Fork workflows are covered by `
|
|
284
|
+
Lookups degrade gracefully: if `gh` is missing or unauthenticated you get a warning and everything else keeps working. Fork workflows are covered by `check_prs` / `forge_provider` / `pr_lookup_repo`.
|
|
263
285
|
|
|
264
286
|
---
|
|
265
287
|
|
|
@@ -272,7 +294,10 @@ Lookups degrade gracefully: if `gh` is missing or unauthenticated you get a warn
|
|
|
272
294
|
| `/` | Fuzzy-filter entries by branch, repo, PR, owner |
|
|
273
295
|
| `Space` | Multi-select for batch operations |
|
|
274
296
|
| `R` / `D` / `s` | Batch rebase / remove / sync selection |
|
|
275
|
-
| `
|
|
297
|
+
| `p` | Pull latest changes for selected branch(es) |
|
|
298
|
+
| `i` | Install dependencies in selected worktree(s) |
|
|
299
|
+
| `n` | Create worktree — pick a dependency strategy (auto / install / symlink) |
|
|
300
|
+
| `m` | Rename worktree (branch + directory move) |
|
|
276
301
|
| `b` | Rebase selected |
|
|
277
302
|
| `a` | Spawn coding agent in selected worktree |
|
|
278
303
|
| `H` | Action history (recent actions across CLI and dashboard) |
|
|
@@ -280,7 +305,9 @@ Lookups degrade gracefully: if `gh` is missing or unauthenticated you get a warn
|
|
|
280
305
|
| `c` | Edit configuration |
|
|
281
306
|
| `?` / `q` | Help / quit |
|
|
282
307
|
|
|
283
|
-
Actions run in the background — navigation never locks. Progress shows inline: `fetching`
|
|
308
|
+
Actions run in the background — navigation never locks. Progress shows inline: `fetching`, `pulling`, `installing deps`, `renaming`, etc. next to the repo or branch being worked on, and a new worktree appears immediately as a `(creating)` row. Repositories render alphabetically and stay sorted across create/delete operations. While data loads, repos appear immediately with a `refreshing…` indicator. One operation runs per repo at a time; conflicting actions are rejected with a toast until it finishes. On failure a log modal opens with the captured output; press any key to dismiss. Destructive ones confirm first.
|
|
309
|
+
|
|
310
|
+
If a rebase hits conflicts, the worktree is restored: the in-progress rebase is aborted automatically, the branch stays on its pre-rebase commits, and a "Rebase failed — manual merge needed" log explains what happened.
|
|
284
311
|
|
|
285
312
|
---
|
|
286
313
|
|
package/completions/_wtx.zsh
CHANGED
|
@@ -61,6 +61,8 @@ _wtx() {
|
|
|
61
61
|
'open[Open worktree in IDE]' \
|
|
62
62
|
'rebase[Fetch and rebase vs main]' \
|
|
63
63
|
'pull[Fetch a PR and create its worktree]' \
|
|
64
|
+
'pull-branch[Fast-forward pull a worktree branch]' \
|
|
65
|
+
'rename[Rename branch and move worktree directory]' \
|
|
64
66
|
'fetch[Fetch origin main]' \
|
|
65
67
|
'sync[Re-copy sync files and run post_sync]' \
|
|
66
68
|
'deps[Manage node_modules strategy]' \
|
|
@@ -137,6 +139,23 @@ _wtx() {
|
|
|
137
139
|
'--verbose[Show git commands]' \
|
|
138
140
|
'--dry-run[Show what would happen]'
|
|
139
141
|
;;
|
|
142
|
+
pull-branch)
|
|
143
|
+
_arguments \
|
|
144
|
+
'::branch:_wtx_branches' \
|
|
145
|
+
{-r,--repo}'[Target specific repo(s)]:repo:_wtx_repos' \
|
|
146
|
+
{-q,--quiet}'[Suppress output]' \
|
|
147
|
+
'--verbose[Show git commands]' \
|
|
148
|
+
'--dry-run[Show what would happen]'
|
|
149
|
+
;;
|
|
150
|
+
rename)
|
|
151
|
+
_arguments \
|
|
152
|
+
':old-branch:_wtx_branches' \
|
|
153
|
+
':new-branch:' \
|
|
154
|
+
{-r,--repo}'[Target specific repo(s)]:repo:_wtx_repos' \
|
|
155
|
+
{-q,--quiet}'[Suppress output]' \
|
|
156
|
+
'--verbose[Show git commands]' \
|
|
157
|
+
'--dry-run[Show what would happen]'
|
|
158
|
+
;;
|
|
140
159
|
fetch)
|
|
141
160
|
_arguments \
|
|
142
161
|
'--repo[Target specific repo(s)]:repo:_wtx_repos' \
|
package/completions/wtx.bash
CHANGED
|
@@ -43,7 +43,7 @@ _wtx_completions() {
|
|
|
43
43
|
cword=$COMP_CWORD
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
local subcommands="config create remove prune open rebase fetch sync deps ls cd status prs pull init skill terminal mcp exec"
|
|
46
|
+
local subcommands="config create remove prune open rebase fetch sync deps ls cd status prs pull pull-branch init skill terminal mcp exec rename"
|
|
47
47
|
local config_subcommands="init show set add-repo remove-repo"
|
|
48
48
|
local skill_subcommands="show path list"
|
|
49
49
|
local skill_names="opencode cursor claude"
|
|
@@ -88,11 +88,12 @@ _wtx_completions() {
|
|
|
88
88
|
if [[ "$cur" == -* ]]; then
|
|
89
89
|
local flags=""
|
|
90
90
|
case "$subcommand" in
|
|
91
|
-
create) flags="-r --repo --base --open --ide --track --agent --prompt -q --quiet --verbose --dry-run --help" ;;
|
|
91
|
+
create) flags="-r --repo --base --open --ide --track --agent --prompt --deps -q --quiet --verbose --dry-run --help" ;;
|
|
92
92
|
remove) flags="-f --force -y --yes -r --repo -q --quiet --verbose --dry-run --help" ;;
|
|
93
93
|
prune) flags="-f --force -y --yes -r --repo -q --quiet --verbose --dry-run --help" ;;
|
|
94
94
|
open) flags="-r --repo --ide -q --quiet --verbose --dry-run --help" ;;
|
|
95
95
|
rebase) flags="--repo -q --quiet --verbose --dry-run --help" ;;
|
|
96
|
+
rename) flags="-r --repo -q --quiet --verbose --dry-run --help" ;;
|
|
96
97
|
fetch) flags="--repo -q --quiet --verbose --dry-run --help" ;;
|
|
97
98
|
sync) flags="--repo -q --quiet --verbose --dry-run --help" ;;
|
|
98
99
|
deps) flags="-r --repo --install --symlink --json -q --quiet --verbose --dry-run --help" ;;
|
|
@@ -152,7 +153,7 @@ _wtx_completions() {
|
|
|
152
153
|
cd)
|
|
153
154
|
[ "$prev" = "cd" ] && COMPREPLY=($(compgen -W "$(_wtx_get_repos)" -- "$cur")) && return 0
|
|
154
155
|
;;
|
|
155
|
-
rebase|open|status|remove|sync|deps)
|
|
156
|
+
rebase|open|status|remove|sync|deps|rename)
|
|
156
157
|
[ "$prev" = "$subcommand" ] && COMPREPLY=($(compgen -W "$(_wtx_get_branches)" -- "$cur")) && return 0
|
|
157
158
|
;;
|
|
158
159
|
esac
|
package/completions/wtx.fish
CHANGED
|
@@ -41,7 +41,7 @@ complete -c wtx -l dry-run -d "Show what would happen"
|
|
|
41
41
|
complete -c wtx -s h -l help -d "Display help for command"
|
|
42
42
|
|
|
43
43
|
# Subcommands
|
|
44
|
-
set -l commands config create remove prune open rebase fetch sync deps ls cd status prs pull init skill terminal mcp exec
|
|
44
|
+
set -l commands config create remove prune open rebase fetch sync deps ls cd status prs pull pull-branch init skill terminal mcp exec rename
|
|
45
45
|
|
|
46
46
|
# Setup completions for commands
|
|
47
47
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "config" -d "Manage configuration"
|
|
@@ -51,6 +51,8 @@ complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "prune" -d "Re
|
|
|
51
51
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "open" -d "Open worktree in IDE"
|
|
52
52
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "rebase" -d "Fetch and rebase vs main"
|
|
53
53
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "pull" -d "Fetch a PR and create its worktree"
|
|
54
|
+
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "pull-branch" -d "Fast-forward pull a worktree branch"
|
|
55
|
+
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "rename" -d "Rename branch and move worktree directory"
|
|
54
56
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "fetch" -d "Fetch origin main"
|
|
55
57
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "sync" -d "Re-copy sync files and run post_sync"
|
|
56
58
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "deps" -d "Manage node_modules strategy"
|
|
@@ -65,14 +67,15 @@ complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "mcp" -d "Run
|
|
|
65
67
|
complete -c wtx -n "not __fish_seen_subcommand_from $commands" -a "exec" -d "Execute commands across worktrees"
|
|
66
68
|
|
|
67
69
|
# Dynamically complete branch arguments
|
|
68
|
-
complete -c wtx -n "__fish_seen_subcommand_from create open rebase sync deps status remove" -a "(_wtx_get_branches)"
|
|
70
|
+
complete -c wtx -n "__fish_seen_subcommand_from create open rebase sync deps status remove rename pull-branch" -a "(_wtx_get_branches)"
|
|
69
71
|
|
|
70
72
|
# Flags
|
|
71
|
-
complete -c wtx -n "__fish_seen_subcommand_from create remove prune open rebase fetch sync deps ls status prs pull" -s r -l repo -xa "(_wtx_get_repos)" -d "Target specific repo(s)"
|
|
73
|
+
complete -c wtx -n "__fish_seen_subcommand_from create remove prune open rebase fetch sync deps ls status prs pull pull-branch rename" -s r -l repo -xa "(_wtx_get_repos)" -d "Target specific repo(s)"
|
|
72
74
|
|
|
73
75
|
# create flags
|
|
74
76
|
complete -c wtx -n "__fish_seen_subcommand_from create" -l base -xa "main master develop dev" -d "Base ref"
|
|
75
77
|
complete -c wtx -n "__fish_seen_subcommand_from create" -s o -l open -d "Open worktree in IDE after creation"
|
|
78
|
+
complete -c wtx -n "__fish_seen_subcommand_from create" -l deps -xa "auto link symlink install off" -d "Dependency strategy"
|
|
76
79
|
complete -c wtx -n "__fish_seen_subcommand_from create open" -l ide -xa "cursor code vscode code-insiders vscodium idea webstorm zed vim nvim emacs" -d "IDE to open with"
|
|
77
80
|
complete -c wtx -n "__fish_seen_subcommand_from create" -l track -d "Track remote branch even if it belongs to someone else"
|
|
78
81
|
complete -c wtx -n "__fish_seen_subcommand_from create" -l agent -d "AI agent to delegate work to"
|