From 363fdb510c0fd4a140bb319d9414092ed29a6fb4 Mon Sep 17 00:00:00 2001 From: lmoresi Date: Mon, 4 May 2026 21:56:24 +1000 Subject: [PATCH 1/2] uw: prompt to install Claude Code CLI during dev setup The dev pixi feature already pulls nodejs and defines an install-claude task (npm install -g @anthropic-ai/claude-code), but ./uw setup never invoked it, so users picking the Developer feature got the CLI dependency implied but unconfigured. Add an opt-in prompt during setup (default No, only when Developer is chosen) and expose ./uw install-claude as a top-level subcommand for post-setup or non-interactive runs. Underworld development team with AI support from Claude Code (https://claude.com/claude-code) --- uw | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/uw b/uw index bbba37e14..15c53671b 100755 --- a/uw +++ b/uw @@ -863,6 +863,26 @@ run_setup() { fi fi + # Optional: Install the Claude Code CLI (only meaningful for the Developer feature, + # which brings nodejs into the env). Reuses the install-claude pixi task. + if [ "$feature_choice" = "3" ]; then + echo "" + echo -e "${BOLD}Claude Code CLI (Optional)${NC}" + echo " Install the Claude Code CLI globally via the dev environment's npm:" + echo " pixi run -e $new_env install-claude" + echo " (equivalent to: npm install -g @anthropic-ai/claude-code)" + echo "" + read -p "Install Claude Code CLI now? [y/N]: " install_claude_cli + install_claude_cli=${install_claude_cli:-n} + + if [ "$install_claude_cli" = "y" ] || [ "$install_claude_cli" = "Y" ]; then + $PIXI run -e "$new_env" install-claude + echo -e " ${GREEN}✓${NC} Claude Code CLI installed" + else + echo " Skipped. Run later with: ./uw install-claude" + fi + fi + # Optional: Configure Claude Code permissions for unattended monitoring echo "" echo -e "${BOLD}Claude Code Permissions (Optional)${NC}" @@ -947,6 +967,7 @@ COMMANDS set-env NAME Change environment directly ai-tools Configure external AI instruction paths claude-perms Configure Claude Code permissions (safe defaults) + install-claude Install Claude Code CLI globally (npm, requires dev env) Building: build Build underworld3 @@ -1662,6 +1683,9 @@ case "${1:-}" in claude-perms) configure_claude_permissions "$(get_env)" ;; + install-claude) + $PIXI run -e "$(get_env)" install-claude + ;; --help|-h|help) show_help ;; From 8f491d14ee863614d7d946fac7c1ee09b62a2dc2 Mon Sep 17 00:00:00 2001 From: lmoresi Date: Mon, 4 May 2026 22:18:00 +1000 Subject: [PATCH 2/2] uw: guard install-claude on dev env, clarify help text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address Copilot review on PR #167: - The install-claude pixi task is defined under [feature.dev.tasks], so `./uw install-claude` would fail with a raw "task not found" error if the active env is default/runtime. Add a *dev* env guard that prints a clear message pointing to ./uw set-env . - "Install Claude Code CLI globally" overstates what the npm task does — it installs into the pixi env's node prefix, not the user's system PATH. Reword the --help line to make the env scope explicit and point at ./uw claude as the invocation path. Underworld development team with AI support from Claude Code (https://claude.com/claude-code) --- uw | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/uw b/uw index 15c53671b..b21cad879 100755 --- a/uw +++ b/uw @@ -967,7 +967,7 @@ COMMANDS set-env NAME Change environment directly ai-tools Configure external AI instruction paths claude-perms Configure Claude Code permissions (safe defaults) - install-claude Install Claude Code CLI globally (npm, requires dev env) + install-claude Install Claude Code CLI into the dev pixi env (run via ./uw claude) Building: build Build underworld3 @@ -1684,7 +1684,25 @@ case "${1:-}" in configure_claude_permissions "$(get_env)" ;; install-claude) - $PIXI run -e "$(get_env)" install-claude + # The install-claude pixi task lives under [feature.dev.tasks], so it + # only resolves in dev-feature envs (dev, amr-dev, *-dev). Guard the + # call so users on default/runtime get a clear message instead of a + # raw "task not found" error from pixi. + env=$(get_env) + case "$env" in + *dev*) + $PIXI run -e "$env" install-claude + ;; + *) + echo -e "${YELLOW}install-claude needs a dev environment (current: $env).${NC}" + echo "Switch with one of:" + echo " ./uw set-env dev # conda-forge PETSc" + echo " ./uw set-env amr-dev # custom PETSc with AMR tools" + echo " ./uw set-env mpich-dev # MPICH override" + echo " ./uw set-env openmpi-dev # OpenMPI override" + exit 1 + ;; + esac ;; --help|-h|help) show_help