Add Claude Code and Gemini CLI to Workbench apps#342
Add Claude Code and Gemini CLI to Workbench apps#342michaelxiao7 wants to merge 1 commit intoverily-src:masterfrom
Conversation
198123d to
167386b
Compare
…upyter and Parabricks Jupyter. Install AI extensions (Claude Code, Gemini) in VSCode app
|
|
||
| # Wrap gcloud to unset DISPLAY per-invocation so auth commands don't try | ||
| # to open a browser via X11 in headless devcontainer environments. | ||
| printf 'function gcloud() { DISPLAY= command gcloud "$@"; }\n' |
There was a problem hiding this comment.
could these env variables be set and exported rather than wrapping the commands? I wouldn't think they would cause issues with other commands?
|
|
||
| # Wrap gemini to set NO_BROWSER=1 per-invocation to force device code flow | ||
| # instead of opening a browser window. | ||
| printf 'function gemini() { NO_BROWSER=1 NO_COLOR=1 command gemini "$@"; }\n' |
| @@ -0,0 +1,74 @@ | |||
| #!/usr/bin/env bash | |||
| set -eu | |||
There was a problem hiding this comment.
nit:
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
| chown -R "${username}:" "${nvm_dir}" | ||
| fi | ||
|
|
||
| # Fix npm cache: npm install -g as root creates root-owned files in user's ~/.npm |
There was a problem hiding this comment.
what if you installed it as the user?
sudo -u "${username}" npm ...
|
|
||
| # Gemini: https://open-vsx.org/extension/Google/geminicodeassist | ||
| # Claude: https://open-vsx.org/extension/Anthropic/claude-code | ||
| RUN GEMINI_VERSION=$(curl -fsSL "https://open-vsx.org/api/Google/geminicodeassist/latest" | grep -o '"version":"[^"]*"' | head -1 | cut -d'"' -f4) && \ |
There was a problem hiding this comment.
Could we use jq here instead of grep/head/cut?
We can even get the full download url with curl ... | jq -r '.files.download'
|
|
||
| # Gemini: https://open-vsx.org/extension/Google/geminicodeassist | ||
| # Claude: https://open-vsx.org/extension/Anthropic/claude-code | ||
| RUN GEMINI_VERSION=$(curl -fsSL "https://open-vsx.org/api/Google/geminicodeassist/latest" | grep -o '"version":"[^"]*"' | head -1 | cut -d'"' -f4) && \ |
There was a problem hiding this comment.
nit: I recently learned in Dockerfiles it's preferred to have the && at the beginning of the line rather than the end. Also could you indent continuations of commands to distinguish them a bit more?
&& curl ... \
... \
-o ... \
&& CLAUDE_VERSION=...| "ghcr.io/devcontainers/features/node": { | ||
| "version": "24.11.0" | ||
| }, | ||
| "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}, |
There was a problem hiding this comment.
can we pin these features to a hash and add them to https://github.com/verily-src/workbench-app-devcontainers/blob/master/feature-versions/state.json so they can be auto-updated?
| # Edge case: Disable auto-update to prevent gemini from trying to re-exec | ||
| # itself on first run, which fails on freshly provisioned machines. | ||
| mkdir -p "${user_home}/.gemini" | ||
| printf '{"general.enableAutoUpdate": false}\n' > "${user_home}/.gemini/settings.json" |
There was a problem hiding this comment.
did this fix that freezing issue you showed me?
PHP-135615