Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/codex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The feature installs:

- `codex`
- a bundled `rg` binary that matches the upstream Codex package layout
- `codex-code-mode-host` when the release bundles it (Codex v0.143.0 and newer); older releases skip it with a notice

## Example Usage

Expand Down Expand Up @@ -76,6 +77,9 @@ The installed tool is subject to its own license: [Codex CLI license](https://gi

## Release Notes

## 1.2.0 - 2026-09-03
- Install `codex-code-mode-host` (Codex's code editor integration helper) when it is bundled in the release package (Codex v0.143.0 and newer); older releases remain supported and skip the helper with a notice.

## 1.1.3 - 2026-08-01
- Declare `customizations.sliekens.initializeCommand` for composable host path pre-create; document automated and manual `initializeCommand` wiring.

Expand Down
2 changes: 1 addition & 1 deletion src/codex/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "codex",
"name": "Codex CLI",
"version": "1.1.3",
"version": "1.2.0",
"description": "Installs the OpenAI `codex` CLI from the official packaged release assets and persists `~/.codex` in shared state across devcontainers.",
"documentationURL": "https://github.com/sliekens/devcontainer-features/blob/main/src/codex/README.md",
"licenseURL": "https://github.com/sliekens/devcontainer-features/blob/main/LICENSE",
Expand Down
15 changes: 15 additions & 0 deletions src/codex/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ main() {

local codex_source=""
local rg_source=""
local code_mode_host_source=""

# Upstream archive layout changed in newer releases; support both layouts.
if [ -f "${tmp_dir}/package/vendor/${VENDOR_TARGET}/bin/codex" ]; then
Expand All @@ -159,6 +160,13 @@ main() {
rg_source="${tmp_dir}/package/vendor/${VENDOR_TARGET}/path/rg"
fi

# `codex-code-mode-host` is bundled next to `codex` in the packaged assets
# of newer releases (openai/codex started shipping it with v0.143.0). Older
# releases do not contain it, in which case it is skipped with a notice.
if [ -f "${tmp_dir}/package/vendor/${VENDOR_TARGET}/bin/codex-code-mode-host" ]; then
code_mode_host_source="${tmp_dir}/package/vendor/${VENDOR_TARGET}/bin/codex-code-mode-host"
fi

if [ -z "$codex_source" ] || [ -z "$rg_source" ]; then
echo "Unexpected Codex archive layout for ${asset_name}."
echo "Archive contents:"
Expand All @@ -170,6 +178,13 @@ main() {
install -m 0755 "$rg_source" "${INSTALL_DIR}/rg"
install -m 0755 "$SCRIPT_DIR/on_create.sh" /usr/local/share/codex/on_create.sh

if [ -n "$code_mode_host_source" ]; then
install -m 0755 "$code_mode_host_source" "${INSTALL_DIR}/codex-code-mode-host"
echo "Installed codex-code-mode-host ${release_version}."
else
echo "codex-code-mode-host is not bundled in the ${release_tag} release assets; skipping."
fi

codex --version
rg --version | head -n 1
echo "Installed Codex CLI ${release_version}."
Expand Down
14 changes: 14 additions & 0 deletions test/codex/pinned_version_bundled_code_mode_host.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

source dev-container-features-test-lib

check "pinned codex version" bash -lc 'codex --version | grep -F "codex-cli 0.153.0"'
check "bundled rg" /usr/local/bin/rg --version
check "codex-code-mode-host installed" test -x /usr/local/bin/codex-code-mode-host
check "codex-code-mode-host help" bash -lc 'codex-code-mode-host --help | grep -q "Usage: codex-code-mode-host"'
check "codex state symlink" bash -lc '[ -L "$HOME/.codex" ] && [ "$(readlink "$HOME/.codex")" = "/var/lib/codex" ]'
check "codex state writable" bash -lc 'tmp="$HOME/.codex/.feature-test"; printf ok > "$tmp"; [ "$(cat /var/lib/codex/.feature-test)" = "ok" ]; rm -f "$tmp"'

reportResults
1 change: 1 addition & 0 deletions test/codex/pinned_version_custom_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source dev-container-features-test-lib

check "pinned codex version" bash -lc 'codex --version | grep -F "codex-cli 0.114.0"'
check "bundled rg" /usr/local/bin/rg --version
check "codex-code-mode-host not installed on pre-bundle release" test ! -e /usr/local/bin/codex-code-mode-host
check "codex state symlink" bash -lc '[ -L "$HOME/.codex" ] && [ "$(readlink "$HOME/.codex")" = "/var/lib/codex" ]'
check "codex state writable" bash -lc 'tmp="$HOME/.codex/.feature-test"; printf ok > "$tmp"; [ "$(cat /var/lib/codex/.feature-test)" = "ok" ]; rm -f "$tmp"'

Expand Down
8 changes: 8 additions & 0 deletions test/codex/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@
}
},
"remoteUser": "octocat"
},
"pinned_version_bundled_code_mode_host": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"codex": {
"version": "0.153.0"
}
}
}
}
2 changes: 2 additions & 0 deletions test/codex/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ source dev-container-features-test-lib
# Feature-specific tests
check "codex version" codex --version
check "bundled rg" /usr/local/bin/rg --version
check "codex-code-mode-host installed" test -x /usr/local/bin/codex-code-mode-host
check "codex-code-mode-host help" bash -lc 'codex-code-mode-host --help | grep -q "Usage: codex-code-mode-host"'
check "codex state symlink" bash -lc '[ -L "$HOME/.codex" ] && [ "$(readlink "$HOME/.codex")" = "/var/lib/codex" ]'
check "codex state writable" bash -lc 'tmp="$HOME/.codex/.feature-test"; printf ok > "$tmp"; [ "$(cat /var/lib/codex/.feature-test)" = "ok" ]; rm -f "$tmp"'

Expand Down