Welcome to the Gemini CLI integration guide. This guide will help you connect ByteRover with Gemini CLI, providing Google’s AI with persistent memory of your coding patterns and solutions.

What You’ll Need

  • Gemini CLI installed and configured
  • A ByteRover account

Getting Started

1. Start the Connection

Go to your ByteRover dashboard and:
  1. Find the “Connect your agent” section
  2. Click on Gemini CLI from the list
  3. Hit the “Connect with Gemini CLI” button

2. Connect ByteRover to Gemini CLI

Step 1: Open your Gemini settings file:
~/.gemini/settings.json
Step 2: Add the following MCP server block:
{
  "mcpServers": {
    "byterover-mcp": {
      "httpUrl": "https://mcp.byterover.dev/v2/mcp",
      "headers": {
        "Authorization": "Bearer [DASHBOARD_TOKEN]"
      }
    }
  }
}
Step 3: Reload Gemini CLI to apply changes. Run /mcp to confirm your connection. You should see byterover-mcp listed with available tools.

Test It

Try storing a pattern:
Store this async retry utility to ByteRover:

async function retry(fn, maxAttempts = 3, delay = 1000) {
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
    try {
      return await fn();
    } catch (error) {
      if (attempt === maxAttempts) {
        throw error;
      }
      await new Promise(resolve => setTimeout(resolve, delay * attempt));
    }
  }
}
Gemini should confirm successful storage.

Benefits

Gemini gains memory of your coding style and patterns, providing more relevant and personalized assistance based on your development history.
Your stored knowledge persists across all CLI sessions, building a comprehensive personal coding knowledge base over time.
With ByteRover team plans, your entire team can benefit from shared coding patterns and solutions discovered by any team member.

Troubleshooting

Verify JSON syntax in settings file. Check API token accuracy. Ensure file permissions allow reading/writing.
Test internet connectivity. Verify MCP server URL is correct. Try regenerating API token if connection fails.
Confirm /mcp shows connected status. Test with simple storage command. Check ByteRover account has available operations.
Join our Discord community for Gemini CLI tips and support.