feat: add /commands reload to refresh custom TOML commands#19078
Conversation
Summary of ChangesHello @korade-krushna, 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 developer workflow by enabling the dynamic reloading of custom TOML-based commands within the CLI. This change eliminates the need for frequent restarts during development, streamlining the process of creating and testing new commands. The new Highlights
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 useful /commands reload feature. The implementation is clean and includes corresponding tests. My main feedback concerns error handling in the reloadAction. The current implementation optimistically assumes the reload will succeed, which could lead to misleading feedback for the user if an error occurs. I've suggested adding a try...catch block to make the command more robust and provide accurate and detailed error reporting, aligning with best practices for exception handling.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new /commands reload command to allow users to refresh custom TOML commands without restarting the CLI. The implementation is straightforward, adding a new command definition, registering it, and including tests. However, I've identified a potential race condition in the reloadAction implementation. The action currently displays a success message before the asynchronous reload operation is complete, which could lead to a misleading user experience if the reload fails. My feedback suggests awaiting the reload function to ensure correct feedback and error handling, aligning with best practices for asynchronous I/O operations.
bcd547b
Summary
Add a new built-in
/commands reloadslash command that allows users to refresh custom command definitions from .toml files without restarting the CLI session, closing the iteration loop gap with/skills reloadand/memory refresh.Details
Currently, developers iterating on custom commands have to exit and restart the CLI session to see changes reflected. This PR exposes the existing internal
reloadCommands()mechanism as a user-facing command.Video
Screen.Recording.2026-02-15.at.12.17.54.AM.mp4
Changes:
/commands reload(triggerscontext.ui.reloadCommands()to re-create the CommandService from all three loaders:McpPromptLoader, BuiltinCommandLoader, FileCommandLoader).Related Issues
Closes #19071
How to Validate
npm run build && npm run start/commands reload→ should display "✓ Custom commands reloaded successfully."~/.gemini/commands/(e.g., hello.toml withprompt = "Say hello")/commands reload, then type/hello→ the new command should be recognizednpm test -w @google/gemini-cli -- src/ui/commands/commandsCommand.test.tsPre-Merge Checklist