How to use OpenAI Codex with Anyscale Workspaces

I'm impressed with GPT-5 Pro and its integration into Codex. Here is how I got OpenAI Codex working on Anyscale Workspaces:

Things that didn't work

UPDATE: I figured out how to install Codex CLI with the help of... Codex. Here are copy-pastable instructions:

sudo apt-get update -y && sudo apt-get upgrade -y

# Remove old Node.js 12
sudo apt-get remove -y nodejs npm libnode-dev && sudo apt-get autoremove -y

# Add NodeSource repo for Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -

# Install Node.js 22 + build tools
sudo apt-get install -y nodejs build-essential

# Clean any partial Codex installs and cache
sudo npm uninstall -g @openai/codex || true
sudo rm -rf /usr/local/lib/node_modules/@openai/codex || true
sudo npm cache clean --force

# Install Codex CLI globally
sudo npm install -g @openai/codex

# Verify installation
codex --version

Then you can login using the Codex app in your local Cursor client. Sometimes that failed for me though, so I found this work-around: log in to Codex locally, then copy the credentials to the remote machine: anyscale workspace_v2 push --name my-workspace --local-dir ~/.codex -- --include='auth.json'

Copyright Ricardo Decal. ricardodecal.com