Skip to content

CLI Commands Reference

Complete reference for Happy Coder command-line interface.

Installation

bash
npm install -g happy-coder

Requirements:

  • Node.js 18 or later
  • Claude Code CLI installed

Basic Commands

Start Happy Coder

bash
happy

Starts the Happy Coder daemon, connecting your terminal session to the mobile app.

Device Pairing

bash
happy --auth

Displays QR code for pairing with mobile device.

Options:

FlagDescription
--qr-size largeDisplay larger QR code
--no-qrShow manual entry code instead

Version Information

bash
happy --version

Help

bash
happy --help

Configuration Options

Custom Server URL

bash
export HAPPY_SERVER_URL="https://your-server.com"
happy

Custom Session Name

bash
HAPPY_SESSION_NAME="frontend-project" happy

Custom Port

bash
happy --port 8766

Push Notifications

Test Notifications

bash
happy notify -p "message content" -t "Notification Title"
FlagDescription
-pMessage content
-tNotification title

Claude Code Integration

Happy Coder wraps Claude Code. All Claude Code commands work:

Plan Mode

bash
# In Happy session
/plan Add dark mode toggle

Custom Agents

bash
# In Happy session
/bedtime
/review
/your-custom-agent

Slash 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

VariableDefaultDescription
HAPPY_SERVER_URL(Slopus server)Relay server URL
HAPPY_SESSION_NAME(hostname)Session identifier
HAPPY_DEBUGfalseEnable debug logging

Self-Hosting Commands

Clone Server

bash
git clone https://github.com/slopus/happy-server
cd happy-server

Build 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:latest

Check Server Health

bash
curl http://localhost:3000/health

Troubleshooting Commands

Check Node.js Version

bash
node --version
# Should be v18.0.0 or higher

Check Claude Code Installation

bash
claude --version

Find Process Using Port

bash
# Linux/macOS
lsof -i :8765

# Windows
netstat -ano | findstr :8765

Kill Process

bash
# Linux/macOS
kill -9 <PID>

# Windows
taskkill /F /PID <PID>

Common Workflows

Morning Start

bash
cd ~/project
happy

Parallel 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" happy

Self-Host Setup

bash
# Configure client
export HAPPY_SERVER_URL="https://my-server.com"
happy --auth

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
127Command not found

Released under the MIT License.