Skip to content
Merged
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
42 changes: 42 additions & 0 deletions uw
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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 into the dev pixi env (run via ./uw claude)

Building:
build Build underworld3
Expand Down Expand Up @@ -1662,6 +1683,27 @@ case "${1:-}" in
claude-perms)
configure_claude_permissions "$(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
;;
Expand Down
Loading