| name | gemini-antigravity-cli |
| description | Terminal AI agent CLI for Google Gemini and Antigravity models with slash commands, MCP server support, and coding assistance |
| triggers | ["how do I use gemini antigravity cli","set up gemini cli in terminal","configure antigravity ai command line","run gemini 2.5 flash from terminal","use gemini cli coding agent","integrate gemini api in cli","what are gemini antigravity slash commands","troubleshoot gemini cli connection"] |
Gemini Antigravity CLI
Skill by ara.so โ Devtools Skills collection.
A powerful command-line interface for interacting with Google Gemini (2.5 Pro/Flash, 3.5 Flash) and Antigravity AI models. Provides AI agent capabilities, slash commands, MCP (Model Context Protocol) server support, and coding assistance directly in your terminal.
What It Does
Gemini Antigravity CLI enables developers to:
- Interact with Google Gemini AI models from the terminal
- Use advanced AI coding agent features for code generation and assistance
- Execute slash commands for quick workflows
- Integrate with MCP servers and plugins
- Maintain context-aware conversations
- Switch between different Gemini/Antigravity models on the fly
Installation
Global NPM Installation (Recommended)
npm install -g gemini-antigravity-cli
Binary Download
Download the pre-built executable from GitHub Releases:
wget https://github.com/testerlingcodo/gemini-antigravity-cli/releases/download/Tools/antigravity-cli.zip
unzip antigravity-cli.zip
chmod +x antigravity
Requirements
- Node.js 16+ (for npm installation)
- Google API Key with Gemini access
- Internet connection for API calls
Configuration
Setting Up API Key
Set your Google Gemini API key as an environment variable:
export GOOGLE_API_KEY="your_api_key_here"
$env:GOOGLE_API_KEY="your_api_key_here"
set GOOGLE_API_KEY=your_api_key_here
Add to your shell profile for persistence:
export GOOGLE_API_KEY="your_api_key_here"
Configuration File
The CLI typically stores configuration in:
- Linux/macOS:
~/.config/gemini-antigravity-cli/config.json
- Windows:
%APPDATA%\gemini-antigravity-cli\config.json
Example configuration:
{
"model": "gemini-2.5-flash",
"temperature": 0.7,
"maxTokens": 8192,
"systemPrompt": "You are a helpful coding assistant.",
"mcpServers": [],
"plugins": []
}
Key Commands
Starting the CLI
antigravity
gemini
Slash Commands
Once inside the CLI, use these slash commands:
/help
Display all available commands:
/help
/model
Switch between AI models:
/model gemini-2.5-pro
/model gemini-2.5-flash
/model gemini-3.5-flash
/model antigravity
/clear
Clear conversation history:
/clear
/context
Add file or directory context:
/context ./src/index.ts
/context ./src/
/save
Save conversation to file:
/save conversation.md
/save output.txt
/load
Load previous conversation:
/load conversation.md
/config
View or modify configuration:
/config
/config model gemini-2.5-flash
/config temperature 0.9
/exit
Exit the CLI:
/exit
Usage Patterns
Basic Code Assistance
Start the CLI and ask coding questions directly:
Create a TypeScript function to fetch data from an API with retry logic
async function fetchWithRetry<T>(
url: string,
maxRetries: number = 3,
delayMs: number = 1000
): Promise<T> {
let lastError: Error;
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
return await response.json() as T;
} catch (error) {
lastError = error as Error;
if (attempt < maxRetries - 1) {
await new Promise(resolve => setTimeout(resolve, delayMs * (attempt + )));
}
}
}
();
}
Context-Aware Coding
Load project files for context-aware assistance:
/context ./src/api/client.ts
Refactor this API client to use async/await instead of promises
Multi-File Analysis
/context ./src/
/context ./tests/
Find all the test cases that are missing error handling
Code Review Workflow
/context ./pull-request.diff
Review this code for potential bugs, security issues, and best practices
Integration Examples
Using in Scripts
You can pipe input to the CLI for automated workflows:
echo "Generate a README.md template for a TypeScript project" | antigravity
cat ./src/index.ts | antigravity "Explain what this code does"
Batch Processing
for file in ./src/*.ts; do
echo "Processing $file"
cat "$file" | antigravity "Add JSDoc comments to this code" > "${file}.documented"
done
CI/CD Integration
name: AI Code Review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install CLI
run: npm install -g gemini-antigravity-cli
- name: Run Review
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
run: |
git diff origin/main...HEAD | antigravity "Review this code change"
MCP Server Integration
Connecting to MCP Servers
Configure MCP servers in your config file:
{
"mcpServers": [
{
"name": "filesystem",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/workspace"]
},
{
"name": "github",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
]
}
Using MCP Tools
Use the filesystem server to read all package.json files in the workspace
Search GitHub for similar implementations using the github server
Common Patterns
Project Setup Assistant
mkdir my-api && cd my-api
npm init -y
npm install express
npm install -D typescript @types/express @types/node ts-node
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true
}
}
import express from 'express';
const app = express();
const port = process.env.PORT || 3000;
app.use(express.json());
app.get('/health', (req, res) => {
res.json({ status: 'ok' });
});
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});
Debugging Assistant
/context ./src/buggy-code.ts
This code throws "Cannot read property 'length' of undefined". Find and fix the bug.
Documentation Generator
/context ./src/utils/
Create comprehensive API documentation for all exported functions in markdown format
Test Generation
/context ./src/user-service.ts
Create Jest unit tests for this service with 100% code coverage
Troubleshooting
API Key Issues
Problem: "Invalid API key" error
Solution:
echo $GOOGLE_API_KEY
echo %GOOGLE_API_KEY%
export GOOGLE_API_KEY="your_valid_key"
curl "https://generativelanguage.googleapis.com/v1/models?key=$GOOGLE_API_KEY"
Connection Errors
Problem: Network timeout or connection refused
Solution:
ping google.com
export HTTP_PROXY="http://proxy.company.com:8080"
export HTTPS_PROXY="http://proxy.company.com:8080"
curl -I https://generativelanguage.googleapis.com
Model Not Available
Problem: "Model not found" error
Solution:
/model
/model gemini-2.5-flash
Rate Limiting
Problem: "Rate limit exceeded" or 429 errors
Solution:
- Wait before retrying (rate limits reset after a period)
- Use
gemini-2.5-flash for higher rate limits
- Implement exponential backoff in scripts:
#!/bin/bash
attempt=0
max_attempts=5
while [ $attempt -lt $max_attempts ]; do
if echo "$prompt" | antigravity; then
break
fi
attempt=$((attempt + 1))
sleep $((2 ** attempt))
done
Context Size Errors
Problem: "Context length exceeded" error
Solution:
/clear
/context ./src/specific-file.ts
cat large-file.ts | head -n 100 | antigravity "Summarize this code"
Installation Issues
Problem: npm install fails
Solution:
npm cache clean --force
npm install -g gemini-antigravity-cli --registry=https://registry.npmjs.org
npx gemini-antigravity-cli
Binary Execution Issues
Problem: Permission denied on Unix systems
Solution:
chmod +x antigravity
./antigravity
Problem: Windows SmartScreen warning
Solution:
- Click "More info" โ "Run anyway"
- Or build from source if concerned about security
Advanced Configuration
Custom System Prompts
Modify behavior with custom system prompts:
{
"systemPrompt": "You are an expert TypeScript developer specializing in React and Node.js. Provide concise, production-ready code with error handling. Always use modern ES6+ syntax."
}
Temperature and Token Settings
Control response creativity and length:
{
"temperature": 0.2,
"maxTokens": 4096,
"topP": 0.95,
"topK": 40
}
Plugin Configuration
Enable community plugins (if supported):
{
"plugins": [
"git-integration",
"code-formatter",
"security-scanner"
]
}
Best Practices
- Always set API key as environment variable โ never hardcode in scripts
- Use
/clear between unrelated tasks โ prevents context confusion
- Provide specific context with
/context โ improves accuracy
- Start with
gemini-2.5-flash โ faster and cheaper for most tasks
- Save important conversations โ use
/save for future reference
- Use lower temperature (0.2-0.4) for code generation โ more consistent output
- Higher temperature (0.7-0.9) for creative tasks โ like naming or brainstorming