✨ feat(cli): willow-aware context detection & repo-scoped commands#22
Merged
iamrajjoshi merged 1 commit intomainfrom Feb 14, 2026
Merged
✨ feat(cli): willow-aware context detection & repo-scoped commands#22iamrajjoshi merged 1 commit intomainfrom
iamrajjoshi merged 1 commit intomainfrom
Conversation
Commands are now scoped to ~/.willow-managed repos. Running them from a non-willow git repo shows a clear error instead of operating on that repo's worktrees. - Add IsWillowRepo, ListRepos, ResolveRepo helpers to config package - Make `ww ls` context-aware: shows repo list outside willow, worktrees inside, and accepts an optional [repo] positional argument - Add --repo/-r flag to `ww new` for creating worktrees from anywhere - Guard rm, pwd, run, prune, init, config with requireWillowRepo check - Add `www` shell alias to cd into ~/.willow/worktrees - Add completeRepos shell completion for ls - Update README with example workflow and new command docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
new,ls,rm,pwd,run,prune,init,config) are now scoped to~/.willow-managed repos. Running them from a non-willow git repo shows a clear error instead of confusingly operating on that repo's worktrees.ww ls: Lists repos with worktree counts when outside willow, lists worktrees when inside a willow repo, and accepts an optional[repo]positional arg to target a specific repo from anywhere.--repoflag onww new: Create worktrees in any willow-managed repo withoutcd'ing there first (ww new fix-bug --repo backend).wwwshell alias: Quickcd ~/.willow/worktreesvia shell-init (bash, zsh, fish).ww ls.Test plan
go buildcompiles cleanlygo vet ./...passesgo test ./...— all existing tests passww clone <repo>thenww lsfrom inside worktree shows worktreesww lsfrom outside willow lists all repos with countsww ls <repo-name>lists that repo's worktrees from anywhereww new branch --repo <name>creates worktree from anywhereww new branchfrom non-willow repo errors with helpful messageww rm,ww pwd,ww run,ww pruneerror clearly from non-willow repowillow shell-initoutput includeswwwalias🤖 Generated with Claude Code