Skip to content

feat(plan): implement plan slash command#17698

Merged
Adib234 merged 11 commits intomainfrom
adibakm/implement-plan-slash-command
Feb 4, 2026
Merged

feat(plan): implement plan slash command#17698
Adib234 merged 11 commits intomainfrom
adibakm/implement-plan-slash-command

Conversation

@Adib234
Copy link
Copy Markdown
Contributor

@Adib234 Adib234 commented Jan 27, 2026

Summary

Implement a slash command that switches a user's approval mode to plan and displays the current plan if they generated a plan before.

Details

Related Issues

Fixes 17686

How to Validate

Switch to plan mode by running the slash command /plan

If you have no plan active (a plan that was approved in the current session), then the feedback you should get is No active plan found. Please create and approve a plan first.

If you do, then you should see your current plan with the name of the markdown file as well. Should have the same name as what's in the temp plan directory.

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

@Adib234 Adib234 self-assigned this Jan 27, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Adib234, 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 /plan slash command to the CLI, enabling users to easily activate an experimental 'Plan Mode' and review their latest generated plan directly within the interface. This feature streamlines the workflow for users interacting with plan-related functionalities by providing immediate access to plan details and mode switching.

Highlights

  • New Slash Command Implementation: Implemented a new /plan slash command, enhancing user interaction with plan-related functionalities within the CLI.
  • Plan Mode Activation: The command allows users to switch their approval mode to 'plan', providing a dedicated state for plan review.
  • Latest Plan Display: It automatically identifies and displays the most recently generated plan (a markdown file) if one exists in the temporary plans directory.
  • Experimental Feature Handling: Includes a check to ensure 'Plan Mode' is enabled in user settings, providing an informative error message if the experimental feature is not activated.
  • Robust Plan Discovery: Handles scenarios where no plans are found or the temporary plan directory does not exist, providing appropriate feedback to the user.
  • Comprehensive Unit Testing: Added a new test file with a suite of unit tests for the planCommand, covering various functional and error-handling scenarios.
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.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a new /plan slash command, allowing users to switch to Plan Mode and view their latest generated plan. The implementation includes a new command file (planCommand.ts) and its corresponding test file (planCommand.test.ts), along with updates to BuiltinCommandLoader.ts to register the new command. A new policy file (plan.toml) has been added to define tool execution rules for Plan Mode, ensuring a secure deny-by-default approach with specific allowances for read-only operations and controlled writing to plan files. The test coverage for the new command is comprehensive, covering various scenarios including disabled mode, no plans, and error handling. The overall feature implementation is well-structured and robust. One high-severity issue was identified regarding the use of a synchronous file system operation, which should be replaced with an asynchronous alternative.

@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Jan 27, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 27, 2026

Size Change: +1.89 kB (+0.01%)

Total Size: 23.7 MB

Filename Size Change
./bundle/gemini.js 23.7 MB +1.89 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

@Adib234
Copy link
Copy Markdown
Contributor Author

Adib234 commented Jan 27, 2026

/gemini review

@Adib234 Adib234 marked this pull request as ready for review January 27, 2026 21:54
@Adib234 Adib234 requested review from a team as code owners January 27, 2026 21:54
Copy link
Copy Markdown
Contributor

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

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 the new /plan slash command, enabling users to switch to Plan Mode and view their latest generated plan. The implementation correctly handles various scenarios, such as when the feature is disabled or no plans are found. Comprehensive unit tests have been added, covering the core functionality and edge cases. My primary feedback concerns a discrepancy between the documentation's description of Plan Mode as 'read-only' and the policy configuration that permits specific write operations.

@Adib234 Adib234 force-pushed the adibakm/implement-plan-slash-command branch from d48ad42 to 0375044 Compare February 3, 2026 19:40
@Adib234 Adib234 force-pushed the adibakm/implement-plan-slash-command branch from 0375044 to b713344 Compare February 3, 2026 19:46
@Adib234 Adib234 enabled auto-merge February 3, 2026 21:43
@Adib234 Adib234 added this pull request to the merge queue Feb 4, 2026
Merged via the queue into main with commit 0012d95 Feb 4, 2026
26 checks passed
@Adib234 Adib234 deleted the adibakm/implement-plan-slash-command branch February 4, 2026 17:13
sidwan02 pushed a commit to sidwan02/gemini-cli-gemma that referenced this pull request Feb 6, 2026
kuishou68 pushed a commit to iOfficeAI/aioncli that referenced this pull request Feb 27, 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 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement /plan slash command

3 participants