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

# Gemini CLI

> Use Gemini CLI with NagaAI by pointing an OpenRouter-compatible Gemini CLI fork to NagaAI’s OpenAI-compatible API.

Gemini CLI can work with NagaAI through a community fork that supports OpenRouter-style configuration.

This is not the official Gemini CLI path. Use it only if you specifically want Gemini CLI and are comfortable relying on a community-maintained fork.

<Warning>
  This integration depends on a community fork or branch, not the official Gemini CLI release. Review the repository before using it in production.
</Warning>

## Setup

<Steps>
  <Step title="Clone the OpenRouter-compatible fork/branch">
    Use the OpenRouter-compatible fork or branch instead of the default upstream release:

    ```bash theme={null}
    git clone https://github.com/heartyguy/gemini-cli
    cd gemini-cli
    git checkout feature/openrouter-support
    ```
  </Step>

  <Step title="Configure environment variables for NagaAI">
    Point the fork at NagaAI's OpenAI-compatible endpoint:

    ```bash theme={null}
    export OPENROUTER_BASE_URL="https://api.naga.ac/v1"
    export OPENROUTER_API_KEY="YOUR_NAGAAI_API_KEY"
    ```

    <Info>
      Need an API key? Create one in the [NagaAI Dashboard](https://naga.ac/dashboard), then see [Quickstart](/get-started/quickstart) if you want a first working request.
    </Info>
  </Step>

  <Step title="Choose a tools-capable model">
    If you want repo search, file edits, or command execution, choose a model that supports function calling:

    * [Browse models with tools support](https://naga.ac/models?parameters=tools)
  </Step>

  <Step title="Install dependencies and start the CLI">
    Requirements: Node.js 18+

    ```bash theme={null}
    npm install
    npm start
    ```
  </Step>

  <Step title="Verify the setup">
    Ask the CLI to inspect the current project or explain a file. If it answers normally and can use tools when needed, the NagaAI connection is working.
  </Step>
</Steps>

## Try it

* “Summarize the project structure and key modules.”
* “Find the code responsible for X and explain how it works.”
* “Propose a refactor plan for module Y and list the files to change.”

## Notes

* Base URL: `https://api.naga.ac/v1`
* Auth: standard NagaAI API key
* This setup may drift as the community fork changes
