feat: add Rust as an SDK option#72
Conversation
Adds Rust to the SDK picker in setup.sh alongside Node.js, Python, Go, and .NET. Install goes through rustup with the default toolchain (stable) and --no-modify-path so squarebox manages PATH via ~/.squarebox-sdk-paths, matching the other SDKs. The default rustup profile pulls in rustc, cargo, rustfmt, clippy, rust-std, and rust-docs. - setup.sh: Rust wired into interactive gum picker, numbered non-interactive menu, "all" expansion, and dispatch; adds _install_rust_inner / install_rust modelled on _install_python_inner - motd.sh: show rustc version when Rust is installed - demo/setup-demo.sh: mirror new option in the recorded demo source (the gif still needs re-recording on the demo branch) - README, CLAUDE.md, SECURITY.md, sqrbx-setup --help, regenerate-demo.md: update SDK enumerations Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds Rust as a first-class SDK option across squarebox’s setup flow (install, selection UI, and documentation), using rustup and integrating with the existing persisted PATH mechanism.
Changes:
- Extends
setup.shSDK selection (gum + numbered menu) to include Rust and installs it via rustup while appending~/.cargo/binto~/.squarebox-sdk-paths. - Updates MOTD SDK version detection to display Rust when selected/installed.
- Updates CLI help text, demo script, and docs enumerations to include Rust.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| setup.sh | Adds Rust to SDK picker and implements rustup-based installation + PATH persistence. |
| scripts/squarebox-setup.sh | Updates sqrbx-setup --help SDK list to include rust. |
| motd.sh | Adds Rust version detection/display in MOTD. |
| demo/setup-demo.sh | Updates demo SDK picker/options and simulated install messaging to include Rust. |
| SECURITY.md | Documents rustup as a third-party installer in the security/trust model table and narrative. |
| README.md | Adds Rust→rustup entry to the SDK table. |
| CLAUDE.md | Updates setup wizard documentation to include Rust in SDK options. |
| .claude/commands/regenerate-demo.md | Updates demo re-recording checklist to include Rust in SDK selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _install_rust_inner() { | ||
| # Trust boundary: the rustup install script manages its own binary | ||
| # fetching and verification. We rely on HTTPS for script integrity. | ||
| # --no-modify-path: squarebox manages PATH via ~/.squarebox-sdk-paths. | ||
| curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs \ | ||
| | sh -s -- -y --default-toolchain stable --no-modify-path &>/dev/null | ||
| if ! grep -q '\.cargo/bin' ~/.squarebox-sdk-paths 2>/dev/null; then | ||
| cat <<'PATHS' >> ~/.squarebox-sdk-paths | ||
| export PATH="$HOME/.cargo/bin:$PATH" | ||
| PATHS | ||
| fi | ||
| } | ||
|
|
||
| install_rust() { | ||
| if [ -x "${HOME}/.cargo/bin/rustc" ]; then echo "Rust already installed, skipping."; return 0; fi | ||
| run_with_spinner "Installing Rust (via rustup)..." _install_rust_inner | ||
| if [ ! -x "${HOME}/.cargo/bin/rustc" ]; then | ||
| echo "Error: rustc binary not found after installation" >&2 | ||
| return 1 | ||
| fi | ||
| } |
There was a problem hiding this comment.
Rust SDK installation was added here, but the repo’s existing e2e coverage for the SDK section (see scripts/e2e-test.sh suite_setup_editors which currently seeds node,go) doesn’t exercise the new rust path. Add an e2e case that pre-seeds rust in /workspace/.squarebox/sdks and asserts rustc/cargo (and any expected components like rustfmt/clippy, if required) work after sourcing ~/.squarebox-sdk-paths to prevent regressions.
Summary
setup.shvia rustup (default toolchain: stable;--no-modify-pathso squarebox owns PATH)~/.squarebox-sdk-paths, binary verified at$HOME/.cargo/bin/rustcTest plan
rustc,cargo,rustfmt, andcargo clippyall run aftersource ~/.squarebox-sdk-paths/workspace/.squarebox/sdksand survivesdocker start -aisqrbx-setup --listshowsrustin the SDKs line;sqrbx-setup sdksre-prompts with Rust pre-selectedRust <ver>on login when installedallexpands tonode,python,go,dotnet,rustNotes
demo/squarebox-setup.gif) still needs re-recording viavhs demo/demo.tapeon thedemobranch — the source script is updated here.🤖 Generated with Claude Code