Skip to content

feat: add /commands reload to refresh custom TOML commands#19078

Merged
NTaylorMullen merged 4 commits into
google-gemini:mainfrom
korade-krushna:feat/reload-custom-commands
Feb 14, 2026
Merged

feat: add /commands reload to refresh custom TOML commands#19078
NTaylorMullen merged 4 commits into
google-gemini:mainfrom
korade-krushna:feat/reload-custom-commands

Conversation

@korade-krushna

Copy link
Copy Markdown
Contributor

Summary

Add a new built-in /commands reload slash command that allows users to refresh custom command definitions from .toml files without restarting the CLI session, closing the iteration loop gap with /skills reload and /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:

  • commandsCommand.ts (new): Defines /commands (usage hint) and /commands reload (triggers context.ui.reloadCommands() to re-create the CommandService from all three loaders: McpPromptLoader, BuiltinCommandLoader, FileCommandLoader).
  • BuiltinCommandLoader.ts: Registers the new command alongside other built-in commands.
  • commandsCommand.test.ts (new): Unit tests for both the default action and reload subcommand.

Related Issues

Closes #19071

How to Validate

  1. npm run build && npm run start
  2. Type /commands → should display usage hint message
  3. Type /commands reload → should display "✓ Custom commands reloaded successfully."
  4. Create a new .toml file in ~/.gemini/commands/ (e.g., hello.toml with prompt = "Say hello")
  5. Run /commands reload, then type /hello → the new command should be recognized
  6. Run tests: npm test -w @google/gemini-cli -- src/ui/commands/commandsCommand.test.ts

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@korade-krushna korade-krushna requested a review from a team as a code owner February 14, 2026 19:09
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 /commands reload command integrates seamlessly with existing refresh functionalities, providing a more fluid and productive environment for users.

Highlights

  • New Slash Command: Introduced a new built-in /commands reload slash command to refresh custom command definitions from TOML files without restarting the CLI session.
  • Improved Developer Experience: Developers can now iterate on custom commands more efficiently, closing the loop with existing /skills reload and /memory refresh functionalities.
  • Command Definition: A new file, commandsCommand.ts, was added to define the /commands command and its reload subcommand, which triggers the reloadCommands() mechanism.
  • Test Coverage: Unit tests for the new /commands and /commands reload commands have been added in commandsCommand.test.ts.
Changelog
  • packages/cli/src/services/BuiltinCommandLoader.ts
    • Imported the new commandsCommand module.
    • Registered commandsCommand as a built-in command.
  • packages/cli/src/ui/commands/commandsCommand.test.ts
    • Added a new test file for commandsCommand.
    • Included tests for the default /commands action, verifying it prompts for subcommand usage.
    • Added tests for the /commands reload subcommand, confirming it calls reloadCommands and displays a success message.
  • packages/cli/src/ui/commands/commandsCommand.ts
    • Added a new file defining the commandsCommand.
    • Implemented a listAction for the default /commands invocation, providing a usage hint.
    • Implemented a reloadAction for /commands reload that triggers the context.ui.reloadCommands() function and displays a success message.
Activity
  • The pull request introduces a new feature to reload custom commands.
  • New files were added to define the command and its tests.
  • An existing file was modified to register the new command.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/cli/src/ui/commands/commandsCommand.ts
@gemini-cli gemini-cli Bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 14, 2026
@korade-krushna

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/cli/src/ui/commands/commandsCommand.ts
@korade-krushna korade-krushna requested a review from a team as a code owner February 14, 2026 19:42
@NTaylorMullen NTaylorMullen added this pull request to the merge queue Feb 14, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 14, 2026
@NTaylorMullen NTaylorMullen added this pull request to the merge queue Feb 14, 2026
Merged via the queue into google-gemini:main with commit bcd547b Feb 14, 2026
26 of 27 checks passed
kuishou68 pushed a commit to iOfficeAI/gemini-cli-pro that referenced this pull request Feb 27, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add /commands reload to refresh custom TOML commands

3 participants