Skip to content

Install Codex CLI with file-based auth - #12

Merged
skpark-rh merged 2 commits into
mainfrom
codex-installation
Aug 31, 2026
Merged

skpark-rh merged 2 commits into
mainfrom
codex-installation

Conversation

@qqaatw

@qqaatw qqaatw commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the Codex CLI to the devcontainer and provisions its credentials using the same file-based pattern as the existing gcloud/Vertex setup.

Changes

  • .devcontainer/Dockerfile: install Codex in Layer 6 right after Claude, via curl -fsSL https://chatgpt.com/codex/install.sh | HOME=/home/devuser bash (installs into devuser's home; ~/.local/bin is already on PATH).
  • create_dev_user.sh: new required codex auth.json path prompt; uploads it as the <username>-codex-config secret (delete-then-create, mirroring the gcloud block).
  • deployment/deployment.yml + deployment-rdma.yml: mount that secret read-only at ~/.codex/auth.json via subPath, analogous to the gcloud creds mount.

Auth method

Uses Codex's file credential store ($CODEX_HOME/auth.json, default ~/.codex), per the auth docs. A subPath mount is used (rather than mounting the whole dir like gcloud) so ~/.codex stays writable for Codex's config/logs/session state on the PVC — matching the existing bazelrc/gdbinit subPath convention.

Intended for a static OpenAI API key in auth.json (generate with printenv OPENAI_API_KEY | codex login --with-api-key). Since an API key is never refreshed, the read-only mount is sufficient. With no OS keyring in the container, the default cli_auth_credentials_store = auto falls back to file on its own, so no extra config is required.

qqaatw added 2 commits August 31, 2026 10:35
Install the Codex CLI in the devcontainer image (Layer 6, alongside the Claude
install), and provision its credentials the same way as the gcloud/Vertex ones:

- create_dev_user.sh prompts for a codex auth.json path and uploads it as the
  <username>-codex-config secret.
- Both deployments mount that secret read-only at ~/.codex/auth.json via subPath,
  so Codex uses file-based auth while the rest of ~/.codex stays writable.

Intended for a static OpenAI API key in auth.json (no token refresh), so the
read-only mount is sufficient.
Both images install the Claude CLI in Layer 6; add the Codex install next to it,
matching the main Dockerfile. runtime.Dockerfile is left alone since it inherits
its tooling from the shared build rather than installing Claude itself.
@skpark-rh
skpark-rh merged commit 1718d4a into main Aug 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants