feat: add terminal execution mode for custom commands#24
Conversation
Add `mode` field to custom command config: `"spawn"` (default, unchanged) or `"terminal"` (VS Code integrated terminal). Terminal mode uses `shell-quote` for safe command quoting via `sendText()`. Closes #18 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 significantly enhances the custom commands feature by introducing a new execution mode that runs commands directly within a VS Code integrated terminal. This change provides users with greater flexibility and interactivity, enabling them to easily manage long-running processes like development servers or engage with interactive command-line tools without leaving the editor. The update includes necessary schema changes, robust validation, and comprehensive documentation to support the new functionality. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'terminal' execution mode for custom commands, allowing them to run in an integrated VS Code terminal. The changes are well-implemented across the codebase, including updates to types, configuration validation, command execution logic, and comprehensive documentation in both the README and specification files. The addition of shell-quote for safe command argument handling is a good choice.
My review includes a couple of suggestions to enhance debuggability and test coverage. Specifically, I've recommended improving the logging for terminal commands to show the exact quoted command being executed, and strengthening the tests to cover cases with spaces in command arguments.
The previous mock joined args with spaces, which couldn't verify that arguments with spaces are properly quoted. Updated mock to simulate POSIX-style quoting and added a test case for it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The log message used args.join(" ") which didn't match the
shell-quoted command actually sent to the terminal, making
debug output misleading for arguments with spaces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
modefield to custom command config:"spawn"(default, unchanged) or"terminal"(VS Code integrated terminal)labelas name, sends the shell-quoted command viasendText(), and keeps the terminal open for interactionshell-quotefor safe POSIX shell quoting (bundled by esbuild)Changes
src/types.tsmodetoCustomCommandConfigsrc/utils/customCommandConfig.tssrc/commands/customCommand.tsterminalCommand()+ mode branchingpackage.jsonshell-quotedepsrc/utils/__tests__/customCommandConfig.test.tssrc/commands/__tests__/customCommand.test.tsdocs/spec/custom-commands.mdREADME.mdTest plan
pnpm build— esbuild bundlesshell-quote(30.3kb output)pnpm test— 97/97 tests pass (89 baseline + 8 new)pnpm lint:es— clean"mode": "terminal"command opens terminal with correct name/cwd/command"mode": "spawn"(or omitted) behaves unchanged"mode"value → entry skipped with log messageCloses #18
🤖 Generated with Claude Code