MCPcopy Index your code
hub / github.com/tiann/hapi

github.com/tiann/hapi @v0.20.2

repository ↗ · DeepWiki ↗ · release v0.20.2 ↗ · Ask this repo → · + Follow
5,131 symbols 15,518 edges 1,021 files 239 documented · 5% updated 6d agov0.20.2 · 2026-06-11★ 4,415114 open issues
README

HAPI

Run official Claude Code / Codex / Gemini / OpenCode sessions locally and control them remotely through a Web / PWA / Telegram Mini App.

Why HAPI? HAPI is a local-first alternative to Happy. See Why Not Happy? for the key differences.

Features

  • 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.
  • 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.
  • Workspace Browser - Opt-in via one or more hapi runner start --workspace-root <path> flags: browse scoped file trees from the web and start sessions in allowed subdirectories.

Demo

https://github.com/user-attachments/assets/38230353-94c6-4dbe-9c29-b2a2cc457546

Getting Started

npx @twsxtd/hapi hub --relay     # start hub with E2E encrypted relay
npx @twsxtd/hapi                 # run claude code

hapi server remains supported as an alias.

The terminal will display a URL and QR code. Scan the QR code with your phone or open the URL to access.

The relay uses WireGuard + TLS for end-to-end encryption. Your data is encrypted from your device to your machine.

For self-hosted options (Cloudflare Tunnel, Tailscale), see Installation

Docs

Build from source

bun install
bun run build:single-exe

Credits

HAPI means "哈皮" a Chinese transliteration of Happy. Great credit to the original project.

Extension points exported contracts — how you extend this code

HubInstance (Interface)
(no doc) [9 implementers]
hub/src/startHub.d.ts
VoiceSession (Interface)
(no doc) [6 implementers]
web/src/realtime/types.ts
InstalledPluginsFile (Interface)
* Interface for installed_plugins.json structure
cli/src/modules/common/slashCommands.ts
PlatformSha (Interface)
(no doc)
cli/scripts/update-homebrew-formula.ts
SessionInfo (Interface)
(no doc)
hub/scripts/cleanup-sessions.ts
ServerToClientEvents (Interface)
(no doc)
shared/src/socket.ts
Window (Interface)
(no doc)
web/e2e-fixtures/scratchlist-fixture.tsx
Props (Interface)
(no doc)
website/src/components/ErrorBoundary.tsx

Core symbols most depended-on inside this repo

push
called by 853
cli/src/utils/MessageQueue2.ts
debug
called by 615
cli/src/ui/logger.ts
get
called by 458
hub/src/socket/terminalRegistry.ts
isObject
called by 265
shared/src/utils.ts
cn
called by 263
website/src/lib/utils.ts
error
called by 164
cli/src/claude/sdk/stream.ts
asString
called by 159
cli/src/codex/utils/codexEventConverter.ts
handleUpdate
called by 131
cli/src/agent/backends/acp/AcpMessageHandler.ts

Shape

Function 3,470
Method 1,178
Interface 254
Class 229

Languages

TypeScript100%

Modules by API surface

cli/src/codex/codexRemoteLauncher.ts114 symbols
hub/src/sync/syncEngine.ts93 symbols
web/src/api/client.ts72 symbols
hub/src/web/routes/codexDesktop.ts68 symbols
web/src/lib/message-window-store.ts61 symbols
cli/src/agent/backends/acp/AcpSdkBackend.ts46 symbols
web/src/components/ToolCard/views/_results.tsx45 symbols
web/src/components/assistant-ui/markdown-text.tsx41 symbols
web/src/components/SessionList.tsx40 symbols
hub/src/cursor/cursorLegacyMigrator.ts39 symbols
cli/src/codex/codexRemoteLauncher.test.ts36 symbols
cli/src/opencode/utils/opencodeStorageScanner.ts35 symbols

Dependencies from manifests, versioned

@assistant-ui/react0.11.53 · 1×
@builder.io/vite-plugin-jsx-loc0.1.1 · 1×
@elevenlabs/react0.13.0 · 1×
@hapi/protocolworkspace:* · 1×
@hookform/resolvers5.2.2 · 1×
@lobehub/icons5.4.0 · 1×
@modelcontextprotocol/sdk1.25.1 · 1×
@playwright/test1.60.0 · 1×
@radix-ui/react-accordion1.2.12 · 1×
@radix-ui/react-alert-dialog1.1.15 · 1×
@radix-ui/react-aspect-ratio1.1.7 · 1×

For agents

$ claude mcp add hapi \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact