happy codex command starts a Codex-powered coding agent that provides AI assistance using OpenAI’s models.
Syntax
Description
Codex is an AI coding agent that:- Uses OpenAI’s language models
- Provides intelligent code suggestions and modifications
- Executes commands with configurable permissions
- Supports mobile control and remote sessions
- Integrates with Happy’s MCP (Model Context Protocol) server
You need to connect your OpenAI API key first using
happy connect codex.Options
Indicates how the session was started. Options:
daemon or terminal. Internal useDisable Happy sandbox for this Codex session
Setup
Before using Codex, you must connect your OpenAI API key:Examples
Start Codex Session
Disable Sandbox
Check Connection Status
Output
When you start Codex, you’ll see an interactive terminal interface:- User messages and prompts
- Assistant responses
- Tool executions and command outputs
- Reasoning steps (thinking process)
- Status updates
Session Features
Permission Modes
Codex respects permission modes set from the mobile app:- default: Ask before executing commands
- effective: Auto-approve safe operations
- bypassPermissions: Auto-approve all operations
- yolo: No permission checks (dangerous)
Model Selection
You can specify models from the mobile app. Common options:gpt-4o(default)gpt-4-turbogpt-3.5-turbo
Reasoning and Tool Use
Codex provides visibility into its thought process:Session Management
Remote Control
Control Codex from your mobile device:- Start a Codex session on your computer
- Open the Happy mobile app
- Send prompts and receive real-time updates
- Abort or resume sessions remotely
Session Resume
Codex automatically handles session continuation:- Previous context is preserved
- Conversation history maintained
- File modifications tracked
Abort and Kill
MCP Integration
Codex includes Happy’s MCP server for enhanced capabilities:- Session metadata access
- Permission management
- Mobile device communication
- Real-time updates
Configuration Files
Codex Home Directory
Session Files
Codex stores sessions in JSONL format:Troubleshooting
Authentication Required
If you see “Not authenticated with Happy”:API Key Not Connected
If Codex fails to start:Check Logs
View detailed logs for debugging:~/.happy/logs/ or ~/.happy-dev/logs/.
Session Stuck
If a Codex session becomes unresponsive:Related Commands
- happy connect - Connect OpenAI API key
- happy sandbox - Configure sandboxing
- happy gemini - Alternative AI agent
- happy acp - Generic ACP agent runner
- happy doctor - System diagnostics