A Laravel + Livewire + Flux UI web console for streaming Codex CLI runs from your browser.
Codex Web is a browser UI for Codex CLI workflows. It streams Codex responses in real time, supports multi-turn sessions, and enforces workspace path boundaries on the server.
- Real-time streaming chat UI at
/driven by Livewire actions +wire:stream. - Session continuation using Codex thread IDs (
exec+exec resume). - Flux UI integration for shared, accessible UI primitives in the chat console.
- Configurable runtime controls in the UI:
- Workspace location (can be moved anywhere on the system)
- Working directory
- Additional writable directories
- Model
- Reasoning effort
--full-auto- Sandbox mode
- Approval policy
- Live web search
- Server-side path safety:
cwd/add_dirsmust resolve inside the selectedworkspace_root. - Responsive viewport behavior with internal panel scrolling on large screens.
- Laravel + Livewire (server-driven application and component rendering)
- Flux UI (official Livewire component library; free tier components in use)
- Tailwind CSS v4 (styling foundation, including Flux styles)
Codex Web validates and accepts these request fields:
prompt,session_id,workspace_root,model,reasoning_effort,full_auto,cwd,sandbox_mode,approval_policy,web_search,add_dirs
Current Codex CLI forwarding behavior in this app:
- Forwarded on new turns (
codex exec):model(--model)reasoning_effort(--config model_reasoning_effort=...)full_auto(--full-auto)sandbox_mode(--sandbox) when not full-autoapproval_policy(--ask-for-approval) when not full-autoweb_search(--search)cwd(--cd)add_dirs(--add-dir)
- Forwarded on resumed turns (
codex exec resume):model,reasoning_effort,full_auto,approval_policy,web_searchsession_id(resume target)
- PHP 8.2+
- Composer 2+
- Node.js 20+
- npm 10+
- SQLite 3+ (default) or another Laravel-supported database
- Codex CLI installed and authenticated
composer setupgit clone <your-repo-url> codex-web
cd codex-web
cp .env.example .env
composer install
npm install
php artisan key:generate
php artisan migrate
npm run buildcomposer devExpected local endpoints:
- App:
http://localhost:8000 - Health check:
http://localhost:8000/up
Codex runtime settings live in config/codex.php (overridable via .env):
CODEX_BINARYCODEX_WORKSPACE_ROOTCODEX_DEFAULT_CWDCODEX_DEFAULT_MODELCODEX_DEFAULT_REASONING_EFFORTCODEX_DEFAULT_FULL_AUTOCODEX_DEFAULT_SANDBOX_MODECODEX_DEFAULT_APPROVAL_POLICYCODEX_DEFAULT_SEARCHCODEX_SKIP_GIT_REPO_CHECKCODEX_PROCESS_TIMEOUT
php artisan test --compact
php artisan test --compact tests/Feature/ExampleTest.phpvendor/bin/pint --dirty --format agentnpm run build- Stream requests are validated by
app/Http/Requests/CodexStreamRequest.php. - The Livewire chat action enforces equivalent runtime/path validation before invoking Codex.
workspace_rootis validated as an existing directory.cwdandadd_dirsare resolved and constrained to the selectedworkspace_root.- Stream failures are converted into structured SSE error events.
- Routes use Laravel
webmiddleware (CSRF protection included). /,/codex/stream, and/codex/directoriesare unauthenticated by default; protect access before public exposure.
codex-web/
├── app/
│ ├── Http/Controllers/CodexStreamController.php
│ ├── Http/Controllers/CodexDirectoryController.php
│ ├── Http/Requests/CodexStreamRequest.php
│ ├── Livewire/CodexChat.php
│ └── Services/Codex/CodexCliStreamer.php
├── config/codex.php
├── resources/
│ ├── views/chat.blade.php
│ ├── views/livewire/codex-chat.blade.php
│ ├── css/app.css
│ └── js/app.js
├── routes/web.php
├── tests/Feature/CodexChatLivewireTest.php
├── tests/Feature/ExampleTest.php
├── composer.json
└── package.jsonLicensed under the MIT License.
