Skip to content
JesmonXPublic

About

Keep your ChatGPT subscription and run a fully independent Codex with DeepSeek.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

DeepX

A DeepSeek-backed Codex launcher, fully isolated from your official Codex

Version Platform Shell License

Keep your ChatGPT subscription and run a fully independent Codex with DeepSeek.

English | 简体中文


Overview

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)

Features

  • Full isolation: a private CODEX_HOME keeps 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, so codex resume works from both sides.
  • Silent key entry: the API key is never echoed, and the environment variable is cleared before Codex starts.
  • Hardened permissions: umask 077 throughout; sensitive files end up 600 and directories 700.
  • Release-ready: install.sh one-liner install, SHA-256 verification, and GitHub Actions CI/Release workflows.

Quick Start

Install

From a local checkout:

./install.sh

Or from a GitHub Release:

curl -fsSL https://github.com/JesmonX/deepx/releases/latest/download/install.sh | sh

The 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 ~/.deepx already exists without the DeepX ownership marker, the installer aborts safely instead of taking over or deleting the directory.

First Run

deepx

The 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

Commands

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.

Session Sharing

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 doctor warns 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 setup aborts with a message instead of moving live sessions.

Isolation Layout

~/.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.

Security

  • The API key is stored in the private config.toml (mode 600) inside a 700 directory, using the official DeepSeek format.
  • Key input is never echoed; DEEPSEEK_API_KEY is removed from the environment before Codex launches, so spawned shell commands cannot see it.
  • deepx uninstall removes only the runtime and keeps config and key; deepx uninstall --purge deletes all of ~/.deepx after confirmation.
  • Uninstall never touches the shared sessions under ~/.codex/sessions.

Development & Testing

bash -n deepx tests/run.sh
sh -n install.sh
./tests/run.sh

The 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.

Upstream

License

MIT License. See LICENSE.

About

Keep your ChatGPT subscription and run a fully independent Codex with DeepSeek.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages