`wt step` confusion
I'm new to worktrunk and keep tripping over wt step. Its help says "Run individual operations", and the examples describe the manual merge workflow (commit → squash → rebase → push). Those four subcommands fit that description well. The other eight don't: they're unrelated tools that seem to have ended up under step because they had no other home.
Here's what wt step contains today (v0.81.0), grouped by what each command actually does:
| Kind | Subcommands |
|---|---|
Parts of the wt merge pipeline |
commit, squash, rebase, push |
| Looking at a branch | diff |
| Moving files between worktrees | copy-ignored |
| Templates and scripting | eval, for-each |
| Maintaining worktrees in bulk | prune, relocate, promote |
| Supervising processes | tether |
wt step <alias> also runs a configured alias, even though wt <alias> already works at the top level.
Rational
- The name doesn't help you find things. If I want to remove merged worktrees, I'd look under
wt remove, notwt step prune. If I want to see a branch's changes,wt step diffisn't where I'd look either. - It hides how the merge pipeline works.
wt stepwould be a clear way to explainwt merge(run its stages one at a time) if those four commands weren't mixed in with eight others.
Proposal
Make wt step mean only "the stages of wt merge", and move everything else out:
- Keep
commit,squash,rebase,pushunderwt step. - Move commands to an existing verb where one fits. For example,
prunecould becomewt remove --merged. - Move commands to top-level or new verb for other commands (
relocate,promote,for-each,eval,tether,copy-ignored, and possiblydiff). For examplewt foreachmirrorsgit submodule foreachnicely. - Stop accepting aliases under
wt step, since they already work aswt <alias>.
The help text agrees with your reading. wt step's long help calls it "the building blocks of wt merge — commit, squash, rebase, push — plus standalone utilities" (src/cli/mod.rs), so the mix you describe is how the command is documented. This isn't the first time it has caused trouble: in #3004 a user looked for a merged-worktree cleanup command under wt --help and wt remove --help, never found wt step prune, and suggested wt prune or wt remove --all as the obvious names.
Some things a maintainer will need to weigh:
- Compatibility. The project treats CLI arguments as a protected interface. A move would most likely add the new names and keep every
wt step <x>working, hidden or with a deprecation warning, rather than drop the old ones. Your item 4 (no aliases underwt step) breaks existing invocations the same way. - Experimental commands are the cheapest to move.
promote,relocateandtetherare all marked[experimental], so their names aren't settled yet.prune,diff,copy-ignored,evalandfor-eachare stable, so moving them needs the compatibility path above. prune→wt remove --mergedfits well, becauseprunealready uses the same integration checks aswt remove. The open question is how a bulk mode fits next towt remove's positional worktree arguments.
Choosing names and deciding which commands move is for the maintainers, so I'm leaving this open for them. Until then, a user-config alias gives you the name you'd reach for. wt <name> checks built-ins first and then aliases:
[aliases]
prune = "wt step prune {{ args }}"
foreach = "wt step for-each {{ args }}"
wt isn't 1.0, so I would think now's the time to get this right.
Fair point. Being pre-1.0 doesn't stop renames, and the project has already made one without breaking scripts: wt select was folded into wt switch, and the old command still works as a hidden alias marked "Deprecated: use wt switch instead" (src/cli/mod.rs). If wt step is narrowed, its other subcommands could move the same way. The new names become the documented ones, and wt step prune and the rest keep running for a while with a warning.
So compatibility probably isn't what decides this. What's left is choosing the new names and which commands move, and that's the part I'm leaving to the maintainers.
the intention of step was to allow lots of commands without gunking up the simplicity of the main namespace
I agree step isn't perfect, but it's not terrible (all of those things are steps, in a way!), and there are aliases for folks' common commands
happy to leave this open and see if it gains 👍