gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Consistent configuration design for environment variables

Open fuzmish opened this issue 1 year ago • 3 comments

What would you like to be added?

Related: #3468

We should comprehensively redesign the environment variables (or, whole the settings) for configuring gemini-cli to provide consistency. As an example, I'll demonstrate the approach based on the currently existing configurations.

  • contextFileName
    • [settings.json]: The property contextFileName
    • The environment variable GEMINI_CLI_CONTEXT_FILE_NAME
    • The CLI option --contextFileName
  • bugCommand.urlTemplate
    • [settings.json]: The property bugCommand.urlTemplate
    • The environment variable GEMINI_CLI_BUG_COMMAND_URL_TEMPLATE
      • (Discussion) For configuration items that take objects, having environment variables accept JSON objects directly (GEMINI_CLI_BUG_COMMAND='{"urlTemplate":"..."}') would be easier to implement, but the user experience would be slightly degraded.
    • The CLI option --bugCommand='{"urlTemplate":"..."}'
      • (Discussion) For CLI options, it might be better to provide the most generalized option like --settings='{"contextFileName":"...", ...}' and then provide individual options like --model for settings deemed to be frequently used.
  • and more...

Why is this needed?

Currently, the design of gemini-cli configuration lacks consistency.

  • The naming conventions are inconsistent.
    • For example, it would be good to have a prefix like GEMINI_CLI_ for environment variables as described above.
  • Some settings can only be configured via environment variables (#3468), and other settings can only be configured via settings.json or command-line arguments.
    • It would be better to allow the configuration from anywhere.

Additional context

No response

fuzmish avatar Jul 07 '25 18:07 fuzmish

+1 to consistency

jackwotherspoon avatar Jul 07 '25 18:07 jackwotherspoon

Found possible duplicate issues:

  • #3468: (#0.9213629318096017)
  • #4613: (#0.903864324092865)

gsquared94 avatar Jul 30 '25 04:07 gsquared94

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 03 '25 21:12 gemini-cli[bot]