π₯οΈ A standalone local Codex workspace for account orchestration, OAuth flows, API key management, and terminal-native control
β¨ Local-first Β· π OAuth-ready Β· π§© Standalone Β· π₯οΈ CLI + TUI + Daemon
codextui is now a fully standalone local project.
It no longer depends on codex-lb as a backend service.
While it borrows ideas from codex-lb for:
- π account importing
- π OAuth flows
- πͺͺ API key management
the rest is owned and maintained by this project itself:
- π its own data directory
- π§ its own control logic
- π±οΈ its own interaction model
- πͺ its own startup entrypoints
- βοΈ its own local daemon runtime
In practice, codextui is a local Codex control workspace built for managing accounts, API keys, OAuth state, and runtime settings through either a terminal shell, a full-screen dashboard, or a long-running daemon.
No hard dependency on codex-lb.
Persistence, control flow, and runtime behavior live inside this project.
Accounts, keys, and settings are stored locally and survive restarts.
Browser flow, device flow, manual callback handling, and polling are all supported.
Run it as:
- π¬
CLI shell - π§
Dashboard TUI - βοΈ
Daemon service
Import a single auth.json, or recursively scan a directory for auth.json / *.json.
Create, update, enable, disable, reset, and delete keys from local control surfaces.
Keep a daemon alive 24/7 and attach local CLI/TUI clients at any time.
Current versions of codextui already support:
- β local persistent storage for accounts, API keys, and settings
- β
startup mode selection:
CLI shell,Dashboard TUI, orDaemon service - β
single-file
auth.jsonimport - β
recursive batch import for
auth.json/*.json - β OAuth browser flow
- β OAuth device flow
- β manual callback handling
- β device polling
- β pause / resume / delete account operations
- β create / update / enable / disable / reset / delete API keys
- β local settings management
- β daemon mode for long-running local or Docker deployments
- β remote CLI/TUI clients connecting to daemon backends
codextui is built on a terminal-first Python stack:
- π Python 3.11+
- πΌοΈ Textual β full-screen TUI framework
- π¨ Rich β terminal rendering and formatting
- β¨οΈ prompt_toolkit β interactive command shell experience
- π httpx β persistent HTTP sessions
- π¦ pydantic β validated data models
Recommended: create a virtual environment first, then install in editable mode.
cd codextui
python3 -m venv .venv
.venv/bin/pip install -e .cd codextui
.venv/bin/codextuiBy default, codextui opens a startup mode selector:
1β π¬CLI shell2β π§Dashboard TUI3β βοΈDaemon service
You can also launch a mode directly:
.venv/bin/codextui --mode cli
.venv/bin/codextui --mode tui
.venv/bin/codextui --mode daemonYou may also set a custom local data directory:
export CODEXTUI_DATA_DIR=~/.codextui
.venv/bin/codextui --data-dir ~/.codextuiThe CLI shell is the pure terminal command mode.
It does not use the full-screen Textual dashboard and is designed for users who prefer a coding-tool style workflow.
- π command history
- β‘
/-triggered command suggestions - βοΈ prefix completion such as
/heor/key up - π stdin fallback in non-interactive pipeline scenarios
/help
/overview
/accounts
/import /path/to/auth.json
/oauth browser
/oauth device start
/oauth device poll
/keys
/key create
/key update <id-or-name>
/settings
/settings set listen_port 8088
/exitThe Dashboard TUI provides a richer full-screen workspace powered by Textual.
-
π left panel shows:
- data directory
- overview state
- global logs
-
π when launched with
--daemon-url, the dashboard uses the daemon as backend instead of touching localdata.json -
π€
Accountspage supports:- single-file import
- recursive directory import
- browser/device OAuth launch
-
π
API Keyspage supports an update form where:- blank = do not modify
-= clear the field
-
βοΈ
Settingspage can edit:- Auth base URL
- OAuth redirect URI
- callback bind host / port
- default listen port
The Daemon service is the long-running backend mode.
It holds the real data directory and OAuth session state, while CLI/TUI instances can behave as lightweight frontends.
cd codextui
.venv/bin/codextui --mode daemon --data-dir ~/.codextui --daemon-host 127.0.0.1 --daemon-port 8099Then connect from another terminal:
.venv/bin/codextui --mode cli --daemon-url http://127.0.0.1:8099
.venv/bin/codextui --mode tui --daemon-url http://127.0.0.1:8099- ποΈ daemon owns the real storage and OAuth state
- π CLI/TUI clients can be opened or closed freely
- π€ even if the daemon runs inside Docker, commands like
/import /path/to/auth.jsonstill work, because the client uploads file contents to the daemon rather than asking the container to read host paths directly
To run codextui as a long-lived Docker service:
cd codextui
docker compose up -d --build- π daemon API:
http://127.0.0.1:8099 - π OAuth callback mapping:
1455:1455 - πΎ persistent storage directory:
./docker-data
Host-side CLI/TUI can connect using:
.venv/bin/codextui --mode cli --daemon-url http://127.0.0.1:8099
.venv/bin/codextui --mode tui --daemon-url http://127.0.0.1:8099If browser OAuth is used in Docker mode, keep the callback port mapping enabled because the redirect target is:
http://localhost:1455/auth/callback
If host port 1455 is already occupied, remap it like this:
cd codextui
CODEXTUI_OAUTH_REDIRECT_PORT=2455 docker compose up -d --buildThis compose setup will automatically:
- π map host
2455β container1455 - π override daemon
oauth_redirect_uritohttp://localhost:2455/auth/callback - π keep the container listener on
0.0.0.0:1455
Import, pause, resume, and delete account records.
Support both browser-based and device-based authorization flows, including callback handling and polling.
Provide full lifecycle control for local API keys, including reset and enable/disable operations.
Configure listener ports, callback addresses, model defaults, import strategies, and related runtime parameters.
The following checks have already been performed locally:
python3 -m compileall src- β
installed dependencies in local
.venvwithpip install -e . - β import check:
from codextui.app import CodexTuiApp- β Textual mount check:
CodexTuiApp(...).run_test()- β entrypoint check:
.venv/bin/codextui --help- β CLI mode check:
.venv/bin/codextui --mode cli- β
daemon health check:
GET /v1/health - β remote CLI connection check:
.venv/bin/codextui --mode cli --daemon-url http://127.0.0.1:8099codextui is already a usable standalone application for:
- πΎ local persistence
- π€ account import and lifecycle management
- π OAuth flows
- π API key operations
- βοΈ daemon runtime
- π³ Docker deployment
- π₯οΈ remote CLI/TUI client connections
At the current stage, the main focus remains:
account management + OAuth + API key operations + local state control
The full local OpenAI-compatible proxy server has not yet been completely migrated into this project.
This split is intentional.
By building the control plane first, codextui gets:
- π§± a cleaner standalone foundation
- π§ independent local runtime control
- π freedom from
codex-lbcoupling - β»οΈ reusable account import and key management workflows
- π a better path toward future local API server integration
In other words, codextui is being shaped as the workspace and control layer first, with proxy/service expansion ready to be added later.
Possible next directions include:
- π local OpenAI-compatible API server integration
- βοΈ deeper daemon orchestration
- π richer account scheduling / routing strategies
- π better observability panels in TUI
- π³ stronger Docker-native workflows
- π€ broader terminal automation support
codextui is not just a thin wrapper around older tooling.
It is intended to become a standalone local operations surface for:
- account control
- OAuth handling
- API key lifecycle
- terminal-native management workflows
- future local service orchestration
That is why the current implementation prioritizes a solid local foundation before moving further into proxy/server expansion.