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

Introduce and use a standard for ai agent ignore file

Open ttk opened this issue 5 months ago • 9 comments

What would you like to be added?

Add support for .aiignore as an alias of the .geminiignore file, and make .aiignore an industry wide standard by encouraging its use.

Why is this needed?

Currently the industry has introduced several file names for the agent specific ignore file:

.geminiignore .cursorignore .codeiumignore .aiexclude .aiignore

I think all of them follow the same syntax as the .gitignore file.

There a lot of developers and teams using different code agents for their development. Having different files that specify the same ignore rules is problematic because it makes it more error prone to keep these files in sync, and it also pollutes the root directory of the project with basically redundant information. Standardizing on a common file name would also make it more secure by making it less likely to leak secrets when switching agents.

Why .aiignore? It's generic (ai), and similar naming to the .gitignore file.

Additional context

Jetbrain's AI Assistant already supports .aiignore, so there is already some precedence for its use.

ttk avatar Jul 22 '25 21:07 ttk

FYI, There is a flag to set the name of the ignore file it looks for so you don't have to use multiple files (at least, not on our account).

scidomino avatar Jul 22 '25 22:07 scidomino

I don't see any reference to the suggested flag in the source code. From the looks of it, .geminiignore is hard coded.

ttk avatar Jul 22 '25 23:07 ttk

Found possible duplicate issues:

  • #4970: (#0.9149697372299292)

gsquared94 avatar Jul 29 '25 23:07 gsquared94

Ah. You're right. I was thinking of the contextFileName settings but that controls context files, not ignore files.

scidomino avatar Jul 30 '25 21:07 scidomino

Hi @ttk thanks for filing this issue. We will continue to monitor this issue for added interest.

adamfweidman avatar Aug 22 '25 15:08 adamfweidman

+1 , for standardizing aither through .aiiignore or [.agentignore]( https://github.com/tourcoder/agentignore} instead the has been a initiative from openAI side trough agents.md to standardize agentic tools, i feel gemini cli too should adopt the standards and lead the initiative. its a win-win for everyone. BYB, Here is a proposal on the Agents.md side to extends the agents.md specification to define stardards related to ignore files.

sanathusk avatar Aug 29 '25 09:08 sanathusk

Consider this related proposal: https://github.com/google-gemini/gemini-cli/issues/7439

scidomino avatar Aug 29 '25 22:08 scidomino

I prefer the core file convention:

  • instruction: AGENTS.md
  • ignore: .gitignore & .agentignore

vaclavpavek avatar Nov 26 '25 10:11 vaclavpavek

It seems that gemini already decided for aiexclude:

https://docs.cloud.google.com/gemini/docs/codeassist/create-aiexclude-file

rafitadiaz avatar Dec 05 '25 13:12 rafitadiaz