Documentation Index
Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt
Use this file to discover all available pages before exploring further.
1. Overview
Gemini CLI is Google’s official command-line AI coding tool that lets you interact with Gemini models directly from your terminal. Through GravitexAI as the gateway, you can:Terminal-native
Call Gemini 3.5 / 3.1 / 2.5 models right from your shell
AI-assisted coding
Code generation, review and unit-test automation
Smart Q&A
Tech questions, architecture design and debugging
Docs generation
Auto-generate READMEs, API docs and JSDoc comments
Using GravitexAI as the gateway gives you optimized connectivity, unified API key management, and one-stop access to Claude, GPT and Gemini under a single account.
2. Prerequisites
- Node.js ≥ 18.0.0
- npm or yarn
- An API key from the GravitexAI console (format
sk-xxxxxxxxxx)
3. Quick Start
Step 1 — Install Gemini CLI
Step 2 — Get a GravitexAI API key
Sign in to GravitexAI
Go to maas.gravitex.ai and register or log in.
Create an API key
Open the API Keys page and click “Create new token”.
Step 3 — Configure environment variables
- Zsh (macOS / Linux)
- Bash (Linux)
- PowerShell (Windows)
- CMD (Windows)
Step 4 — Initialize and test
4. Recommended Models (via GravitexAI)
GravitexAI ships with the latest Gemini family. All of these are callable from the CLI:Gemini 3.x series (recommended)
| Model ID | Best for | Notes |
|---|---|---|
| gemini-3.5-flash ⭐ | High-throughput chat, low-latency tools | Latest fast variant, fastest in class |
| gemini-3.1-pro-preview | Deep reasoning, high-quality codegen | Next-gen core model |
| gemini-3.1-flash-lite-preview | High-concurrency, batch jobs | Best price/perf fast tier |
| gemini-3.1-flash-image-preview | Image understanding / text-to-image | Multimodal enhanced |
| gemini-3-pro-image-preview | High-quality text-to-image | Image-focused variant |
| gemini-3-flash-preview | Multi-turn chat, tool use | Balanced speed and quality |
Suggested defaults:
- Complex coding / architecture: gemini-3.1-pro-preview
- Daily coding & Q&A: gemini-3.5-flash
- Batch / high-frequency: gemini-3.1-flash-lite-preview
5. Core Features
5.1 Code generation
- Function
- Project scaffold
- Unit tests
5.2 Code review
5.3 Technical Q&A
5.4 Documentation generation
6. Interactive Commands
| Command | Description | Example |
|---|---|---|
/auth | Re-authenticate | /auth |
/model | Switch model | /model gemini-3.1-pro-preview |
/clear | Clear conversation | /clear |
/help | Show help | /help |
/exit | Quit CLI | /exit or Ctrl+C |
/save | Save conversation to file | /save conversation.txt |
7. Advanced Usage
7.1 GitHub Actions (automated review)
7.2 Batch scripts
8. FAQ
Connection or auth failures?
Connection or auth failures?
Checklist:
-
Env vars correct?
Expected:
GOOGLE_GEMINI_BASE_URL:https://api.gravitex.ai(no/v1or other path)GEMINI_API_KEY: fullsk-…key
-
Reload env:
- Restart terminal: close and reopen the terminal window.
- Validate the key in the GravitexAI console — ensure it’s active and has balance.
How do I switch Gemini models?
How do I switch Gemini models?
Option A — interactive Option B — CLI flag:
/model:How do I save conversation history?
How do I save conversation history?
Method 1: use Method 2: shell redirection
/saveNode.js version too old?
Node.js version too old?
Use nvm to manage Node:
Why are responses slow?
Why are responses slow?
Possible causes and fixes:
- Network: GravitexAI provides optimized routes; check status on the console.
- Model choice: use
gemini-3.5-flashorgemini-3.1-flash-lite-previewfor fastest responses. - Token size: reduce request complexity and context length.
How to use on Windows?
How to use on Windows?
PowerShell (recommended):
- Install Node.js from nodejs.org
- Open PowerShell as Administrator
- Set env vars:
- Restart PowerShell
- Install:
npm install -g @google/gemini-cli
9. Best Practices
Prompt design
Be specific
❌ “Optimize this code”✅ “Optimize this code for performance, focus on loop efficiency and memory use”
Provide context
❌ “What’s wrong with this function?”✅ “This handles user login and throws an async error — help me find the bug”
Break into steps
❌ “Build the whole project”✅ “Step 1: design DB model; Step 2: build API routes; Step 3: …”
Ask for examples
❌ “Explain closures”✅ “Explain JS closures with 3 practical scenarios and code examples”
Recommended workflow
10. References
- Gemini CLI official docs: https://ai.google.dev/gemini-api/docs/cli
- GravitexAI console: https://maas.gravitex.ai
- Model list: https://maas.gravitex.ai/#/models
- Quickstart: /en/quickstart