Skip to main content

What is HAPI?

HAPI is a local-first platform that lets you run AI coding agents (Claude Code, Codex, Cursor Agent, Gemini, OpenCode) on your machine and control them remotely through web, PWA, and Telegram.

Seamless Handoff

Work locally, switch to remote when needed, switch back anytime. No context loss, no session restart.

Native First

HAPI wraps your AI agent instead of replacing it. Same terminal, same experience, same muscle memory.

AFK Without Stopping

Step away from your desk? Approve AI requests from your phone with one tap.

Your AI, Your Choice

Claude Code, Codex, Cursor Agent, Gemini, OpenCode—different models, one unified workflow.

Why HAPI?

HAPI is a local-first alternative to Happy. While Happy uses a centralized server that stores your encrypted data, HAPI is decentralized—each user runs their own hub, and data never leaves your machine.
AspectHappyHAPI
ArchitectureCentralized (cloud server stores encrypted data)Decentralized (each user runs own hub)
DataEncrypted on server (server cannot read)Stays on your machine
DeploymentMultiple services (PostgreSQL, Redis, app server)Single binary
ComplexityHigh (E2EE, key management, scaling)Low (one command)
Choose HAPI if: You want data sovereignty, self-hosting, and minimal setup.Choose Happy if: You need a managed cloud service with multi-user collaboration.

How It Works

HAPI consists of three components that work together:
1

HAPI Hub

Central coordinator that handles persistence, real-time sync, and remote access. Runs on your machine with a single command.
hapi hub --relay
2

HAPI CLI

Wraps AI agents (Claude Code, Codex, Cursor, Gemini, OpenCode) and connects them to the hub via Socket.IO.
hapi              # Start Claude Code
hapi codex        # Start Codex
hapi cursor       # Start Cursor Agent
hapi gemini       # Start Gemini
hapi opencode     # Start OpenCode
3

Web App

React PWA that provides the mobile interface—view sessions, send messages, approve permissions, browse files.

Architecture Overview

┌────────────────────────────────────────────────────────────────┐
│                     Your Machine                               │
│                                                                │
│  ┌──────────┐    Socket.IO    ┌──────────┐    SSE            │
│  │   CLI    │◄───────────────►│   Hub    │◄────────►┌────────┤
│  │+ Agent   │                 │ + SQLite │          │Web App │
│  └──────────┘                 └──────────┘          └────────┘│
└────────────────────────────────┬───────────────────────────────┘

                        [Tunnel / Public URL]

                           ┌─────▼─────┐
                           │ Phone/Web │
                           └───────────┘

Key Features

Terminal Anywhere

Run commands from your phone or browser, directly connected to the working machine.

Voice Control

Talk to your AI agent hands-free using the built-in voice assistant powered by ElevenLabs.

Multi-Agent Support

# Claude Code (recommended)
hapi

# OpenAI Codex
hapi codex

# Cursor Agent
hapi cursor

# Google Gemini
hapi gemini

# OpenCode
hapi opencode

Remote Session Spawning

With the runner, spawn new sessions from your phone:
hapi runner start
Your machine appears in the “Machines” list—tap to start sessions remotely.

Security Model

HAPI offers two modes of remote access:

Public Relay

End-to-end encrypted with WireGuard + TLS via tunwg. The relay only forwards encrypted packets it cannot read.
hapi hub --relay

Self-Hosted

Run on your own server, Cloudflare Tunnel, or Tailscale. You control the full network path—no E2EE needed.
hapi hub
Your data stays on your machine. HAPI is local-first—nothing is uploaded to external servers.

Supported AI Agents

AgentCommandRequirements
Claude CodehapiClaude CLI installed (claude on PATH)
OpenAI Codexhapi codexCodex CLI installed
Cursor Agenthapi cursorCursor Agent CLI installed (agent on PATH)
Google Geminihapi geminiGemini CLI installed (via ACP)
OpenCodehapi opencodeOpenCode CLI installed (opencode on PATH)

Quick Example

Get started in under 2 minutes:
hapi hub --relay
# Displays URL and QR code
Scan the QR code or open the URL on your phone. Your session appears instantly.

Next Steps

Quickstart

Get HAPI running in under 2 minutes

Installation

Complete setup guide with all installation options

How It Works

Deep dive into architecture and data flow

GitHub

View source code and contribute

Build docs developers (and LLMs) love