mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
aa0c3f2f0d5e1d5b94b98304b9e907b49a4e64d3
Restructure CLI entry point and RPC handler registration to improve maintainability: - Introduce command registry pattern with CommandDefinition interface for consistent command structure - Extract individual command modules (claude, codex, daemon, doctor, gemini, auth, connect, etc.) - Move RPC handlers into separate feature modules (bash, files, git, directories, ripgrep, difftastic, slashCommands) - Create shared RPC types and response helpers (rpcTypes.ts, rpcResponses.ts) - Move SpawnSessionOptions and SpawnSessionResult to rpcTypes for proper type organization - Simplify index.ts to minimal entrypoint using command registry - Update imports in apiMachine.ts and daemon/run.ts to use rpcTypes module This enables: - Better code organization by feature/command - Easier testing of individual commands - Safer RPC handler registration without side effects - Clearer separation of concerns between routing and business logic
HAPI
HAPI means "哈皮" a Chinese transliteration of Happy. Great credit to the original project.
Run Claude Code / Codex / Gemini 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 with native Claude Code or Codex, switch to remote when needed, switch back anytime.
- 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.
Getting Started
npx @twsxtd/hapi server # start the server locally
npx @twsxtd/hapi # run claude code
Open http://<server-ip>:3006 and login with the token, if you need to access it remotely, see Remote access
More options: Quick Start | Installation
Docs
Build from source
bun install
bun run build:single-exe
Languages
TypeScript
99.5%
CSS
0.2%
JavaScript
0.2%
HTML
0.1%