Skip to content

feat: add Windows support for installation and usage#100

Open
josegironn wants to merge 1 commit intomainfrom
josegironn/windows
Open

feat: add Windows support for installation and usage#100
josegironn wants to merge 1 commit intomainfrom
josegironn/windows

Conversation

@josegironn
Copy link
Copy Markdown
Contributor

Summary

Adds native Windows support to the CLI while preserving the existing Linux/macOS experience unchanged. The Go code was already largely cross-platform; the changes concentrate on installation, distribution, update, and the plugin layer's bash dependencies.

Build & distribution

  • GoReleaser now builds windows/amd64 and windows/arm64 with .zip archives (format_overrides)
  • Release workflow uploads install.ps1 to S3 alongside install.sh

Installation

  • install.ps1: PowerShell installer with SHA256 checksum and version verification
  • install.sh: hardened to fail loudly on version mismatch (parity with .ps1)
  • cmd/install.go: installWindows branch registers completion in $PROFILE and updates User PATH via [Environment]::SetEnvironmentVariable (PowerShell API, not reg.exe scraping)

Updater (cmd/update.go)

  • Go-native download path for Windows, and as fallback on Unix without bash
  • SHA256 checksum verification against checksums.txt
  • Pre-promotion health check: runs new binary with --version before swapping
  • Safe Windows binary swap with rollback (.new -> .old -> rename chain)
  • Unix path still prefers existing curl \| bash flow for backwards compat

Plugin integration

  • New hidden commands: major mcp get-headers and major mcp check-readonly-hook
  • .mcp.json and auto-approve.json now use the Go commands; cross-platform by construction (no bash dependency)
  • .sh scripts kept for backwards compat; .ps1 equivalents added for direct use

Dev tooling

  • Makefile: dev-install-windows target for PowerShell workflow
  • cmd/completion.go: PowerShell completion documentation

Verification

  • All 6 build targets compile: darwin/linux/windows × amd64/arm64
  • go test ./... passes (no test files in repo)
  • go run . install on macOS still detects zsh and reuses existing # Major CLI marker (no regression)
  • Cross-compiled major.exe verified as PE32+ executable (x86-64 and Aarch64)

Test plan

  • Manual test: run irm <s3>/install.ps1 | iex on Windows 10/11 and verify install succeeds
  • Manual test: run major user login and confirm credential storage uses Windows Credential Manager
  • Manual test: run major update on Windows and verify .old cleanup on next update
  • Manual test: verify Claude Code plugin hooks fire correctly on Windows (MCP tool approval)
  • Regression: run ./install.sh on a fresh Linux/macOS machine and confirm unchanged behavior

Known limitations (out of scope)

Release artifacts remain unsigned (same trust model as existing install.sh on Unix). Moving to a signed release scheme (cosign/Sigstore/TUF) is a whole-CLI supply-chain initiative that should be tracked separately and will apply equally to all platforms.

🤖 Generated with Claude Code

Adds native Windows support to the CLI while preserving the existing
Linux/macOS experience unchanged.

Build & distribution:
- GoReleaser builds windows/amd64 and windows/arm64 with .zip archives
- Release workflow uploads install.ps1 to S3 alongside install.sh

Installation:
- install.ps1: PowerShell installer with SHA256 checksum and version verification
- install.sh: hardened to fail loudly on version mismatch (parity with .ps1)
- cmd/install.go: installWindows branch registers completion in $PROFILE and
  updates User PATH via [Environment]::SetEnvironmentVariable

Updater (cmd/update.go):
- Go-native download path for Windows and as fallback when bash is missing
- SHA256 checksum verification against checksums.txt
- Pre-promotion health check (runs new binary with --version)
- Safe Windows binary swap with rollback (.new -> .old -> rename chain)

Plugin integration (cross-platform via Go commands):
- New hidden command: major mcp get-headers (replaces bash headersHelper)
- New hidden command: major mcp check-readonly-hook (replaces bash PreToolUse script)
- .mcp.json and auto-approve.json now use the Go commands; work identically
  on Windows, macOS, and Linux
- Kept .sh scripts for backwards compat; added .ps1 equivalents for direct use

Dev tooling:
- Makefile: dev-install-windows target for PowerShell workflow
- cmd/completion.go: added PowerShell completion documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@josegironn josegironn requested a review from jasonzbao as a code owner April 13, 2026 19:34
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