> ## 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](https://docs.codealive.ai/installation.md) for details.

## 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

**1. 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.

**2. Verify Integration**

Start Gemini CLI and try:

* "Show me all available repositories"
* "Find authentication code in my codebase"

## 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

> [accordion] 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] Extension not loading
>
> 1. Verify the extension is installed: `gemini extensions list`
> 2. Check the `CODEALIVE_API_KEY` is set
> 3. Restart Gemini CLI

> [!TIP]
>
> For more solutions, see the [Troubleshooting Guide](https://docs.codealive.ai/troubleshooting.md).

## Related Resources

* [MCP Overview](https://docs.codealive.ai/integrations/mcp.md)
* [Installation Guide](https://docs.codealive.ai/installation.md)
* [Self-Hosting Guide](https://docs.codealive.ai/integrations/mcp/self-hosting.md)
* [Agent Skills](https://docs.codealive.ai/integrations/skills.md)

## 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.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.