Overview
Gemini mode integrates Google’s Gemini AI model with HAPI through the Anthropic Code Plugins (ACP) protocol. Run Gemini-powered coding sessions with remote control via web and Telegram.Gemini runs in remote mode only - it waits for messages from the hub UI or Telegram.
Requirements
- HAPI CLI installed (
hapicommand available) - Authenticated with HAPI hub (
hapi auth login) - Google Gemini API credentials configured
Starting a Session
Basic Usage
With Options
Available Flags
| Flag | Description |
|---|---|
--yolo | Bypass approval prompts |
--model <model> | Specify Gemini model (e.g., gemini-pro, gemini-ultra) |
--hapi-starting-mode | Must be remote (default behavior) |
--started-by | Internal flag for runner management |
Permission Modes
Gemini supports these permission modes:Default
Standard behavior with approval prompts
Read Only
Only read operations allowed, no modifications
Safe Yolo
Some restrictions bypassed, critical checks remain
Yolo
Bypass all approval prompts (use with caution)
shared/src/modes.ts:7-8 for mode definitions.
Session Modes
Remote Mode Only
Gemini runs exclusively in remote mode:- Session waits for messages from hub UI/Telegram
- No terminal interaction
- Fully controlled via web app or phone
- Uses ACP (Anthropic Code Plugins) protocol
Local mode is not supported for Gemini. All interaction happens through the web UI or Telegram.
ACP Integration
Gemini integrates via the ACP (Anthropic Code Plugins) protocol:- Runs as an ACP-compatible agent
- Supports standard coding tools and operations
- Managed by the HAPI agent runner system
- See
cli/src/agent/runners/runAgentSession.tsfor implementation
Examples
Start Gemini Session
Start with Yolo Mode
Specify Model
Start from Runner
Gemini sessions can be spawned remotely via the HAPI runner:Integration
Once running, your Gemini session appears in:- HAPI web app
- Telegram Mini App
- Send messages from web or phone
- Monitor session activity in real-time
- Approve operations remotely
- Change permission modes on the fly
- View file changes and diffs
- Manage multiple sessions
Workflow
-
Start Session
-
Open Web UI
- Navigate to your HAPI hub URL
- Find the new Gemini session
-
Send Messages
- Type your coding request
- Gemini processes and responds
- Approve any required operations
-
Monitor Progress
- View real-time updates
- Check file changes
- Review diffs
Remote Control
Since Gemini runs in remote mode, you have full control from:Web App
- Send messages
- Approve operations
- View session history
- Change modes
- Monitor file changes
Telegram
- Start/stop sessions
- Send messages
- Receive notifications
- Quick approvals
Related Commands
Configuration
Gemini requires API credentials. Configure via:- Environment variables
- HAPI configuration file
- Hub settings
Source Reference
- Command implementation:
cli/src/commands/gemini.ts - Session runner:
cli/src/gemini/runGemini.ts - Agent runner:
cli/src/agent/runners/runAgentSession.ts - Permission modes:
shared/src/modes.ts:7-8