Gemini CLI Integration¶
The Gemini CLI provides a powerful command-line interface for interacting with Google's Gemini models. When combined with Eclair, it becomes a data-aware AI assistant that can discover, download, and analyze real datasets.
Prerequisites¶
Before setting up Gemini CLI with Eclair:
Installation¶
1. Install Gemini CLI¶
2. Install Node.js (if needed)¶
Visit nodejs.org or use a package manager:
# macOS with Homebrew
brew install node
# Ubuntu/Debian
sudo apt install nodejs npm
# Windows with Chocolatey
choco install nodejs
Configuration¶
1. Set Up API Key¶
Get your Gemini API key from Google AI Studio and set it in an environment file:
Keep Your API Key Secret
Never commit your API key to version control. Always use environment variables or secure key management.
2. Configure MCP Server¶
Create the Gemini CLI configuration file at ~/.gemini/settings.json
:
mkdir -p ~/.gemini
cat > ~/.gemini/settings.json << 'EOF'
{
"mcpServers": {
"eclair": {
"httpUrl": "http://localhost:8080/mcp",
"timeout": 5000
}
},
"selectedAuthType": "gemini-api-key"
}
EOF
3. Copy System Prompt¶
The system prompt helps Gemini understand how to work with Eclair tools:
Starting Gemini CLI¶
1. Ensure Eclair Server is Running¶
# Check if server is running
curl http://localhost:8080/mcp/health
# If not running, start it
eclair-server
2. Start Gemini CLI¶
You should see:
- 🕶️ Red sunglasses icon (indicates system prompt is loaded)
- "Using: 1 MCP server" message
3. Verify MCP Connection¶
Type \mcp
in the prompt to see available Eclair tools:
You should see all Eclair tools listed.
You're all set! Gemini CLI can now discover and analyze real datasets through Eclair.
Usage Examples¶
Fashion Dataset Analysis¶
This triggers a complete workflow:
-
Dataset Discovery: Gemini uses Eclair to find fashion datasets. It will ask for permission to use the Eclair tools.
-
Dataset Selection: Gemini presents options and gets your preference
-
Data Download: Uses Eclair (Croissant) metadata to download the dataset correctly
-
Code Generation: Creates Python code for analysis and visualization
-
Visualization Results: Shows actual data visualizations
Advanced Analysis Requests¶
Gemini can continue the analysis by:
- Building machine learning models
- Comparing different algorithms
- Evaluating performance metrics
- Creating detailed reports
Troubleshooting¶
Common Issues¶
"No MCP servers available"
- Check that Eclair server is running:
curl http://localhost:8080/mcp
- Note: the Eclair server actually binds to
http://0.0.0.0:8080/mcp
- Verify the
~/.gemini/settings.json
configuration - Restart Gemini CLI
"API key not found"
- Ensure
.env
file containsGEMINI_API_KEY=your_key
- Check that the file is in your current directory
- Verify the API key is valid
"Connection timeout"
- Increase timeout in
~/.gemini/settings.json
- Check network connectivity
- Verify Eclair server is responding
Configuration Verification¶
Check your setup: