tiann/hapi
Local-first CLI and hub for handing off coding-agent sessions across devices
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
HAPI is a local-first control layer for coding agents already installed on a working machine. The hapi CLI wraps an agent’s own terminal session; the hub connects paired clients to it so users can continue the session, send input, and handle approval prompts remotely. Commands still run on the working machine. HAPI is neither a model-serving runtime nor a replacement for the agent CLI.
The TypeScript monorepo has separate cli/, hub/, web/, relay/, and shared/ directories, along with native ios/ and android/ clients. The package scripts expose separate CLI, hub, and web build targets plus a single-executable build. Client integrations have a published contract at docs/api/client-contract/index.md. Relay mode uses WireGuard and TLS to encrypt traffic end to end between the device and the machine.
Key Capabilities & Differentiators
HAPI supports Claude Code, Codex, Cursor Agent, Grok Build, OpenCode, Kimi, Copilot, Antigravity, Pi, and DeepSeek Harness. Its core workflow is handing off an existing session from terminal to remote client and back without restarting it. Simultaneous use is a separate capability: shared Codex sessions support terminal and phone use at the same time with Codex 0.154.0 or later. Do not assume that behavior extends to other agents.
The Web/PWA includes a remote terminal and voice assistant. Native iOS and Android clients support chat, approvals, session creation, files, dictation, and native push; Telegram Mini App is another access option. Workspace browsing is opt-in: start the runner with one or more --workspace-root flags to allow web users to browse the selected trees and create sessions in permitted subdirectories.
Trade-offs & Limitations
Compared with using an agent CLI directly, HAPI adds remote approvals, handoff, and session access across devices, but also introduces a hub, client pairing, and a network path to maintain. It is a local-first alternative to Happy; the practical comparison is whether each tool supports your agents and preserves the workflow you need on your preferred clients. The web/PWA is free, while the distributed native apps are paid.
Treat remote terminal access as access to the working machine, not merely to a chat UI. End-to-end encryption protects data in transit; it does not decide who should be allowed to pair. Workspace root flags scope the browser and session creation, not necessarily terminal or agent execution. For shared deployments, review pairing and host privileges, upstream agent data handling, and the AGPL-3.0 obligations that apply if you modify and serve the software.
Hardware & Deployment Guide
On the work host, install and configure the agent you intend to use, then start the hub with npx @twsxtd/hapi hub --relay and launch an agent session with npx @twsxtd/hapi. Automation must specify the agent explicitly. The hub presents a URL and separate web and companion QR codes for client connection. Cloudflare Tunnel and Tailscale are alternative access paths. The machine must stay on and reachable while clients use its sessions; self-hosting the hub does not make an upstream agent work offline.
Source builds require Bun 1.4.4: run bun install followed by bun run build:single-exe. Recent releases show where the session workflow is evolving: v0.36.8 added local Cursor session import; v0.37.0 grouped spawned sessions under their leader and added web group dissolution; v0.37.1 brought group support, dissolution, and /sessions links to iOS.
hapi runner start --workspace-root flags to expose selected file trees for browsing and session creation.Developers and small teams that already run supported coding agents on a reachable machine and want remote approvals or session handoff without changing their terminal workflow.
You need a managed execution host, sandboxed execution for multiple users, or offline inference independent of the agent you choose.
Quick Start & Installation
npx @twsxtd/hapi hub --relay # start hub with E2E encrypted relay npx @twsxtd/hapi # choose an agent and start a session
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| hapi ★ | 5.5k | +68 | TypeScript | AGPL-3.0 | Local-first CLI and hub for handing off coding-agent sessions across devices |
| cc-switch | 159.1k | +1.7k | Rust | MIT | Tauri desktop manager for AI coding providers, local routing, and MCP config |
| magpie | 45.5k | +2.9k | Go | MIT | A local API gateway that pools model subscriptions across coding agents |
| herdr | 54.1k | +871 | Rust | Apache-2.0 | Rust terminal multiplexer for persistent, multi-machine coding-agent workspaces |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/tiann/hapi.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about hapi
Does HAPI replace the coding agent, and how do scripts start a session?
hapi lets you select an agent; scripts must name one explicitly, for example hapi codex.How much CPU, memory, or VRAM should I budget?
Can a company self-host HAPI, and what does AGPL-3.0 require?
How should I choose between HAPI, Happy, and the agent CLI on its own?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy