Skip to content

feat(worktree): unify /worktree with add/list/switch/delete subcommands and inline menu#167

Open
kamysheblid wants to merge 2 commits into
grinev:mainfrom
kamysheblid:feat/unified-worktree-command
Open

feat(worktree): unify /worktree with add/list/switch/delete subcommands and inline menu#167
kamysheblid wants to merge 2 commits into
grinev:mainfrom
kamysheblid:feat/unified-worktree-command

Conversation

@kamysheblid

Copy link
Copy Markdown

Summary

Unifies the worktree command to support subcommands instead of only displaying an inline menu for switching.

Changes

  • /worktree add [name] — create a new worktree (optionally with a name, or interactive prompt)
  • /worktree list — formatted list of all worktrees with markers for current/main
  • /worktree switch [name] — switch worktree by name/path/branch, or show inline menu
  • /worktree delete <name> — delete a worktree with confirmation flow
  • /worktree help — show usage guide
  • Added matchWorktreeEntry() helper for fuzzy matching (by path, basename, or branch)
  • Added handleWorktreeDeleteCallback callback handler
  • Added i18n keys for delete flow across all 7 locales
  • Full test coverage for the new subcommands

@kamysheblid kamysheblid left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undone unecessary edit

@grinev

grinev commented Jun 21, 2026

Copy link
Copy Markdown
Owner

@kamysheblid thanks for PR. But it is out of concept of this bot, all commands doesn't have arguments, it's very unconvenient to type command with keyboard on mobile, chosing command from menu and then use inline buttons for additional actions - this is how all commands work there.
Unfortunately I can't approve this. You can align your changes to current bot ui, and I will be ready to review it.

@kamysheblid

kamysheblid commented Jun 21, 2026

Copy link
Copy Markdown
Author

@grinev You mean you want extra commands in the menu, like this?

/worktree_delete
/worktree_create
/worktree_list
/worktree_switch

Do you still want /worktree to be a command? If so what function should it perform? Should I remove /worktree_switch and just leave it as /worktree?

BTW I noticed other people submitted PRs for /session and /project. To do the same for those will mean adding 6-12 new commands in the menu, unless your plan is only to take PRs for the important ones, in which case worktree might not be that important and should be excluded even though that would be very annoying for people that use worktrees.

Would you consider letting me implement both of these and adding an environment variable (TELEGRAM_MENU_TYPE = ['inline','arguments'] or something) that lets the user choose, defaulting to the one you prefer, inline. I can see how it is annoying to have to type arguments on mobile, and I can also see how some people might prefer a smaller menu. If you pick the both options one I can work on implementing sessions, projects, opencode, and others, but if you want to stick with inline menu commands it will make the menu really big.

Implementing both wont add more than a dozen or so extra lines to the codebase, basically just an env/var check in src/bot/routers/message-router.ts line 155 in the message:text function.

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.

2 participants