Claude's Instructions for Using Gemini CLI Tool - angrysky56/gemini-cli-mcp-server GitHub Wiki

Claude's Instructions for Using Gemini CLI Tool

Core Principle

ALWAYS use the Gemini CLI tool when working with code projects, development tasks, or any situation where the Gemini CLI would be more appropriate than my base capabilities.

Available Gemini CLI Functions

1. gemini-cli:gemini_chat

  • Purpose: Start an interactive chat session with Gemini AI
  • When to use: For general development discussions, code reviews, architectural decisions
  • Best practices: Use this as the primary interface for complex development conversations

2. gemini-cli:gemini_analyze_code

  • Purpose: Analyze code in a directory using Gemini AI
  • When to use: When examining existing codebases, understanding project structure, code quality assessment
  • Parameters: Requires directory and query
  • Best practices: Always specify the exact directory path and clear, specific queries

3. gemini-cli:gemini_generate_app

  • Purpose: Generate a new application using Gemini AI
  • When to use: Creating new projects, prototypes, or complete applications from scratch
  • Parameters: Requires description and output_directory
  • Best practices: Provide detailed, comprehensive descriptions of the desired application

4. gemini-cli:gemini_code_assist

  • Purpose: Get AI assistance for specific code problems
  • When to use: Debugging, refactoring, optimizing specific files or functions
  • Parameters: Requires file_path and task
  • Best practices: Be specific about the task and provide exact file paths

5. gemini-cli:gemini_git_assist

  • Purpose: Get AI assistance with Git operations and analysis
  • When to use: Git workflow issues, repository analysis, commit message generation
  • Parameters: Requires repository_path and operation
  • Best practices: Specify the exact git operation needed

6. gemini-cli:gemini_list_models

  • Purpose: List available Gemini models from Google's API
  • When to use: To understand available model options for different tasks

Decision Framework: When to Use Which Tool

Use gemini_chat when:

  • Having general development discussions
  • Asking for architectural advice
  • Brainstorming solutions
  • Getting explanations of concepts

Use gemini_analyze_code when:

  • Need to understand an existing codebase
  • Performing code reviews
  • Analyzing project structure
  • Looking for patterns or issues in code

Use gemini_generate_app when:

  • Creating new projects from scratch
  • Building prototypes
  • Need complete application scaffolding
  • Want to bootstrap a new codebase

Use gemini_code_assist when:

  • Working on specific files
  • Need targeted debugging help
  • Refactoring particular functions
  • Optimizing specific code sections

Use gemini_git_assist when:

  • Managing git workflows
  • Analyzing repository history
  • Need help with git operations
  • Working with version control issues

Best Practices for Tool Usage

1. Always Start with Context

  • Use gemini_analyze_code first to understand the project structure
  • Establish the current state before making changes
  • Let Gemini CLI understand the codebase context

2. Be Specific with Paths

  • Always use absolute paths when possible
  • Verify directory structures before calling functions
  • Use the user's specified paths: /home/ty/Repositories/gemini-cli-workstation

3. Progressive Enhancement

  • Start with analysis, then move to specific assistance
  • Use the chat function for planning, then specific tools for implementation
  • Build understanding incrementally

4. Leverage the Tool's Strengths

  • The Gemini CLI has superior code understanding capabilities
  • It can handle large codebases and complex relationships
  • It's designed specifically for development workflows

5. Memory and Continuity

  • Use the tools consistently to maintain context
  • Remember that Gemini CLI can understand project-specific conventions
  • Build on previous analyses and conversations

Common Workflows

Project Analysis Workflow:

  1. gemini_list_models - Check available models
  2. gemini_analyze_code - Understand the project structure
  3. gemini_chat - Discuss findings and plan next steps
  4. gemini_code_assist - Work on specific issues

New Project Workflow:

  1. gemini_chat - Discuss requirements
  2. gemini_generate_app - Create the initial application
  3. gemini_analyze_code - Review generated code
  4. gemini_code_assist - Refine specific components

Bug Fixing Workflow:

  1. gemini_analyze_code - Understand the problem area
  2. gemini_code_assist - Focus on specific problematic files
  3. gemini_git_assist - Manage version control around fixes
  4. gemini_chat - Discuss solution approach

Error Handling

  • If a tool call fails, try a more specific or different approach
  • Always verify paths and parameters before calling
  • Use gemini_chat to clarify requirements if uncertain

Integration with Other Tools

  • Combine Gemini CLI tools with Desktop Commander for file operations
  • Use with MCP servers for extended functionality
  • Leverage alongside web search for current information

Remember

  • The Gemini CLI tool is specifically designed for development tasks
  • It has superior code understanding compared to my base capabilities
  • Always prefer the specialized tool over general approaches
  • The user expects me to use these tools, not work around them
  • The tools are installed, configured, and ready to use effectively