SilverMarcs/CodexUI

A native macOS application that provides a graphical interface for the OpenAI Codex CLI.

★ 0Forks 0GitHub ↗Compare

README

CodexUI

A native macOS application that provides a graphical interface for the OpenAI Codex CLI. CodexUI enables AI-assisted coding with seamless Xcode integration.

CodexUI.mp4

How It Works

CodexUI spawns the Codex CLI as a subprocess:

  • Subprocess Communication: Executes Codex via /bin/zsh and communicates through stdin/stdout pipes
  • Real-time Streaming: Responses stream as they're generated
  • Session Persistence: Uses --resume-last-session to maintain conversation context across turns
  • Xcode Integration: Reads your active Xcode file and selection via the Accessibility API, providing context to Codex automatically

Prerequisites

1. Install Codex CLI

npm install -g @openai/codex

2. Authenticate

codex auth

This creates the required configuration files in ~/.codex/.

Permissions

Accessibility Permission

Required for Xcode integration. Grant access at:

System Settings > Privacy & Security > Accessibility > CodexUI

This allows CodexUI to read your Xcode workspace." or "This enables access to your Xcode workspace.

Image

Profiles

CodexUI comes with pre-built profiles that control sandbox and approval behavior:

Image
Intent Flags Effect
Safe read-only browsing --sandbox read-only --ask-for-approval on-request Codex can read files and answer questions. Requires approval to make edits, run commands, or access network.
Read-only non-interactive (CI) --sandbox read-only --ask-for-approval never Reads only; never escalates
Let it edit the repo, ask if risky --sandbox workspace-write --ask-for-approval on-request Codex can read files, make edits, and run commands in the workspace. Requires approval for actions outside the workspace or for network access.
Auto (preset; trusted repos) --full-auto Codex runs sandboxed commands that can write inside the workspace without prompting. It escalates only when it must leave the sandbox.
YOLO (not recommended) --dangerously-bypass-approvals-and-sandbox No sandbox; no prompts

See Codex sandbox documentation for more details.

Users can also create their own profiles

Image

Global Features

Configure global feature toggles that apply to all Codex sessions, regardless of the selected profile. These settings are stored in ~/.codex/config.toml under the [features] section.

Image

Standard Features:

  • View Image Tool - Allow viewing images in responses (default: enabled)
  • Web Search - Search the web for up-to-date information (default: disabled)

Advanced Features (hidden by default):

  • Unified Exec, Rust MCP Client, Apply Patch Freeform, Sandbox Command Assessment, Ghost Commit

Access these settings via the Settings panel in CodexUI.

Sessions

Easy access to your Codex sessions, initiated in CodexUI

Image

Local Codex Configuration

CodexUI reads local Codex CLI configuration from ~/.codex/ via CodexConfigService.

What it reads

  • config.toml: model and model_reasoning_effort
  • version.json: latest_version (used as the displayed CLI version)
  • auth.json: tokens.id_token (JWT payload) for email and chatgpt_plan_type

When it updates

  • CodexConfigService loads on app start and can be refreshed with refresh() to re-read the files.

Context Management

Screenshot 2025-12-01 at 3 17 12 PM

Voice Mode (Experimental)

CodexUI includes experimental voice input powered by CodeWhisper.

Requirements

Important: Voice mode requires a separate OpenAI API key for speech-to-text transcription (Whisper API). This is not the same as your Codex CLI credentials - you need to provide an OpenAI API key separately.

Setup

  1. Long-press the voice button (waveform icon) in the chat input area
  2. Enter your OpenAI API key in the CodeWhisper settings
  3. Grant microphone permission when prompted

Usage

  • When the text field is empty, a voice button appears instead of the send button
  • Tap to start recording, tap again to stop
  • Your speech will be transcribed and sent as a message

Development

Building

  1. Clone the repository
  2. Open CodexUI.xcodeproj in Xcode
  3. Build and run the CodexUI target

Dependencies

  • CodexSDK - Codex CLI execution client
  • Down - Markdown rendering
  • highlightswift - Syntax highlighting
  • SQLite.swift - Session persistence
  • KeyboardShortcuts - Global keyboard shortcuts
  • CodeWhisper - Voice input (STT)

Project Structure

CodexUI/
├── Chat/
│   ├── ViewModels/      # ChatViewModel, SessionManager, ContextManager
│   ├── Views/           # ChatScreen, ChatInputView, SettingsView
│   ├── Models/          # ChatMessage, CodexProfile, FileAttachment
│   └── Services/        # CodexConfigService, ProfileManager
├── Services/
│   ├── AccessibilityService/   # Xcode UI reading
│   ├── XcodeObserverService/   # Live Xcode monitoring
│   └── TerminalService/        # Process execution
└── CodexUIApp.swift     # App entry point

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

Contributors

jamesrochabrun

Issues