Skip to content

Conversation

@StoyanD
Copy link
Contributor

@StoyanD StoyanD commented Dec 11, 2025

Summary

Implements desktop notifications for permissions, should ease multitasking when
using gemini-cli

Details

Fixes #14696

This PR implements OS-level desktop notifications when the Gemini CLI pauses and
requires user confirmation or input. This significantly improves the user
experience by alerting users immediately when their input is needed, even if
they are focused on another application. Clicking the notification will bring
the terminal into focus, allowing for quick interaction.

Notification demo video:

policy-notification-promt.mp4

Settings toggle:
Screenshot 2025-12-10 at 7 59 03 PM

Related Issues

Related to #14696

How to Validate

Request a policy ask required permission in Xterm/VScode terminal, and move to
another screen causing focus to switch. Should see a notification that when
clicked takes you back to the terminal

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

…ompts

This commit introduces desktop notifications to alert users when the Gemini CLI
requires their permission to execute a command, especially when the CLI
application is not in focus.

Key changes include:
- Added  setting to control notification behavior.
- Integrated  for cross-platform desktop notifications.
- Implemented  React hook to manage notification logic,
  considering application focus, operating system, and terminal program for
  proper activation on macOS.
- Included an icon asset for notifications.
Ensures that the desktop notification for user permission prompts is displayed
only once per confirmation event. Toggling application focus while waiting for
confirmation will no longer trigger repeated notifications.

- Added `useRef` to track notification state.
- Updated `useNotification` hook to reset state only when confirmation is no longer pending.
- Added regression tests for duplicate notification scenarios.
@StoyanD StoyanD requested review from a team as code owners December 11, 2025 01:49
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @StoyanD, 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 user experience of the Gemini CLI by integrating desktop notifications. When the CLI requires user confirmation or input, and the application is not in focus, a system-level notification will now be triggered. This feature aims to improve multitasking efficiency by providing immediate alerts, with the added benefit on macOS of bringing the terminal back into focus upon clicking the notification. The functionality is controlled by a new "ui.enableNotifications" setting, allowing users to opt-in.

Highlights

  • Desktop Notifications: Implemented OS-level desktop notifications for user permission prompts in the Gemini CLI.
  • User Experience Improvement: Notifications alert users when input is needed, even when multitasking, and can bring the terminal into focus on click (macOS).
  • Configurable Setting: A new "ui.enableNotifications" boolean setting has been added, defaulting to "false", allowing users to enable or disable this feature.
  • New Hook & Dependencies: Introduced a "useNotification" React hook and added "node-notifier" and its related dependencies to handle cross-platform notifications.
  • Documentation & Schema Updates: The new setting is documented in "configuration.md" and defined in "settingsSchema.ts" and "settings.schema.json".
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
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 desktop notifications for user permission prompts, which is a great enhancement for user experience, especially when multitasking. The implementation is solid, leveraging node-notifier and a new React hook useNotification. The logic correctly handles different states, platform specifics for macOS, and terminals with poor focus detection support. The addition of comprehensive unit tests for the new hook is commendable and ensures the feature is robust. The configuration options are well-documented and integrated into the settings schema. Overall, this is a high-quality contribution, and I have no high or critical concerns.

@StoyanD
Copy link
Contributor Author

StoyanD commented Dec 11, 2025

@Alexmarco-gif can i get a review?

@nahid6970
Copy link

why anyone not reviewing i would love to havethis feature in windows

@StoyanD
Copy link
Contributor Author

StoyanD commented Dec 21, 2025

@nahid6970 do u have a windows machine? if so can you test this branch out to see if it works( im pretty sure it should)

@nahid6970
Copy link

@StoyanD how to test it in windows? i dont see anything related to notification in windows latest version of gemini

@StoyanD
Copy link
Contributor Author

StoyanD commented Dec 27, 2025

@nahid6970 you'd have to install this branch locally on a windows machine and test. The notification library I'm using is cross platform, so it should work. The way I've tested is using a command to create a file, then opening another app before the cli asks for permission. When the cli app asks for permission it's already backgrounded so it shows a notification

@samyarkd
Copy link

samyarkd commented Jan 2, 2026

This will be a big improvement to the user experience. I'm waiting for this.

@anowardear062-svg
Copy link

Thanks

@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality labels Jan 7, 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 priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Desktop Notification for User Permission Prompts

4 participants