feat(cli): Add 'list' subcommand to '/commands'#22324
feat(cli): Add 'list' subcommand to '/commands'#22324Jwhyee wants to merge 23 commits intogoogle-gemini:mainfrom
Conversation
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 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 list subcommand to /commands, allowing users to see all loaded custom command files. The implementation is straightforward and includes corresponding documentation and tests. My main feedback is to improve error handling when scanning for command files to provide better diagnostics for users, ensuring detailed logging for unexpected errors as per best practices.
- Refactor FileCommandLoader to expose getCommandDirectories - Improve error handling with isNodeError and add internal debugLogger - Fix strict typing issues in tests - Add mock cleanup (restoreAllMocks) in afterEach
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a useful list subcommand to the /commands utility, allowing users to see all loaded .toml command files. The implementation is well-structured and includes corresponding documentation and unit tests. I've identified one area for improvement regarding code duplication in commandsCommand.ts to enhance maintainability.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
|
@Jwhyee, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new /commands list sub-command to the CLI, enabling users to view available custom .toml command files from user, project, and extension sources. The changes include the implementation of listAvailableFiles in the FileCommandLoader service, the addition of the list sub-command action in the UI layer, corresponding documentation updates, and new unit tests to verify the functionality. There are no review comments to address, and I have no further feedback to provide.
|
Please fix test failures. |
|
@cocosheng-g Fixed test failures! A type error introduced by the upstream merge. |
|
@cocosheng-g Thanks for enabling auto-merge! The docs-pr-check has been queued for over 3 hours without running. is there anything I need to do on my end, or does this need a re-trigger? |
|
Requesting review from gemini-cli-docs |
Head branch was pushed to by a user without write access
jkcinouye
left a comment
There was a problem hiding this comment.
LGTM - docs.
One minor. note.
|
@jkcinouye Thank you for the suggestion. I've applied the changes to make it read more naturally. |
Summary
Adds a
listsubcommand to the/commandsutility to display all currently loaded.tomlcommand files. This improves the developer experience by allowing users to quickly verify which custom commands and prompts are active without manually inspecting the file system.Details
Currently, the
/commandscommand only supports thereloadsubcommand. This PR introduces thelistsubcommand, which reads and outputs the filenames from the directories evaluated by the CLI (user-level~/.gemini/commands/, project-level<project>/.gemini/commands/, MCP prompts, and extensions).commandsCommand.test.tsto ensure the correct paths are scanned and listed.docs/reference/commands.md.Related Issues
Fixes #22321
How to Validate
npm run buildfollowed bynpm start..tomlfile to~/.gemini/commands/or<project>/.gemini/commands/./commands list..tomlfiles present in those directories.npm run test.npm run preflightto confirm formatting and linting pass.Pre-Merge Checklist