> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codealive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini CLI

> Connect CodeAlive with Google Gemini CLI

## Overview

Connect CodeAlive with Google's Gemini CLI for AI-powered development with deep codebase understanding. Gemini CLI supports a one-command setup — no config files needed.

<Tip>
  **Quick install:** Run `npx @codealive/installer` to automatically configure CodeAlive for Gemini CLI.
  See the [Installation Guide](/installation) for details.
</Tip>

## Prerequisites

* Gemini CLI installed ([github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli))
* CodeAlive account with API key ([Sign up here](https://app.codealive.ai))
* Indexed repositories in your CodeAlive dashboard

## Setup

<Steps>
  <Step title="Add CodeAlive MCP Server">
    Run this single command:

    ```bash theme={null}
    gemini mcp add --transport http secure-http https://mcp.codealive.ai/api --header "Authorization: Bearer YOUR_API_KEY_HERE"
    ```

    Replace `YOUR_API_KEY_HERE` with your actual CodeAlive API key. That's it — no config files needed.
  </Step>

  <Step title="Verify Integration">
    Start Gemini CLI and try:

    * "Show me all available repositories"
    * "Find authentication code in my codebase"
  </Step>
</Steps>

## Community Extension

For an enhanced experience, install the community-built Gemini CLI extension that adds slash commands and workflow guidance:

```bash theme={null}
gemini extensions install https://github.com/akolotov/gemini-cli-codealive-extension
```

This adds:

* `/codealive:chat` — Chat with your codebase
* `/codealive:find` — Search for code
* `/codealive:search` — Semantic search
* `GEMINI.md` guidance for effective CodeAlive usage

### Extension Configuration

Set your API key for the extension:

```bash theme={null}
# Option 1: .env file next to where you run gemini
CODEALIVE_API_KEY="your_codealive_api_key_here"

# Option 2: Environment variable
export CODEALIVE_API_KEY="your_codealive_api_key_here"
```

## Usage

Once connected, Gemini CLI can:

* **Search your codebase** semantically across all indexed repositories
* **Answer architecture questions** with full project context
* **Find patterns and implementations** across multiple services

```
"Find all API endpoints in the user service"
"Explain how the payment flow works"
"Show me error handling patterns across services"
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="MCP server not responding">
    1. Verify the server was added: `gemini mcp list`
    2. Check your API key is correct
    3. Remove and re-add: `gemini mcp remove secure-http` then re-run the add command
  </Accordion>

  <Accordion title="Extension not loading">
    1. Verify the extension is installed: `gemini extensions list`
    2. Check the `CODEALIVE_API_KEY` is set
    3. Restart Gemini CLI
  </Accordion>
</AccordionGroup>

<Tip>
  For more solutions, see the [Troubleshooting Guide](/troubleshooting).
</Tip>

## Related Resources

* [MCP Overview](/integrations/mcp)
* [Installation Guide](/installation)
* [Self-Hosting Guide](/integrations/mcp/self-hosting)
* [Agent Skills](/integrations/skills)

## Instruct Your Agent

Connecting CodeAlive makes its tools available, but the agent may still default to its built-in search. For reliable results, add a short instruction in the agent's native format telling it to prefer `semantic_search` and `grep_search` when exploring indexed code. See [Instructing Coding Agents](https://docs.codealive.ai/guides/instructing-agents).
