feat: add custom commands for tree view context menu#19
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a powerful new feature that allows users to define and execute custom external commands directly from the Git WorkGrove tree view context menu. This significantly enhances the extensibility of the extension, enabling seamless integration with other tools and workflows by providing configurable command execution with dynamic context-aware arguments and environment variables. The implementation includes new settings, robust command validation, and comprehensive documentation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Allow users to configure external commands (e.g., open in Ghostty, Zed,
Terminal.app) triggered from the tree view context menu via two new settings:
- customCommands.directory: for worktree/repository items
- customCommands.workspace: for workspace file items
Each command supports template variables ({name}, {branch}, {ref}, {head},
{path}, {dir}, {worktree}) and optional environment variables. Commands are
shown in a QuickPick and spawned as fire-and-forget child processes.
Also adds {dir} template variable for workspace items (parent directory).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f3fe3c2 to
775868c
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a powerful new feature for defining custom commands in the tree view context menu. The implementation is comprehensive, covering configuration, command execution, and documentation updates. My review focuses on a critical security vulnerability, a bug in configuration validation, and a few opportunities to improve code maintainability and consistency. Addressing the security issue is paramount before merging.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3fe3c2064
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Template variables like {path} can contain shell metacharacters. Using
shell: true on POSIX would allow injection via crafted directory names.
POSIX spawn resolves PATH without a shell, so shell: true is only needed
on Windows for .cmd/.bat support.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reject entries with non-string env values (e.g., { FOO: 123 }) during
validation instead of letting them crash renderTemplate at runtime.
Simplify getCustomCommands since env is now guaranteed valid.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
customCommands.directory,customCommands.workspace) for configuring external commands triggered from the tree view context menu{name},{branch},{ref},{head},{path},{dir},{worktree}) and optional environment variables{dir}template variable for workspace items (parent directory of workspace file)Test plan
open -a) opens at correct directoryCloses #17
Related: #18 (VS Code integrated terminal mode — future enhancement)
🤖 Generated with Claude Code