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

Use a more general `.md` file to guide agents

Open steren opened this issue 1 year ago • 12 comments

Description of the feature request:

We support GEMINI.md, but the guidance in this file can be used by any agent, not only Gemini.

So I suggest using a more generic AGENTS.md filename instead.

Potentially, both could be supported, and we should then decide if it's an override or a complement.

If an override, the order of selection could be:

  1. GEMINI.md
  2. AGENTS.md

I.e. GEMINI.md could take precedence if present

If it's a complement, then GEMINI.md can just be appended to AGENTS.md when using Gemini CLI

What problem are you trying to solve with this feature?

No response

Any other information you'd like to share?

No response

steren avatar May 17 '25 20:05 steren

CC @ptone

steren avatar May 17 '25 20:05 steren

I do like the override aspect you detail here

NTaylorMullen avatar May 18 '25 03:05 NTaylorMullen

i'd probably start with override-only, because complement brings up questions around ordering, and another more general way to achieve that is to introduce some basic include/import syntax so one could include AGENTS.md in GEMINI.md wherever they like, or have both include a common base, etc

olcan avatar May 18 '25 15:05 olcan

We're going to introduce a setting to allow the user to name the file they want to use. We'll still use GEMINI.md by default, but if the user specifies AGENTS.md in their settings we'll use that instead.

I'm still not convinced that all models need the same instructions. We have some cases where we've added instructions in our own project files that are really unique to the way Gemini works. I don't know what quirks people have tried to work around in their other config files, nor do I know how those workarounds will be interpreted by Gemini.

Because of this, and because we are entering a market where there are other tools out there already I assume that we will be operating in environments that already have 1 or 2 instruction files available. I'd like our users to get the best impression of the tool and Gemini on our first run experience and I think slurping in a bunch of instructions for other models can detract from that experience.

In addition to this, we auto-write to the GEMINI.md file when the model wants to remember something specific about you. I'm less comfortable auto-writing to another file that is used by other models.

So rather than auto-detect and merge, or strictly prioritize we are going to use GEMINI.md by default. If the user wishes to use a different file they can set that in .gemini/settings.json and we'll use that filename instead. That new name will be used throughout the entire scope of the settings.json.

allenhutchison avatar May 31 '25 13:05 allenhutchison

AGENTS.md is seeing some standardization / community alignment.

I suggest we re-open this issue.

Gemini CLI should look by default for any of AGENTS.md or GEMINI.md

steren avatar Aug 20 '25 05:08 steren

We now have the ability to set the context file in settings (contextFileName), so if you want AGENTS.md you can make that the default for your installation. We also support @ imports in agent files so your GEMINI.md can import your AGENTS.md if you prefer. I think that puts us in a pretty good spot.

Further, the AGENTS.md standard that you point at, doesn't seem to support all of the features that we support in GEMINI.md (in particular @ imports) so tying ourselves to this syntax would limit our ability to continue to iterate in this space.

https://github.com/google-gemini/gemini-cli/blob/main/docs/core/memport.md

https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md#available-settings-in-settingsjson

allenhutchison avatar Aug 20 '25 19:08 allenhutchison

Personally, I feel like the feature request described here (AGENTS.md is ignored/overridden if GEMINI.md is present) is preferable to the settings approach you have now.

Currently there is just additional friction for me to use Gemini.

sethherr avatar Aug 28 '25 19:08 sethherr

Same, Gemini in Android Studio will be respecting AGENTS.md - https://issuetracker.google.com/issues/441820185

eygraber avatar Aug 31 '25 16:08 eygraber

https://github.com/google-gemini/gemini-cli/issues/12345 is discussing adding AGENTS.md as a second default option.

allenhutchison avatar Oct 31 '25 16:10 allenhutchison

+1 for @steren suggestion. AGENTS.md should be automatic! :-)

wagnerpatriota avatar Dec 29 '25 00:12 wagnerpatriota

Gemini CLI now supports Agent Skills. Can we now have it also support AGENTS.md by default?

steren avatar Jan 07 '26 21:01 steren

Closing as duplicate of https://github.com/google-gemini/gemini-cli/issues/12345

cocosheng-g avatar Apr 09 '26 14:04 cocosheng-g