happy auth command manages authentication with Happy cloud services and registers your machine for remote sessions.
Syntax
Subcommands
login
Authenticate with Happy and register your machine.Force re-authentication by clearing existing credentials, machine ID, and stopping the daemon before re-authenticating
logout
Remove all authentication data and machine registration.status
Display current authentication status and machine information.Description
Happy uses a secure authentication system where:- Your master secret never leaves your mobile/web device
- Each CLI machine receives a derived key for per-machine encryption
- All communication is end-to-end encrypted
- Backup codes cannot be displayed from the CLI (only from mobile/web)
Examples
First-Time Authentication
Check Authentication Status
Force Re-authentication
Logout
Authentication Flow
Initial Setup
- Generate Keys: Happy generates a keypair on your CLI machine
- Display QR Code: A QR code with authentication challenge is shown
- Scan with Mobile: Use the Happy mobile app to scan the QR code
- Approve on Mobile: Approve the machine registration on your mobile device
- Receive Token: CLI receives encrypted authentication token
- Register Machine: Machine is registered with Happy cloud
- Store Locally: Credentials are securely stored in
~/.happy/
Security Model
Your master secret is stored only on your mobile/web device. Each CLI machine receives a unique derived key that cannot access your master secret or other machines’ keys.
- End-to-end encryption: All communication encrypted with TweetNaCl
- Per-machine keys: Each machine has isolated credentials
- Challenge-response: Prevents replay attacks
- Secure storage: Keys stored with restricted file permissions
Credential Storage
Location
Credentials are stored in:- Production:
~/.happy/access.key - Development:
~/.happy-dev/access.key
- Production:
~/.happy/settings.json - Development:
~/.happy-dev/settings.json
File Permissions
Credential files are created with restricted permissions (600) for security:Contents
Theaccess.key file contains:
- Authentication token from Happy cloud
- Encrypted keypair for secure communication
settings.json file contains:
- Machine ID
- Sandbox configuration
- Chrome mode settings
- Other preferences
Troubleshooting
QR Code Not Scanning
If the QR code doesn’t scan:- Ensure good lighting
- Try maximizing your terminal window
- Use the mobile app’s manual entry option
- Check that mobile app is up to date
Authentication Timeout
If authentication times out:Machine Already Registered
If you see “Already authenticated”:Credentials But No Machine ID
If you have credentials but no machine ID:Daemon Issues
If the daemon doesn’t stop during re-authentication:Can’t Connect to Server
If authentication fails with network errors:Multiple Machines
You can authenticate Happy on multiple machines:- Run
happy auth loginon each machine - Scan the QR code on each machine separately
- Each machine gets a unique machine ID
- All machines share the same user account
- Control any machine from the mobile app
Listing Machines
View all registered machines in the Happy mobile app:- Open Settings
- Tap “Machines”
- See all registered machines and their status
Removing Machines
To remove a machine:- Open Settings → Machines
- Swipe left on the machine
- Tap “Remove”
Environment Variables
Override the Happy server URL (for development/testing)
Override the Happy data directory location
Related Commands
- happy - Start Claude Code sessions
- happy daemon - Manage background daemon
- happy connect - Connect AI vendor API keys
- happy doctor - System diagnostics
You must authenticate with
happy auth login before using any Happy features. This is a one-time setup per machine.