Skip to content

✨ feat(cli): willow-aware context detection & repo-scoped commands#22

Merged
iamrajjoshi merged 1 commit intomainfrom
feat--willow-context-detection
Feb 14, 2026
Merged

✨ feat(cli): willow-aware context detection & repo-scoped commands#22
iamrajjoshi merged 1 commit intomainfrom
feat--willow-context-detection

Conversation

@iamrajjoshi
Copy link
Owner

Summary

  • Repo-scoped commands: All commands (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.
  • Context-aware 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.
  • --repo flag on ww new: Create worktrees in any willow-managed repo without cd'ing there first (ww new fix-bug --repo backend).
  • www shell alias: Quick cd ~/.willow/worktrees via shell-init (bash, zsh, fish).
  • Shell completions: Tab completion for repo names on ww ls.
  • README update: Added full example workflow (clone → init → new → commit/push → ls → rm) and documented all new flags/behavior.

Test plan

  • go build compiles cleanly
  • go vet ./... passes
  • go test ./... — all existing tests pass
  • ww clone <repo> then ww ls from inside worktree shows worktrees
  • ww ls from outside willow lists all repos with counts
  • ww ls <repo-name> lists that repo's worktrees from anywhere
  • ww new branch --repo <name> creates worktree from anywhere
  • ww new branch from non-willow repo errors with helpful message
  • ww rm, ww pwd, ww run, ww prune error clearly from non-willow repo
  • willow shell-init output includes www alias

🤖 Generated with Claude Code

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>
@iamrajjoshi iamrajjoshi changed the title ✨ Willow-aware context detection & repo-scoped commands ✨ feat(cli): willow-aware context detection & repo-scoped commands Feb 14, 2026
@iamrajjoshi iamrajjoshi merged commit 2ab62aa into main Feb 14, 2026
2 checks passed
@iamrajjoshi iamrajjoshi deleted the feat--willow-context-detection branch February 14, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant