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:
- Use the Workspace's
Open in Cursorbutton. This will open Cursor and connect it to the remote cluster using SSH. - In your local Cursor IDE, install the OpenAI Codex extension. This will install the extension in the remote server.
- Login.
Things that didn't work
- Trying to install the Codex extension directly within VSCode in Anyscale Workspaces results in the error:
Can't install 'openai.chatgpt' extension because it is not compatible with the current version of CodeOSS (version 1.88.1).- I don't understand why I am able to install the Codex extension on the cluster from my Cursor client, but am unable to install the Codex extension in the cluster directly.
- Installing Codex CLI with
npm i -g @openai/codex. It throws an error about requiring a newer version ofnpm, which is unavailable in the OS that Anyscale Workspaces uses (Ubuntu 22.04.5 LTS).
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'