Skip to content

feat(onboarding): Windows one-liner loader (Chocolatey) + OS detection in bash loader - #54

Merged
abarrows merged 1 commit into
productionfrom
feature/local-ai-setup-windows
Aug 18, 2026
Merged

feat(onboarding): Windows one-liner loader (Chocolatey) + OS detection in bash loader#54
abarrows merged 1 commit into
productionfrom
feature/local-ai-setup-windows

Conversation

@abarrows

@abarrows abarrows commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds onboarding_bin/local-ai-setup.ps1 — Windows counterpart of the macOS loader, run from an elevated PowerShell:
    irm https://raw.githubusercontent.com/abarrows/dotfiles/production/onboarding_bin/local-ai-setup.ps1 | iex
  • Installs via Chocolatey: git, gh, claude (desktop), docker-desktop, warp, vscode — all package ids verified against community.chocolatey.org. Claude Code itself uses Anthropic's official native installer (irm https://claude.ai/install.ps1 | iex, auto-updating).
  • Checks/enables WSL2 for Docker Desktop (with reboot guidance), installs the rs-agents plugin, then hands off to the plugin-shipped setup.ps1 (falls back to setup.sh via Git Bash for older plugin versions).
  • The bash loader now detects Git Bash/MSYS/Cygwin/WSL and prints the PowerShell one-liner instead of dying with 'macOS only'.

Test plan

  • PowerShell AST parse clean (pwsh 7.5)
  • Windows PowerShell 5.1-compatible syntax (no ternaries/null-coalescing/$IsWindows)
  • settings.json merge logic live-tested under pwsh — preserves unrelated keys, idempotent
  • bash -n + shellcheck clean on the modified sh loader
  • Branch raw URL curl-verified; SHA matches authored file
  • Runtime pass on a real Windows machine (first Windows user is the live test — script is idempotent and soft-fails with guidance)

🤖 Generated with Claude Code

https://claude.ai/code/session_01479AjdrpHH8hsrnf7CbyeW

Summary by Sourcery

Enable Windows onboarding through an idempotent elevated PowerShell loader while guiding non-macOS bash users to the appropriate setup path.

New Features:

  • Add a Windows PowerShell onboarding loader that installs required development tools, configures Docker and WSL prerequisites, authenticates GitHub, and installs the Claude tooling and Retail Success plugin.
  • Support handing off Windows setup to the plugin-provided PowerShell setup script, with a Git Bash fallback for older plugin versions.

Bug Fixes:

  • Detect Windows environments in the bash loader and direct users to the elevated PowerShell onboarding command instead of reporting that the platform is unsupported.

…n in bash loader

Adds onboarding_bin/local-ai-setup.ps1 — the Windows counterpart of the
macOS bash loader, run from an elevated PowerShell:
  irm https://raw.githubusercontent.com/abarrows/dotfiles/production/onboarding_bin/local-ai-setup.ps1 | iex

Installs via Chocolatey (git, gh, claude desktop, docker-desktop, warp,
vscode — package ids verified against community.chocolatey.org), uses the
official native installer for Claude Code, checks/enables WSL2 for Docker
Desktop, installs the rs-agents plugin, and hands off to the plugin-shipped
setup.ps1 (setup.sh via Git Bash as fallback). Idempotent; PS 5.1 + 7
compatible.

The bash loader now detects Git Bash/MSYS/Cygwin/WSL and redirects Windows
users to the PowerShell one-liner instead of dying with 'macOS only'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01479AjdrpHH8hsrnf7CbyeW
@sourcery-ai

sourcery-ai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a Windows PowerShell-based onboarding loader using Chocolatey and integrates OS detection into the existing bash loader to route Windows users appropriately, while delegating final setup to the Claude plugin’s own scripts.

Sequence diagram for Windows PowerShell onboarding loader

