File management with Gemini CLI
Explore, analyze, and modify your codebase using Gemini CLI. In this guide, you’ll learn how to provide Gemini CLI with files and directories, modify and create files, and control what Gemini CLI can see.
Prerequisites
Section titled “Prerequisites”- Gemini CLI installed and authenticated.
- A project directory to work with (for example, a git repository).
Providing context by reading files
Section titled “Providing context by reading files”Gemini CLI will generally try to read relevant files, sometimes prompting you for access (depending on your settings). To ensure that Gemini CLI uses a file, you can also include it directly.
Direct file inclusion (@)
Section titled “Direct file inclusion (@)”If you know the path to the file you want to work on, use the @ symbol. This
forces the CLI to read the file immediately and inject its content into your
prompt.
`@src/components/UserProfile.tsx Explain how this component handles user data.`