From 9c8f9f9c3613ac0552a3d5576b2fdccc385515fc Mon Sep 17 00:00:00 2001 From: Junya Morioka Date: Sat, 27 Sep 2025 01:56:17 +0900 Subject: [PATCH 1/2] feat: add codex in devcontainer --- template/.devcontainer/devcontainer.json | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/template/.devcontainer/devcontainer.json b/template/.devcontainer/devcontainer.json index cbc60d1..3d61d53 100644 --- a/template/.devcontainer/devcontainer.json +++ b/template/.devcontainer/devcontainer.json @@ -5,10 +5,11 @@ "DISPLAY": "${localEnv:DISPLAY}", "PYTHONUNBUFFERED": "1", "PYTHONDONTWRITEBYTECODE": "1", - "UV_CACHE_DIR": "${containerWorkspaceFolder}/.cache/uv", + "UV_CACHE_DIR": "/home/vscode/.cache/uv", "UV_LINK_MODE": "copy", "UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv", - "UV_COMPILE_BYTECODE": "1" + "UV_COMPILE_BYTECODE": "1", + "CLAUDE_CONFIG_DIR": "/home/vscode/.claude" }, "features": { "ghcr.io/devcontainers/features/github-cli:1": {}, @@ -16,7 +17,7 @@ "configureZshAsDefaultShell": true }, "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { - "packages": "curl,wget,git,jq,ca-certificates,build-essential,ripgrep" + "packages": "curl,wget,git,jq,ca-certificates,build-essential,ripgrep,fd-find" }, "ghcr.io/va-h/devcontainers-features/uv:1": { "shellAutocompletion": true @@ -46,9 +47,15 @@ ] } }, + "remoteUser": "vscode", + "containerUser": "vscode", "mounts": [ - "source=claude-code-config,target=/home/vscode/.claude,type=volume" + "source=shell_history-${devcontainerId},target=/shell_history,type=volume", + "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind,consistency=cached", + "source=${localEnv:HOME}/.claude/CLAUDE.md,target=/home/vscode/.claude/CLAUDE.md,type=bind,consistency=cached", + "source=${localEnv:HOME}/.codex,target=/home/vscode/.codex,type=bind,consistency=cached", + "source=${localEnv:HOME}/.codex/config.toml,target=/home/vscode/.codex/config.toml,type=bind,consistency=cached" ], - "postCreateCommand": "uv sync", + "postCreateCommand": "npm install -g @openai/codex@latest && uv sync", "postStartCommand": "uv run pre-commit install" } \ No newline at end of file From f4627a91a7e222eef6e5c46632a2695b7ba84221 Mon Sep 17 00:00:00 2001 From: Junya Morioka Date: Sat, 27 Sep 2025 02:12:09 +0900 Subject: [PATCH 2/2] fix: add initializeCommand for bind mount in devcontainer --- template/.devcontainer/devcontainer.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/template/.devcontainer/devcontainer.json b/template/.devcontainer/devcontainer.json index 3d61d53..1494755 100644 --- a/template/.devcontainer/devcontainer.json +++ b/template/.devcontainer/devcontainer.json @@ -49,12 +49,13 @@ }, "remoteUser": "vscode", "containerUser": "vscode", + "initializeCommand": "mkdir -p ${localEnv:HOME}/.claude ${localEnv:HOME}/.codex && touch ${localEnv:HOME}/.claude/CLAUDE.md ${localEnv:HOME}/.codex/config.toml", "mounts": [ "source=shell_history-${devcontainerId},target=/shell_history,type=volume", - "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind,consistency=cached", - "source=${localEnv:HOME}/.claude/CLAUDE.md,target=/home/vscode/.claude/CLAUDE.md,type=bind,consistency=cached", - "source=${localEnv:HOME}/.codex,target=/home/vscode/.codex,type=bind,consistency=cached", - "source=${localEnv:HOME}/.codex/config.toml,target=/home/vscode/.codex/config.toml,type=bind,consistency=cached" + "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind", + "source=${localEnv:HOME}/.claude/CLAUDE.md,target=/home/vscode/.claude/CLAUDE.md,type=bind", + "source=${localEnv:HOME}/.codex,target=/home/vscode/.codex,type=bind", + "source=${localEnv:HOME}/.codex/config.toml,target=/home/vscode/.codex/config.toml,type=bind" ], "postCreateCommand": "npm install -g @openai/codex@latest && uv sync", "postStartCommand": "uv run pre-commit install"