Configuring context sharing with .aiexclude files | Android Studio
When opting to share your project context with Gemini in Android Studio, you have the ability to specify which files from the codebase are shared by utilizing .aiexclude
files. It's important to note that AI features in Android Studio are limited to accessing files within the current project and its associated version control roots. By strategically placing .aiexclude
files within the project and VCS roots, you can effectively control which files AI features have permission to access.
Similar to a .gitignore
file, an .aiexclude
file serves the purpose of tracking files that should not be shared with Gemini in Android Studio. This includes elements such as the chat experience and various AI features like intention actions and code completion. The scope of an .aiexclude
file encompasses files at or below the directory where it is located.
![Gemini in Android Studio](https://developer.android.com/static/images/gemini-in-android/gemini-promo-3.jpg)
An .aiexclude
file adheres to the same syntax as a .gitignore
file. Below are some example configurations of .aiexclude
files:
It's important to remember that the content and code snippets on this page are governed by the licenses outlined in the Content License. Additionally, Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. This information was last updated on 2024-07-10 UTC.