project
Project Command¶
The project
command analyzes local project code using Google's Gemini AI to provide insights, context, and answers about your codebase directly from the terminal.
Syntax¶
Arguments¶
Argument | Description | Required | Example |
---|---|---|---|
PROJECT_PATH |
Path to the project directory | Yes | ./ or /path/to/project |
QUERY |
The question or analysis request about the project | Yes | "Explain the main components" |
Options¶
Option | Description | Default | Example |
---|---|---|---|
--model |
The Gemini model to use | gemini-1.5-pro |
--model gemini-2.0-pro-exp |
--max-files |
Maximum number of files to include in analysis | 30 |
--max-files 50 |
--ignore |
Patterns to ignore (comma-separated) | .git,node_modules,dist |
--ignore "build,*.log" |
--format |
Output format (plain, markdown, json, rich) | rich |
--format markdown |
--debug/--no-debug |
Enable/disable debug output | --no-debug |
--debug |
--help |
Show command help | - | --help |
Configuration¶
Before using the project
command, you need to set up your Google Gemini API key:
You can obtain an API key from Google AI Studio.
Examples¶
Basic Usage¶
Analyze the current project:
Analyze a specific project directory:
Using Different Models¶
Use a specific model for more complex analysis:
Limiting Analysis Scope¶
Limit the number of files analyzed:
Ignore specific paths or patterns:
Output Formats¶
Save analysis results as markdown:
Get structured JSON output:
Debug Mode¶
Enable debug output for troubleshooting:
Use Cases¶
Code Understanding¶
-
Get a high-level overview of an unfamiliar codebase:
-
Understand specific parts of a codebase:
-
Analyze data flow:
Architecture Analysis¶
-
Identify architectural patterns:
-
Analyze dependency structure:
-
Review system architecture:
Code Quality and Improvements¶
-
Identify potential issues:
-
Suggest improvements:
-
Review security:
Documentation¶
-
Generate documentation:
-
Create architecture diagrams:
-
Document workflows:
Advanced Techniques¶
Focused Analysis¶
Focus on specific directories or components:
# Analyze just the backend code
cursor-utils project ./backend "Explain the database schema and relationships"
# Focus on a specific feature
cursor-utils project ./src/features/authentication "Review the authentication implementation"
Comparative Analysis¶
Compare different parts of the codebase:
Sequential Analysis¶
Build up understanding through sequential queries:
# Start with high-level overview
cursor-utils project . "Provide an overview of the main components"
# Then dig deeper into specific areas
cursor-utils project . "Explain the data access layer in detail"
cursor-utils project . "How is caching implemented in the data access layer?"
Integration with Development Workflow¶
Use during code reviews:
Use for onboarding:
Best Practices¶
-
Start with Broad Questions: Get a high-level overview before diving into details
-
Be Specific with Follow-ups: Ask targeted questions for deeper understanding
-
Limit Scope When Necessary: For large projects, focus on specific areas
-
Use for Documentation: Generate documentation as you explore the codebase
-
Combine with Manual Review: Use AI analysis as a complement to manual code review
-
Save Analysis Results: Preserve insights for future reference
Performance Considerations¶
Large Codebases¶
For large codebases, consider:
-
Increasing max-files limit for broader coverage:
-
Focusing on specific directories for targeted analysis:
-
Using ignore patterns to exclude irrelevant files:
Troubleshooting¶
API Key Issues¶
If you receive authentication errors:
Verify your API key is correctly set:
If it's missing or incorrect, set it:
Project Path Issues¶
If the project path is not found:
Verify the path exists and is accessible:
Context Size Limitations¶
If you receive an error about context size:
Try reducing the number of files analyzed:
Or focus on a specific subdirectory:
Vague or Confusing Results¶
If the analysis results are vague or confusing:
- Try being more specific with your query
- Use debug mode to see what files are being analyzed:
- Adjust the ignore patterns to focus on relevant files