uw: prompt to install Claude Code CLI during dev setup - #167
Conversation
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)
There was a problem hiding this comment.
Pull request overview
This PR improves the ./uw developer setup flow by making installation of the Claude Code CLI discoverable and optionally runnable during interactive setup, while also adding a dedicated install-claude subcommand for later/non-interactive use.
Changes:
- Add an opt-in prompt at the end of
run_setup()to run the existing Pixiinstall-claudetask when the Developer feature is selected. - Add a new
./uw install-claudesubcommand that dispatches topixi run -e <env> install-claude. - Expose the new subcommand in
./uw --helpunder the Setup section.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| configure_claude_permissions "$(get_env)" | ||
| ;; | ||
| install-claude) | ||
| $PIXI run -e "$(get_env)" install-claude |
There was a problem hiding this comment.
Fixed in 8f491d1 — added a *dev* env guard around the dispatch. Non-dev envs now print a clear message pointing at ./uw set-env dev (or amr-dev / mpich-dev / openmpi-dev) and exit 1, instead of falling through to a raw pixi "task not found" error.
| 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) |
There was a problem hiding this comment.
Fixed in 8f491d1 — reworded the help line to "Install Claude Code CLI into the dev pixi env (run via ./uw claude)". That makes it clear the install lands in the env's node prefix and that ./uw claude (or pixi run -e <env> claude) is the invocation path.
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 <dev variant>. - "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)
…vation Reverts the changes introduced by PR underworldcode#169 (`uw: add claude-set-token subcommand + dev-env activation for OAuth token`). The feature over-promised relative to what Claude Code 2.x actually does with the OAuth env var: CLAUDE_CODE_OAUTH_TOKEN is honoured only in non-interactive mode (`claude -p "..."` and scripted use). Bare/interactive `claude` always tries browser auth first regardless. So on a truly headless remote, our `./uw shell` + persisted token flow still results in a browser-login prompt the user can't service. The subcommand and its --help advertised a workflow that doesn't quite work and was therefore potentially misleading. What this revert removes: - ./uw claude-set-token subcommand and its --help block - claude-set-token entry in ./uw --help Setup section - [feature.dev.activation] block in pixi.toml - scripts/activate-claude-auth.sh What stays (still earn their keep regardless of this auth quirk): - ./uw install-claude (PR underworldcode#167) - ./uw shell (PR underworldcode#168) If a useful headless-auth workflow appears later (e.g. an ANTHROPIC_API_KEY-based path for interactive use that Pro/Max users are willing to pay for), this can be revisited with honest documentation about which mode it serves. Underworld development team with AI support from Claude Code (https://claude.com/claude-code)
Summary
devpixi feature already pullsnodejsand defines aninstall-claudetask (npm install -g @anthropic-ai/claude-codeinpixi.toml:327), but./uw setupnever invoked it. Users who picked the Developer feature got the CLI dependency implied but never installed.run_setup(), only when the Developer feature is selected, defaulting to No. Reuses the existing pixi task — no shell duplication of the npm command../uw install-claudesubcommand mirroring the existingclaude-permsdispatch pattern, for post-setup or non-interactive runs.Setup:in./uw --help.No
pixi.tomlchanges. No behaviour change for the Minimal or Runtime features. The existingclaude-permspermissions block is untouched and still runs after the new prompt.Test plan
bash -n uwclean (verified locally)./uw --helplistsinstall-claudeunder Setup./uw setupwith Developer feature: new prompt appears, default No skips with hint./uw setupwith Developer feature, accept: runspixi run -e <env> install-claudeand reports success./uw setupwith Runtime feature: new prompt does NOT appear./uw install-claudestandalone: runs the pixi task in the active envUnderworld development team with AI support from Claude Code