Overview
HAPI CLI supports multiple AI coding agents, each with its own command and options. All session commands connect to the HAPI hub for remote control.Claude Code Sessions
hapi (default command)
Start a Claude Code session with remote control capabilities.Bypass all permissions (equivalent to
--dangerously-skip-permissions)Skip all permission prompts (use with caution)
Specify the Claude model to use
Set initial session mode:
local: Controlled from terminalremote: Controlled from web/mobile app
Resume the most recent Claude session
Pass-through to Claude
All standard Claude CLI flags are supported and passed through:Terminal Output Example
Codex Sessions
hapi codex
Start an OpenAI Codex session.Resume an existing Codex session
Bypass approvals and sandbox restrictions (equivalent to
--dangerously-bypass-approvals-and-sandbox)Skip all permission prompts and sandbox restrictions
Specify the OpenAI model to use
Examples
Cursor Agent Sessions
hapi cursor
Start a Cursor Agent session.Resume an existing Cursor chat
Resume a Cursor chat (chatId optional if used as flag)
Continue the previous conversation
Set the agent mode:
plan: Planning mode (agent creates execution plan)ask: Question-answer mode
Shortcut for
--mode planBypass permissions (equivalent to
--force)Force execution without prompts
Specify the model to use
Set initial session mode (local or remote control)
Examples
Terminal Output Example
Gemini Sessions
hapi gemini
Start a Google Gemini session via ACP (Anthropic Code Plugins).Gemini runs in remote mode only - it waits for messages from the hub UI or Telegram.
Bypass permissions
Specify the Gemini model to use
Set session mode (typically remote for Gemini)
Examples
OpenCode Sessions
hapi opencode
Start an OpenCode session via ACP and plugin hooks.OpenCode supports both local and remote modes. Local mode streams via OpenCode plugins.
Resume an existing OpenCode session
Bypass permissions
Set session mode:
local: Terminal streaming via OpenCode pluginsremote: Control from web/mobile
Examples
Common Flags
These internal flags are used across multiple session types:Internal flag indicating how the session was started. Set automatically by the runner.
MCP Stdio Bridge
hapi mcp
Start an MCP (Model Context Protocol) stdio bridge for external tools.HAPI_HTTP_MCP_URL environment variable.
Example
Session Modes
All session types support two control modes:Local Mode
- Session is controlled from the terminal
- User interacts directly via command line
- Still registered with hub for monitoring
Remote Mode
- Session waits for commands from web/mobile app
- No terminal interaction required
- Ideal for background sessions
Switching Modes
You can switch between local and remote modes mid-session using the web interface or Telegram bot.Next Steps
- Authentication Commands - Manage your CLI token
- Runner Commands - Run sessions in the background
- Environment Variables - Configure session behavior