Use Gemini CLI with massive context window to analyze entire codebases, verify implementations, and understand project-wide patterns when context limits are exceeded.
Use the Gemini CLI with its massive context window to analyze large codebases or multiple files that exceed typical context limits. Leverage `gemini -p` to tap into Google Gemini's large context capacity.
Use `gemini -p` when:
Use the `@` syntax to include files and directories in your Gemini prompts. Paths should be relative to your current working directory when invoking the `gemini` command.
```bash
gemini -p "@src/main.py Explain this file's purpose and structure"
```
```bash
gemini -p "@package.json @src/index.js Analyze the dependencies used in the code"
```
```bash
gemini -p "@src/ Summarize the architecture of this codebase"
```
```bash
gemini -p "@src/ @tests/ Analyze test coverage for the source code"
```
```bash
gemini -p "@./ Give me an overview of this entire project"
```
```bash
gemini --all_files -p "Analyze the project structure and dependencies"
```
```bash
gemini -p "@src/ @lib/ Has dark mode been implemented in this codebase? Show me the relevant files and functions"
```
```bash
gemini -p "@src/ @middleware/ Is JWT authentication implemented? List all auth-related endpoints and middleware"
```
```bash
gemini -p "@src/ Are there any React hooks that handle WebSocket connections? List them with file paths"
```
```bash
gemini -p "@src/ @api/ Is proper error handling implemented for all API endpoints? Show examples of try-catch blocks"
```
```bash
gemini -p "@backend/ @middleware/ Is rate limiting implemented for the API? Show the implementation details"
```
```bash
gemini -p "@src/ @lib/ @services/ Is Redis caching implemented? List all cache-related functions and their usage"
```
```bash
gemini -p "@src/ @api/ Are SQL injection protections implemented? Show how user inputs are sanitized"
```
```bash
gemini -p "@src/payment/ @tests/ Is the payment processing module fully tested? List all test cases"
```
1. When a user requests codebase analysis that involves multiple directories or large file sets, recommend using the Gemini CLI
2. Construct `gemini -p` commands using the `@` syntax to include relevant files and directories
3. Use the Bash tool to execute the gemini command (no `--yolo` flag needed for read-only analysis)
4. For implementation verification queries, craft specific questions that ask Gemini to locate and describe relevant code patterns
5. If the user's working directory is unclear, ask them to confirm the project root before constructing file paths
6. When results are returned, summarize key findings for the user
1. User asks: "Is authentication implemented in this project?"
2. Agent responds: "I'll use Gemini CLI to analyze your codebase for authentication patterns."
3. Agent runs: `gemini -p "@src/ @middleware/ @api/ Is authentication implemented? List all auth-related files, middleware, and endpoints with their authentication methods"`
4. Agent summarizes Gemini's findings, providing file paths and relevant code snippets
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/gemini-cli-for-large-codebase-analysis/raw