Skip to content

Conversation

terrydkim
Copy link
Contributor

@terrydkim terrydkim commented Oct 4, 2025

Fixes #7414

TLDR

Eliminates all duplicate .gemini directory definitions across the codebase by consolidating to a single source: GEMINI_DIR from packages/core/src/utils/paths.ts.

What changed:

  • Removed aliases: SETTINGS_DIRECTORY_NAME, GEMINI_CONFIG_DIR
  • Replaced hardcoded '.gemini' strings with GEMINI_DIR import

Dive Deeper

  1. Urgency: Without this consolidation, new code will continue introducing hardcoded .gemini strings and creating new aliases, making the technical debt worse. This PR establishes the pattern going forward.

  2. Files affected:

    • Scripts: telemetry, build utilities
    • Core: storage utilities, path handling
    • CLI: MCP configuration, shell history
    • Tests: mock definitions across both packages
  3. Zero functional changes - pure refactoring for maintainability.

Reviewer Test Plan

Run full test suite: npm test — all green on macOS

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

(Tested on macOS with npm run - all tests pass)

Linked issues / bugs

Fixes #7414

@terrydkim terrydkim requested a review from a team as a code owner October 4, 2025 15:25
Copy link
Contributor

Summary of Changes

Hello @terrydkim, 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 is a significant refactoring effort aimed at enhancing the maintainability and consistency of the codebase. It centralizes the definition of the .gemini configuration directory into a single, reusable constant. By replacing hardcoded strings and disparate aliases with a unified GEMINI_DIR constant, the change prevents future technical debt and simplifies path management across various components, including core utilities, CLI configurations, and test setups. The refactoring ensures that all parts of the application refer to the .gemini directory in a standardized manner, without altering any existing functionality.

Highlights

  • Centralized '.gemini' directory definition: All instances of the '.gemini' directory name across the codebase have been consolidated into a single GEMINI_DIR constant, imported from packages/core/src/utils/paths.ts.
  • Removed duplicate aliases: Existing aliases such as SETTINGS_DIRECTORY_NAME and GEMINI_CONFIG_DIR have been eliminated, streamlining directory path management.
  • Pure refactoring: This pull request introduces zero functional changes, focusing solely on improving code maintainability and establishing a consistent pattern for future development.
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 effectively consolidates all definitions of the '.gemini' directory into a single GEMINI_DIR constant, sourced from packages/core/src/utils/paths.ts. The refactoring is thorough, touching application logic, test files, and utility scripts, which successfully eliminates duplicate definitions and hardcoded strings. This is a valuable improvement for code maintainability. After a detailed review of all changes, I found them to be correct and consistent with the stated goal. There are no high or critical issues to report.

@terrydkim terrydkim force-pushed the chore/gemini-dir-constant branch from 6735a88 to 794b17c Compare October 8, 2025 10:14
Copy link
Member

@richieforeman richieforeman left a comment

Choose a reason for hiding this comment

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

Thanks Terry! Appreciate your assistance in our quest to pay down some technical debt :). This is really appreciated.

LGTM!

@richieforeman richieforeman added this pull request to the merge queue Oct 13, 2025
Merged via the queue into google-gemini:main with commit 518caae Oct 13, 2025
19 checks passed
thacio added a commit to thacio/auditaria that referenced this pull request Oct 13, 2025
hminooei pushed a commit that referenced this pull request Oct 14, 2025
akhil29 pushed a commit to akhil29/gemini-cli that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coalesce all .gemini variables around paths.js:GEMINI_DIR

3 participants