HAPI is a local-first, self-hosted platform for running and controlling AI coding agents (Claude Code, Codex, Gemini, OpenCode) remotely. It lets you start coding sessions on your computer and monitor/control them from your phone.
HAPI (哈皮) is a Chinese transliteration of "Happy", reflecting the project's goal of making AI coding assistance a happier experience by freeing you from the terminal.
Yes, HAPI is open source and free to use under the AGPL-3.0-only license.
- Claude Code (recommended)
- OpenAI Codex
- Cursor Agent
- Google Gemini
- OpenCode
HAPI includes an embedded hub. Just run hapi hub on your machine - no external hub required.
hapi server remains supported as an alias.
For local network access:
http://<your-computer-ip>:3006
If your phone cannot connect, make sure the hub is not only listening on 127.0.0.1. For LAN access, set listenHost to 0.0.0.0 in ~/.hapi/settings.json or set HAPI_LISTEN_HOST=0.0.0.0, then restart hapi hub.
For internet access:
- If the hub has a public IP, access it directly (use HTTPS via reverse proxy for production)
- If behind NAT, set up a tunnel (Cloudflare Tunnel, Tailscale, or ngrok)
The CLI_API_TOKEN is a shared secret that authenticates:
- CLI connections to the hub
- Web app logins
- Telegram account binding
It's auto-generated on first hub start and saved to ~/.hapi/settings.json.
Yes. We support lightweight multi-account access via namespaces for shared team hubs. See Namespace (Advanced).
Yes. Telegram is optional. You can use the web app directly in any browser or install it as a PWA.
- When your AI agent requests permission (e.g., to edit a file), you'll see a notification
- Open HAPI on your phone
- Navigate to the active session
- Approve or deny the pending permission
HAPI supports two methods:
- PWA Push Notifications - Enable when prompted, works even when app is closed
- Telegram Bot - See Telegram Setup
Yes, with runner mode:
- Run
hapi runner starton your computer - Your machine appears in the "Machines" list in the web app
- Tap to spawn new sessions from anywhere
In the session view, tap the "Files" tab to:
- Browse project files
- View git status
- See diffs of changed files
Yes. Open any session and use the chat interface to send messages directly to the AI agent.
Yes, on Linux and macOS hosts. Open a session in the web app and tap the Terminal tab for a remote shell.
Windows hosts do not support the remote Terminal yet because the Bun PTY API used by HAPI is currently POSIX-only.
Set ELEVENLABS_API_KEY, open a session in the web app, and click the microphone button. See Voice Assistant.
Yes. HAPI is local-first:
- All data stays on your machine
- Nothing is uploaded to external servers
- The database is stored locally in
~/.hapi/
The auto-generated token is 256-bit (cryptographically secure). For external access, always use HTTPS via a tunnel.
Only if they have your access token. For additional security:
- Use a strong, unique token
- Always use HTTPS for external access
- Consider Tailscale for private networking
- Ensure hub is running:
hapi hub - Check firewall allows port 3006
- Verify
HAPI_API_URLis correct
If HAPI works on your computer but not from another device on the same LAN, check the hub bind address first. By default, HAPI listens on 127.0.0.1, which only accepts localhost connections.
Use one of these:
{
"listenHost": "0.0.0.0"
}export HAPI_LISTEN_HOST=0.0.0.0Then restart hapi hub and open:
http://<your-computer-ip>:3006Also verify your OS firewall allows inbound connections on port 3006.
- Re-run
hapi auth login - Check token matches in CLI and hub
- Verify
~/.hapi/settings.jsonhas correctcliApiToken
# Check status
hapi runner status
# Clear stale lock file
rm ~/.hapi/runner.state.json.lock
# Check logs
hapi runner logsInstall Claude Code or set custom path:
npm install -g @anthropic-ai/claude-code
# or
export HAPI_CLAUDE_PATH=/path/to/claudeInstall Cursor Agent CLI:
# macOS/Linux
curl https://cursor.com/install -fsS | bash
# Windows (PowerShell)
irm 'https://cursor.com/install?win32=true' | iexEnsure agent is on your PATH.
hapi doctorThis checks hub connectivity, token validity, agent availability, and more.
| Aspect | Happy | HAPI |
|---|---|---|
| Design | Cloud-first | Local-first |
| Users | Multi-user | Single user |
| Deployment | Multiple services | Single binary |
| Data | Encrypted on server | Never leaves your machine |
See Why HAPI for detailed comparison.
| Feature | Claude Code | HAPI + Claude Code |
|---|---|---|
| Remote access | No | Yes |
| Mobile control | No | Yes |
| Permission approval | Terminal only | Phone/web |
| Session persistence | No | Yes |
| Multi-machine | Manual | Built-in |
Visit our GitHub repository to:
- Report issues
- Submit pull requests
- Suggest features
Open an issue on GitHub Issues.