1 minute read

The Jupyterhub is a possibility to work interactively with the cluster and workstations provided by the Faculty of Physics at LMU. The only client required is a web browser. On login, you can specify the resources you need and the environment you would like to use. All environments include the Jupyterlab interface and a set of notebook types for different programming languages. In addition to the notebooks, a fully functional Linux terminal is also available. Please see here for information (Note that a valid uni account is needed to access the docs).

After you successfully login in to Jupyterhub session, open a terminal and use the following command:

module avail node

after which you should see available version of Node.js, eg. node/24.12.0, which is needed for installing Codex CLI. Load the module with:

module load node/24.12.0

To check if you have no problems until here, run:

node -v
npm -v

which shoud output the versions of node and npm.

Run the following in your home directory(which should be default after you login in) to install Codex CLI:

npm install -g @openai/codex

If you have authorization problems, try:

npm config set prefix ~/.npm-global
export NPM_CONFIG_PREFIX=$HOME/.npm-global
export PATH=$HOME/.npm-global/bin:$PATH

which adds the executable to your PATH environment variable temporarily.

After you successfully install the Codex CLI, run:

codex login

Then you could interact with Codex easily with command lines.

Alternatively, you could write a script(with a name codex-env.sh as an example):

#!/bin/bash

module load node/24.12.0
export NPM_CONFIG_PREFIX=$HOME/.local
export PATH=$HOME/.local/bin:$PATH
if ! command -v codex &> /dev/null
then
  echo "Installing Codex CLI..."
  npm install -g @openai/codex
fi
codex

and everytime you want to use Codex, just run the script with the command:

source ~/codex-env.sh

You could also use VS Code editor remotely(in the JupyterHub session) or locally if you prefer it and install the codex extension, which enables a chatbox alongside your code.