Skip to content

feat(webui): add /web slash command with browser-based chat GUI#24369

Closed
TIPC1110 wants to merge 13 commits intogoogle-gemini:mainfrom
TIPC1110:feat/web-gui
Closed

feat(webui): add /web slash command with browser-based chat GUI#24369
TIPC1110 wants to merge 13 commits intogoogle-gemini:mainfrom
TIPC1110:feat/web-gui

Conversation

@TIPC1110
Copy link
Copy Markdown

@TIPC1110 TIPC1110 commented Mar 31, 2026

Add a new @google/gemini-cli-webui package that provides a Material You web dashboard served on localhost:11267. The /web command in the CLI launches the server and opens the browser.

Features:

  • SSE-streamed chat with the configured Gemini model
  • Model picker with auto/pro/flash/flash-lite tiers and thinking badges
  • @-mention file attachment with fuzzy search
  • File creation via __FILE: syntax with approve/decline/session approval flow
  • Context token usage tracking panel
  • Collapsible thinking blocks and tool-call cards
  • CLI session resume — browse and load saved conversations
  • Slash commands: /model, /clear, /resume, /stats, /tools, /memory, /init, /theme, /copy, /about, /docs, /compress, /corgi, /help
  • Directory picker for workspace switching
  • 4 themes: dark, light, ocean, forest (Material Design 3 tokens)
  • Responsive layout: desktop sidebar, tablet, mobile bottom-sheet
  • Session delete with confirmation dialog
  • Security: localhost-only binding, path traversal prevention, CORS restricted

Architecture:

  • packages/webui/src/server.ts — HTTP server, HTML template, route dispatch
  • packages/webui/src/api.ts — API handlers (chat, commands, files, models, sessions)
  • packages/webui/src/client.ts — Browser JS as template literal (ES5 compat)
  • packages/webui/src/styles.ts — CSS with MD3 design tokens
  • packages/webui/src/tokens.ts — Material Design 3 color schemes
  • packages/webui/src/icons.ts — SVG icon helpers
  • packages/cli/src/ui/commands/webCommand.ts — thin bridge to SlashCommand

Docs: docs/cli/web-gui.md

Summary

Details

Related Issues

How to Validate

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

Add a new `@google/gemini-cli-webui` package that provides a Material You
web dashboard served on localhost:11267. The `/web` command in the CLI
launches the server and opens the browser.

Features:
- SSE-streamed chat with the configured Gemini model
- Model picker with auto/pro/flash/flash-lite tiers and thinking badges
- @-mention file attachment with fuzzy search
- File creation via __FILE: syntax with approve/decline/session approval flow
- Context token usage tracking panel
- Collapsible thinking blocks and tool-call cards
- CLI session resume — browse and load saved conversations
- Slash commands: /model, /clear, /resume, /stats, /tools, /memory, /init,
  /theme, /copy, /about, /docs, /compress, /corgi, /help
- Directory picker for workspace switching
- 4 themes: dark, light, ocean, forest (Material Design 3 tokens)
- Responsive layout: desktop sidebar, tablet, mobile bottom-sheet
- Session delete with confirmation dialog
- Security: localhost-only binding, path traversal prevention, CORS restricted

Architecture:
- packages/webui/src/server.ts — HTTP server, HTML template, route dispatch
- packages/webui/src/api.ts — API handlers (chat, commands, files, models, sessions)
- packages/webui/src/client.ts — Browser JS as template literal (ES5 compat)
- packages/webui/src/styles.ts — CSS with MD3 design tokens
- packages/webui/src/tokens.ts — Material Design 3 color schemes
- packages/webui/src/icons.ts — SVG icon helpers
- packages/cli/src/ui/commands/webCommand.ts — thin bridge to SlashCommand

Docs: docs/cli/web-gui.md

Signed-off-by: TIPC1110 <tienichpc1110@gmail.com>
@TIPC1110 TIPC1110 requested review from a team as code owners March 31, 2026 20:29
@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 31, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 browser-based chat interface for the Gemini CLI, significantly enhancing the user experience by providing a visual dashboard. The new web GUI allows users to interact with Gemini models, manage project files, and track session context in a modern, responsive environment while maintaining the existing authentication and configuration of the CLI.