sequenceDiagram
  actor User
  participant PowerShell
  participant LocalAiSetupPs1
  participant Chocolatey
  participant DockerDesktop
  participant ClaudeCLI
  participant RsAgentsPlugin

  User->>PowerShell: run irm ... local-ai-setup.ps1 | iex
  PowerShell->>LocalAiSetupPs1: load and execute script
  LocalAiSetupPs1->>LocalAiSetupPs1: Step "Checking this machine"
  LocalAiSetupPs1->>LocalAiSetupPs1: Die if not Windows or not elevated or build too old
  LocalAiSetupPs1->>LocalAiSetupPs1: Test-NetConnection raw.githubusercontent.com

  LocalAiSetupPs1->>Chocolatey: install.ps1 (if choco missing)
  LocalAiSetupPs1->>LocalAiSetupPs1: Install-ChocoPkg git, gh, claude, docker-desktop, warp, vscode

  LocalAiSetupPs1->>ClaudeCLI: Invoke-RestMethod https://claude.ai/install.ps1 | Invoke-Expression
  LocalAiSetupPs1->>LocalAiSetupPs1: VS Code anthropic.claude-code extension install
  LocalAiSetupPs1->>LocalAiSetupPs1: gh auth status / gh auth login

  LocalAiSetupPs1->>DockerDesktop: wsl --status / wsl --install --no-distribution
  LocalAiSetupPs1->>DockerDesktop: docker info
  LocalAiSetupPs1->>DockerDesktop: docker mcp --help

  LocalAiSetupPs1->>ClaudeCLI: claude plugin marketplace add Retail-Success/Wayroo.tools
  LocalAiSetupPs1->>ClaudeCLI: claude plugin install rs-agents@retailsuccess

  LocalAiSetupPs1->>RsAgentsPlugin: & setup.ps1 or bash setup.sh via Git Bash
  LocalAiSetupPs1->>ClaudeCLI: claude doctor
  LocalAiSetupPs1->>User: summary and next steps
Loading

Flow diagram for OS detection and Windows redirect in bash loader

flowchart TD
  A[start local-ai-setup.sh] --> B[uname -s]
  B -->|Darwin| C[continue macOS setup]
  B -->|MINGW*/MSYS*/CYGWIN*| D[windows_redirect]
  B -->|Linux| E[grep -qi microsoft /proc/version]
  E -->|match| D
  E -->|no match| F[die: macOS or Windows only]
  B -->|other| F
  D --> G[print Windows PowerShell one-liner and exit]
Loading

File-Level Changes

Change Details Files
Add a Windows PowerShell onboarding loader that installs required tools via Chocolatey, validates environment, configures Claude plugin, and hands off to plugin-managed setup scripts.
  • Introduce local-ai-setup.ps1 as a standalone, idempotent Windows bootstrap script callable via a one-liner from elevated PowerShell.
  • Implement environment guards for Windows OS, minimum build version, elevation, and network reachability.
  • Install and verify core developer tools via Chocolatey, including git, gh, Claude desktop, Docker Desktop, Warp, and VS Code, with PATH refresh and soft-fail handling.
  • Install Claude Code CLI via Anthropic’s official installer, ensure it is on PATH, and install/verify the Claude Code VS Code extension.
  • Check GitHub authentication with gh, enforce Docker Desktop + MCP Toolkit availability, and guide users to fix missing WSL2 or Docker daemon issues.
  • Install the rs-agents Claude plugin from the Retail Success marketplace, including fallback marketplace name and idempotent checks.
  • Discover and execute the plugin’s setup.ps1 (or fallback setup.sh via Git Bash) from the Claude plugin cache, handling errors and providing recovery guidance.
  • Run claude doctor and summarize installation results, tracking non-fatal failures across steps.
onboarding_bin/local-ai-setup.ps1
Enhance the existing bash loader to detect Windows-related environments and provide a redirect to the new PowerShell loader instead of failing with a macOS-only message.
  • Replace the strict macOS-only guard with OS-aware logic using uname, matching MINGW/MSYS/Cygwin and WSL-specific Linux kernels.
  • Add a windows_redirect helper that prints clear instructions for running the Windows PowerShell one-liner from an elevated PowerShell session.
  • Update non-macOS error messaging to indicate "macOS or Windows only" while still directing other platforms to ask in the AI rollout channel.
onboarding_bin/local-ai-setup.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@abarrows
abarrows merged commit 13b8e70 into production Aug 18, 2026
1 of 2 checks passed
@abarrows
abarrows deleted the feature/local-ai-setup-windows branch August 18, 2026 16:20

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The Docker Desktop detection/launch logic assumes the standard $env:ProgramFiles\Docker\Docker\Docker Desktop.exe location; consider falling back to a broader search (e.g., Get-Command 'Docker Desktop' or scanning common user-install paths) so the flow still works on non-default or user-scope installs.
  • The plugin cache path is hardcoded as Join-Path $HOME '.claude\plugins'; on some setups $HOME may differ from the actual user profile directory, so using $env:USERPROFILE (or [Environment]::GetFolderPath('UserProfile')) would make the setup script more robust across environments.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Docker Desktop detection/launch logic assumes the standard `$env:ProgramFiles\Docker\Docker\Docker Desktop.exe` location; consider falling back to a broader search (e.g., `Get-Command 'Docker Desktop'` or scanning common user-install paths) so the flow still works on non-default or user-scope installs.
- The plugin cache path is hardcoded as `Join-Path $HOME '.claude\plugins'`; on some setups `$HOME` may differ from the actual user profile directory, so using `$env:USERPROFILE` (or `[Environment]::GetFolderPath('UserProfile')`) would make the setup script more robust across environments.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant