Repository navigation
Conversation
…w `/map` command with Gemini streaming integration.
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 significantly enhances the CLI's capabilities by introducing a new command that enables Gemini to automatically generate architectural diagrams of a project. It achieves this by integrating a powerful new backend tool for project structure analysis and by extending the core system to allow dynamic control over the model's persona and tool access during specific interactions. This feature aims to improve developer experience by providing quick, visual insights into codebase organization. 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 new /map command and a corresponding map_project_structure tool to generate architecture diagrams. The implementation involves changes across the CLI and core packages to support per-turn system prompt extensions and tool restrictions. My review focuses on the new tool's implementation in packages/core/src/tools/map-tool.ts, where I've identified a critical issue that could lead to a runtime crash and a high-severity issue related to unsafe type assertions when parsing package.json.
…es, workspaces, entry points, and key file imports.
…gemini-cli into feat/architecture-map
|
/gemini review |
|
@gemini-cli-robot already fixed accoding to yolur review suggestion. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new /map command and its backend tool map_project_structure to generate project architecture diagrams. While the feature is useful, the security audit identified two high-severity vulnerabilities: the infrastructure for restricting tools and extending system prompts for slash commands is flawed, potentially leading to privilege escalation in multi-turn conversations, and the MapTool implementation lacks proper symlink validation, which could allow reading sensitive files outside the workspace. Furthermore, the PR contains several code quality issues, including unresolved merge conflict markers, an accidentally committed TypeScript error log file, and an incorrect error type used by the new map tool. All identified issues must be addressed before merging.
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>
…gemini-cli into feat/architecture-map
…overing rendering, navigation, and setting interactions.
|
@gemini-code-assist already fixed as per your suggestion. |
|
Thank you for letting me know. I appreciate you addressing the suggestions. I will take these updates into account during the next review cycle. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new /map command to generate a Mermaid.js architecture diagram of the project, which is a great developer experience improvement. The implementation is well-structured, adding a new map_project_structure tool in the core package and the corresponding command in the CLI. The changes to plumb through systemPromptExtension and tools from slash commands to the GeminiClient are handled correctly, including the crucial logic to reset this state after the turn. I have one suggestion to improve the robustness of import parsing in the new tool to provide more accurate diagrams. Overall, this is a solid feature addition.
|
@gemini-code-assist is it ok completely |
|
Hi @Devnil434, thanks for checking in! I've performed a fresh review of the pull request, taking into account the recent changes. The overall implementation of the
Addressing these points would further improve the quality of the pull request. Let me know if you have any questions! |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
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! |
Summary
Adds a new
/mapbuilt-in command that lets Gemini analyze the current workspace and generate a Mermaid.js architecture diagram directly in the terminal. The command uses a new backend tool (map_project_structure) to scan project files, detect entry points, and sample import relationships.Details
map_project_structure) inpackages/core/src/tools/map-tool.ts.ts/jsfiles usingglob, respects.gitignore/.geminiignore, and readspackage.jsonfor dependencies and workspaces.index|main|cli|bin) and extracts import samples to build a dependency overview.scanDirectory,dependencies,workspaces,entryPoints,keyFileImports) for Gemini to synthesize into a Mermaid diagram./mapcommand (autoExecute: true) that runs a guided prompt instructing Gemini to act as an Architecture Cartographer.map_project_structurefor safety.coreTools.tsandconfig.ts, and loads command viaBuiltinCommandLoader.ts.Related Issues
Related to developer experience improvements for exploring repository architecture.
How to Validate
Start the CLI:
Run:
Pre-Merge Checklist
closes #21080