Official public Codex install

Install the latest official Codex CLI.

Use the official public OpenAI Codex CLI with a ChatPlus-issued API key. The dashboard generates the exact command with your key already inserted.

Public OpenAI Codex with ChatPlus

apt-get update
apt-get install -y ca-certificates curl gnupg
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs npm
node --version
npm --version
npm install -g @openai/codex@latest
export CHATPLUS_CODEX_API_KEY="cxapi_your_dashboard_key"
codex --search -m gpt-5.5 \
  -c 'preferred_auth_method="apikey"' \
  -c 'model_provider="chatplus"' \
  -c 'model_providers.chatplus.name="ChatPlus"' \
  -c 'model_providers.chatplus.base_url="https://chatplus.chat/v1"' \
  -c 'model_providers.chatplus.env_key="CHATPLUS_CODEX_API_KEY"' \
  -c 'model_providers.chatplus.wire_api="responses"' \
  -c 'model_providers.chatplus.supports_websockets=false' \
  -c 'model_reasoning_effort="medium"'

This installs the latest official public `@openai/codex` package and starts it against the ChatPlus Responses-compatible API at `https://chatplus.chat/v1`. The current ChatPlus compatibility target is Codex CLI `0.130.0`. Your dashboard shows the exact command with your own key already inserted.

Public Codex smoke test

export CHATPLUS_CODEX_API_KEY="cxapi_your_dashboard_key"
codex --search exec --skip-git-repo-check \
  -m gpt-5.5 \
  -c 'preferred_auth_method="apikey"' \
  -c 'model_provider="chatplus"' \
  -c 'model_providers.chatplus.name="ChatPlus"' \
  -c 'model_providers.chatplus.base_url="https://chatplus.chat/v1"' \
  -c 'model_providers.chatplus.env_key="CHATPLUS_CODEX_API_KEY"' \
  -c 'model_providers.chatplus.wire_api="responses"' \
  -c 'model_providers.chatplus.supports_websockets=false' \
  -c 'model_reasoning_effort="medium"' \
  "Say hello from ChatPlus."

Use this after installation to confirm the stock public Codex CLI is authenticated as a ChatPlus API user and billing against the wallet behind that key.

Already logged into OpenAI Codex

CODEX_HOME="$HOME/.chatplus-codex" \
CHATPLUS_CODEX_API_KEY="cxapi_your_dashboard_key" \
codex --search \
  -m gpt-5.5 \
  -c 'preferred_auth_method="apikey"' \
  -c 'model_provider="chatplus"' \
  -c 'model_providers.chatplus.name="ChatPlus"' \
  -c 'model_providers.chatplus.base_url="https://chatplus.chat/v1"' \
  -c 'model_providers.chatplus.env_key="CHATPLUS_CODEX_API_KEY"' \
  -c 'model_providers.chatplus.wire_api="responses"' \
  -c 'model_providers.chatplus.supports_websockets=false' \
  -c 'model_reasoning_effort="medium"'

This variant uses a separate `CODEX_HOME` and explicit provider overrides, so ChatPlus API details win for this run even if the user is already logged into the official OpenAI Codex CLI.

Windows PowerShell setup

# Run this first block in PowerShell as Administrator:
winget source update
winget install --id OpenJS.NodeJS.LTS -e --accept-package-agreements --accept-source-agreements
winget install --id Git.Git -e --accept-package-agreements --accept-source-agreements
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force

# Close PowerShell, open a new PowerShell window, then run:
node --version
npm --version
git --version
npm install -g @openai/codex@0.130.0
codex --version

$env:CODEX_HOME = "$HOME\.chatplus-codex"
$env:CHATPLUS_CODEX_API_KEY = "cxapi_your_dashboard_key"
New-Item -ItemType Directory -Force -Path $env:CODEX_HOME | Out-Null
@'
model = "gpt-5.5"
preferred_auth_method = "apikey"
model_provider = "chatplus"
model_reasoning_effort = "medium"

[model_providers.chatplus]
name = "ChatPlus"
base_url = "https://chatplus.chat/v1"
env_key = "CHATPLUS_CODEX_API_KEY"
wire_api = "responses"
supports_websockets = false
'@ | Set-Content -Path (Join-Path $env:CODEX_HOME "config.toml") -Encoding utf8

$env:CODEX_HOME = "$HOME\.chatplus-codex"; $env:CHATPLUS_CODEX_API_KEY = "cxapi_your_dashboard_key"; codex --search -m gpt-5.5

Use PowerShell syntax on Windows. The Codex version must show codex-cli 0.130.0. To resume later, run codex resume --last --search -m gpt-5.5 with the same CODEX_HOME and API key variables set.

ChatPlus-managed CLI

apt-get update
apt-get install -y ca-certificates curl gnupg
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs npm
node --version
npm --version
npm install -g @embire2/codex@latest
chatplus-codex login

This installs curl, certificate tooling, Node.js 22, npm, then installs the current ChatPlus-managed CLI package from the public npm registry. Use this when you want the CLI to manage ChatPlus login and updates directly.

Pinned npm tarball

npm install -g https://registry.npmjs.org/@embire2/codex/-/codex-0.129.0.tgz
chatplus-codex login

Use this exact npm registry tarball URL for pinned installs or networks with stale package metadata.

Hosted tarball fallback

npm install -g https://chatplus.chat/downloads/embire2-codex-0.129.0.tgz
chatplus-codex login

Use this pinned tarball if a client network or npm registry cache cannot resolve the scoped package name yet.

Source location on this server

/root/codexcli/codex-cli

The hosted tarball is generated from this exact directory using `npm pack`.

Register npm package

cd /root/codexcli/codex-cli
set -a
. /root/codexcli/.env
set +a
npm whoami
npm publish --access public

The package is published under the `embire2` organization scope. Future releases must use a new version number before publishing.