A DeepSeek-backed Codex launcher, fully isolated from your official Codex
Keep your ChatGPT subscription and run a fully independent Codex with DeepSeek.
DeepX combines the official OpenAI Codex installer with the official DeepSeek
setup script to build a fully independent Codex environment: the binary,
configuration, API key, logs, and caches all live under ~/.deepx and never
read, overwrite, or delete your existing ~/.codex subscription credentials.
deepx ──► private Codex (DeepSeek, ~/.deepx)
codex ──► global Codex (ChatGPT subscription, ~/.codex)
- Full isolation: a private
CODEX_HOMEkeeps config, auth, skills, plugins, and logs completely separate. - No auth conflicts: the DeepSeek API key is only written to
~/.deepx/codex-home/config.toml; your ChatGPT subscription is untouched. - Bidirectional session sharing:
sessions/is linked to the global~/.codex/sessions, socodex resumeworks from both sides. - Silent key entry: the API key is never echoed, and the environment variable is cleared before Codex starts.
- Hardened permissions:
umask 077throughout; sensitive files end up600and directories700. - Release-ready:
install.shone-liner install, SHA-256 verification, and GitHub Actions CI/Release workflows.
From a local checkout:
./install.shOr from a GitHub Release:
curl -fsSL https://github.com/JesmonX/deepx/releases/latest/download/install.sh | shThe installer puts deepx in ~/.local/bin/deepx and the private Codex in
~/.deepx/bin/codex. It never creates or replaces the global codex command.
If ~/.local/bin is not on PATH, it appends a clearly marked DeepX block to
your shell profile.
If
~/.deepxalready exists without the DeepX ownership marker, the installer aborts safely instead of taking over or deleting the directory.
deepxThe first run confirms the private Codex, downloads and runs the official
DeepSeek setup script, preselects deepseek-v4-flash, reads the API key
silently, hardens file permissions, and launches Codex.
Unattended setup:
DEEPSEEK_API_KEY='sk-...' deepx setup
deepx| Command | Description |
|---|---|
deepx |
Launch the isolated DeepSeek Codex (arguments pass through) |
deepx resume |
Resume any session from either side (private codex resume) |
deepx setup |
Install / repair the private runtime |
deepx config |
Open the official DeepSeek configuration menu |
deepx update [all|self|codex] |
Update DeepX and/or the private Codex |
deepx doctor [--json] |
Check isolation, permissions, sharing, and run codex doctor |
deepx version |
Show DeepX and private Codex versions |
deepx uninstall [--purge] |
Remove the runtime; --purge also deletes all private data |
DeepX checks for a new official Codex release at most once a day while
interactive and only warns — it never auto-upgrades. Disable with
DEEPX_DISABLE_UPDATE_CHECK=1.
DeepX symlinks its private sessions/ directory to ~/.codex/sessions, so
both sides can see and continue each other's sessions:
deepx resume # resume any session from either side inside DeepX
codex resume # resume any session from either side in global Codex- On first activation, DeepX archives its existing private sessions to
~/.deepx/state/private-sessions/instead of merging them into the global list; new sessions are visible on both sides. - Only resumable sessions are shared;
history.jsonl, memories, skills, plugins, auth, and config remain fully isolated. - Cross-environment resumes automatically use the current environment's model; Codex prints a one-time model-switch notice, which is expected.
- Disable sharing with
DEEPX_NO_SHARE_SESSIONS=1 deepx. - Keep both Codex versions aligned;
deepx doctorwarns when they differ.
For the first activation, close any running DeepX sessions first: if Codex processes are still writing to the private sessions directory,
deepx setupaborts with a message instead of moving live sessions.
~/.deepx/
├── bin/codex # private Codex binary
├── cache/ # download cache
├── codex-home/ # private CODEX_HOME
│ ├── config.toml # DeepSeek config (contains key, mode 600)
│ ├── models.json
│ ├── auth.json # only if you log in inside deepx
│ ├── packages/standalone/
│ ├── sessions -> ~/.codex/sessions
│ └── ...
└── state/
├── managed-by-deepx # DeepX ownership marker
└── private-sessions/ # archived private sessions from before sharing
Every private Codex invocation explicitly sets:
CODEX_HOME=$HOME/.deepx/codex-home
CODEX_SQLITE_HOME=$HOME/.deepx/codex-home
CODEX_INSTALL_DIR=$HOME/.deepx/bin
DeepX also pins the private model, provider, and model catalog at the highest
CLI precedence, and stops parent-directory project discovery outside Git repos
so ~/.codex/config.toml is never misread as a project config. In-repo
.codex and AGENTS.md discovery is preserved.
- The API key is stored in the private
config.toml(mode600) inside a700directory, using the official DeepSeek format. - Key input is never echoed;
DEEPSEEK_API_KEYis removed from the environment before Codex launches, so spawned shell commands cannot see it. deepx uninstallremoves only the runtime and keeps config and key;deepx uninstall --purgedeletes all of~/.deepxafter confirmation.- Uninstall never touches the shared sessions under
~/.codex/sessions.
bash -n deepx tests/run.sh
sh -n install.sh
./tests/run.shThe tests use a temporary HOME and local fixture scripts — no real API key,
no access to the real home directory. They place auth and session sentinels in
a fake ~/.codex and verify that everything except sessions/ stays
byte-for-byte identical, and cover session-sharing migration, bidirectional
visibility, and uninstall safety.
- Codex installer: https://chatgpt.com/codex/install.sh
- DeepSeek setup script: https://cdn.deepseek.com/api-docs/codex-deepseek-setup.sh
MIT License. See LICENSE.