Complete documentation refresh covering: - Version detection via CLI binary mtime (not package.json) - Multi-Agent Support section with token authentication for claude/codex/gemini - Directory creation approval flow for session spawning - HTTP Control Server endpoints with Fastify + Zod schemas - State persistence fields including startedWithCliMtimeMs - Integration Testing section with test environment and key scenarios - Typed shutdown sources (hapi-app, hapi-cli, os-signal, exception) - MachineMetadata with new happyLibDir field - WebSocket communication patterns and RPC methods - Machine sync architecture with separated metadata and daemon state Replaces CLAUDE.md with structured daemon documentation.
hapi
HAPI means "哈皮," a Chinese transliteration of happy, great credit to the original Happy project.
Run Claude Code / Codex / Gemini sessions locally and control them remotely through a Web / PWA / Telegram Mini App.
Features
- Start AI coding sessions from any machine.
- Monitor and control sessions from your phone or browser.
- Approve or deny tool permissions remotely.
- Browse files and view git diffs.
- Track session progress with todo lists.
- Supports multiple AI backends: Claude Code, Codex, and Gemini.
Quickstart (single executable)
-
Download the prebuilt
hapibinary for your platform and put it on your PATH. -
Start the server on a machine you control:
hapi server
-
If the server has no public IP, expose it over HTTPS:
- Cloudflare Tunnel: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/
- Tailscale: https://tailscale.com/kb/
-
Run the CLI on the machine where you want sessions:
# If the server is not on localhost:3006
export HAPI_BOT_URL="https://your-domain.example"
hapi
- Open the UI in a browser at the server URL and log in with
CLI_API_TOKEN.
Telegram Mini App (optional)
To use Telegram for notifications and the Mini App:
-
Create a bot with @BotFather and get the token.
-
Expose your server over HTTPS (Cloudflare Tunnel, Tailscale, etc.).
-
Add environment variables:
WEBAPP_URL="https://your-domain.example"
TELEGRAM_BOT_TOKEN="..."
-
Start the server and send
/startto the bot to get your chat ID. -
Add your chat ID and restart:
ALLOWED_CHAT_IDS="12345678"
- Run
/appin the bot chat to open the Mini App.
Multi-agent support
hapi- Start a Claude Code session.hapi codex- Start an OpenAI Codex session.hapi gemini- Start a Google Gemini session.
CLI config file
You can store the token in ~/.hapi/settings.json instead of an env var.
Environment variables take priority over the file.
Requirements
- Claude CLI installed and logged in (
claudeon PATH) for Claude Code sessions. - Bun if building from source.
Build from source
bun install
bun run build
Build a single binary with embedded web assets:
bun run build:single-exe
Docs
cli/README.md- CLI usage and configserver/README.md- Server setup and architectureweb/README.md- Web app behavior and dev workflow
License
- cli: MIT
- others: LGPLv2