Introduce and use a standard for ai agent ignore file
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.
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).
I don't see any reference to the suggested flag in the source code. From the looks of it, .geminiignore is hard coded.
Found possible duplicate issues:
- #4970: (#0.9149697372299292)
Ah. You're right. I was thinking of the contextFileName settings but that controls context files, not ignore files.
Hi @ttk thanks for filing this issue. We will continue to monitor this issue for added interest.
+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.
Consider this related proposal: https://github.com/google-gemini/gemini-cli/issues/7439
I prefer the core file convention:
- instruction: AGENTS.md
- ignore: .gitignore & .agentignore
It seems that gemini already decided for aiexclude:
https://docs.cloud.google.com/gemini/docs/codeassist/create-aiexclude-file