# Gemini CLI with OfoxAI Setup Guide Source: https://ofox.ai/docs/integrations/gemini-cli [Gemini CLI](https://github.com/google-gemini/gemini-cli) is Google's command-line tool for Gemini models. With OfoxAI, you can use the Gemini protocol while gaining access to a broader model selection. > **Set up faster with Ofox Desktop.** On an Apple silicon Mac, Desktop can detect this tool, back up its current configuration, and apply an Ofox API key and compatible model. [Open Ofox Desktop](https://ofox.ai/desktop). ## Setup Steps ### 1. Install Gemini CLI ```bash npm install -g @google/gemini-cli ``` ![Install Gemini CLI](https://ofox.ai/screenshots/gemini-cli/01-install.png) ### 2. Configure OfoxAI Gemini CLI uses the Gemini native protocol. Point it to OfoxAI via the configuration file: ```json filename="~/.gemini/settings.json" { "apiKey": "", "baseUrl": "https://api.ofox.ai/gemini" } ``` Or use environment variables: ```bash filename="~/.zshrc" export GEMINI_API_KEY= ``` The base URL configuration method for Gemini CLI may change with version updates. If the above method doesn't work, refer to the latest Gemini CLI documentation. ### 3. Verify ```bash gemini "Hello, tell me about yourself" ``` ![Verify Gemini CLI](https://ofox.ai/screenshots/gemini-cli/03-verify.png) ## Available Models For recommended models, see the [OfoxAI Model Marketplace](https://ofox.ai/models). ## Use Cases - **Code generation and review** — Gemini models excel at code understanding - **Long file analysis** — Leverage the 1M token context window - **Multimodal tasks** — Analyze images, PDFs, and other files Using Gemini CLI through OfoxAI also gives you the benefits of fallback and routing optimization. See [Advanced](https://ofox.ai/docs/develop/advanced/fallback) for details.