CLI Commands Reference
Complete reference for Happy Coder command-line interface.
Installation
bash
npm install -g happy-coderRequirements:
- Node.js 18 or later
- Claude Code CLI installed
Basic Commands
Start Happy Coder
bash
happyStarts the Happy Coder daemon, connecting your terminal session to the mobile app.
Device Pairing
bash
happy --authDisplays QR code for pairing with mobile device.
Options:
| Flag | Description |
|---|---|
--qr-size large | Display larger QR code |
--no-qr | Show manual entry code instead |
Version Information
bash
happy --versionHelp
bash
happy --helpConfiguration Options
Custom Server URL
bash
export HAPPY_SERVER_URL="https://your-server.com"
happyCustom Session Name
bash
HAPPY_SESSION_NAME="frontend-project" happyCustom Port
bash
happy --port 8766Push Notifications
Test Notifications
bash
happy notify -p "message content" -t "Notification Title"| Flag | Description |
|---|---|
-p | Message content |
-t | Notification title |
Claude Code Integration
Happy Coder wraps Claude Code. All Claude Code commands work:
Plan Mode
bash
# In Happy session
/plan Add dark mode toggleCustom Agents
bash
# In Happy session
/bedtime
/review
/your-custom-agentSlash Commands
All Claude Code slash commands are supported:
/init- Initialize project/plan- Enter planning mode/agents- List available agents/help- Show help
Session Management
List Active Sessions
Sessions are managed through the mobile app. Each running happy instance appears as a session.
Multiple Sessions
Run multiple sessions on different machines or different directories:
bash
# Terminal 1
cd ~/frontend && happy
# Terminal 2
cd ~/backend && happy
# Terminal 3 (SSH to VPS)
ssh vps "cd ~/project && happy"Environment Variables
| Variable | Default | Description |
|---|---|---|
HAPPY_SERVER_URL | (Slopus server) | Relay server URL |
HAPPY_SESSION_NAME | (hostname) | Session identifier |
HAPPY_DEBUG | false | Enable debug logging |
Self-Hosting Commands
Clone Server
bash
git clone https://github.com/slopus/happy-server
cd happy-serverBuild Docker Image
bash
docker build -t happy-server:latest .Run Server
bash
docker run -d \
--name happy-server \
-p 3000:3000 \
-e DATABASE_URL="postgresql://..." \
-e REDIS_URL="redis://..." \
-e SEED="your-seed" \
happy-server:latestCheck Server Health
bash
curl http://localhost:3000/healthTroubleshooting Commands
Check Node.js Version
bash
node --version
# Should be v18.0.0 or higherCheck Claude Code Installation
bash
claude --versionFind Process Using Port
bash
# Linux/macOS
lsof -i :8765
# Windows
netstat -ano | findstr :8765Kill Process
bash
# Linux/macOS
kill -9 <PID>
# Windows
taskkill /F /PID <PID>Common Workflows
Morning Start
bash
cd ~/project
happyParallel Development
bash
# Set up worktrees first
git worktree add ../experiment-1 -b experiment-1
git worktree add ../experiment-2 -b experiment-2
# Run in separate terminals
cd ../experiment-1 && HAPPY_SESSION_NAME="exp-1" happy
cd ../experiment-2 && HAPPY_SESSION_NAME="exp-2" happySelf-Host Setup
bash
# Configure client
export HAPPY_SERVER_URL="https://my-server.com"
happy --authExit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 127 | Command not found |