Highlights

  • New Web GUI Package: Introduced a new @google/gemini-cli-webui package that provides a Material You web dashboard served on localhost:11267.
  • Slash Command Integration: Added a new /web slash command to the CLI, which serves as a bridge to launch the web server and open the browser-based chat interface.
  • Feature-Rich Dashboard: The web GUI includes SSE-streamed chat, model selection, @-mention file attachments, file creation with approval flows, context token tracking, and session management.
  • Responsive Design & Theming: Implemented a responsive layout supporting desktop, tablet, and mobile, along with four built-in Material Design 3 themes (dark, light, ocean, forest).
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.

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

This pull request introduces a new web-based GUI for the Gemini CLI, allowing users to interact with the AI assistant through a browser-based interface served locally. The changes include the addition of a new package @google/gemini-cli-webui, a new /web slash command in the CLI, and the necessary server and client-side logic to support chat streaming, file operations, and model selection. My review identified several critical and high-severity security vulnerabilities related to Cross-Site Scripting (XSS) in the client-side rendering logic and potential path traversal issues in the API handlers. Additionally, I have provided feedback on improving the efficiency and workspace awareness of the file search functionality and suggested propagating AbortSignals for better resource management during chat streaming.

TIPC1110 and others added 6 commits April 1, 2026 03:39
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Replace all inline onclick handlers containing user-controlled data
  (file paths, session IDs) with data-* attributes wired via
  addEventListener/event delegation to eliminate XSS vectors flagged
  by Gemini Code Assist review
- Add escJsHtml() helper that HTML-encodes after JS-escaping for
  contexts where an attribute value holds a JS string literal
- Use fs.realpath() in handleFileRead, handleFileWrite, handleFileOpen
  before the startsWith prefix check to prevent symlink-based path
  traversal (CVE class: symlink escape)
- Make handleFileSearch workspace-aware: accept optional cwd from
  request body so @ mentions respect the directory selected in the UI
- Use path.sep instead of hardcoded '/' in file search scoring for
  cross-platform correctness (Windows backslash paths)

Signed-off-by: TIPC1110 <tienichpc1110@gmail.com>
Copy link
Copy Markdown
Author

@TIPC1110 TIPC1110 left a comment

Choose a reason for hiding this comment

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

feat(webui): add /web slash command with browser-based chat GUI

TIPC1110 and others added 2 commits April 1, 2026 03:46
The function is no longer called after makeSI was refactored to use
data-* attributes and addEventListener.

Signed-off-by: TIPC1110 <tienichpc1110@gmail.com>
@gemini-cli gemini-cli bot added the priority/p1 Important and should be addressed in the near term. label Mar 31, 2026
Copy link
Copy Markdown
Author

@TIPC1110 TIPC1110 left a comment

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Author

@TIPC1110 TIPC1110 left a comment

Choose a reason for hiding this comment

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

test

- Add /web command example to README quick examples
- Document Web GUI in Advanced Capabilities section
- Add v0.36.0 changelog entry for Web GUI feature

This update documents the new browser-based chat interface
that provides Material You design, model picker, file attachments,
and session management at localhost:11267.
@TIPC1110
Copy link
Copy Markdown
Author

TIPC1110 commented Apr 5, 2026

Hi @google-gemini/gemini-cli-maintainers! 👋

I wanted to follow up on this PR that introduces a Web GUI for Gemini CLI with a browser-based chat interface.

Summary

This PR adds a /web command that launches a Material You web dashboard at localhost:11267 with:

  • SSE-streamed chat with the configured Gemini model
  • Model picker, @-mention file attachments, file creation with approval flow
  • Session management, 4 built-in themes, responsive design
  • Security: localhost-only binding, path traversal prevention, CORS restricted

Status

✅ All automated reviews completed (gemini-code-assist)
✅ Security issues addressed (XSS, path traversal - commit 9493b71)
✅ Documentation added (README + changelog - commit f3a070510)
⏳ Waiting for code owner review and CI workflow approval

Testing

The web GUI has been tested locally and provides a smooth browser-based alternative to the terminal UI while reusing the same authentication and configuration.

Could you please review when you have a chance? Happy to make any needed changes! 🙏

/cc @google-gemini/gemini-cli-askmode-approvers @google-gemini/gemini-cli-docs

@jackwotherspoon
Copy link
Copy Markdown
Collaborator

Hi @TIPC1110 👋

Thanks for the PR! The /web command looks very cool. Unfortunately our contribution guidelines require an issue be created first and discussed before PRs are to be created. This allows us to make sure everyone can weigh in on new features and align on approach and direction.

Going to have to close this PR as it does not have a linked issue and is for a large feature that has not been approved or discussed. Please file an issue for the feature request and then folks can chat about whether this is a feature we want to support in the near term. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants