Skip to content

feat: native Windows launchers (PowerShell/cmd) + install.ps1 - #18

Merged
tizz98 merged 12 commits into
mainfrom
claude/windows-meta-ps1-f3ab35
Jul 13, 2026
Merged

feat: native Windows launchers (PowerShell/cmd) + install.ps1#18
tizz98 merged 12 commits into
mainfrom
claude/windows-meta-ps1-f3ab35

Conversation

@tizz98

@tizz98 tizz98 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Makes ./meta <cmd> work transparently on native Windows, not just Git Bash.

  • meta.cmd + .meta/shim.ps1 (new generated artifacts): PowerShell (./meta) and cmd.exe (.\meta) both resolve meta.cmd, which relaunches PowerShell with -ExecutionPolicy Bypass into the hidden .meta/shim.ps1 (mirror of the bash shim.sh: read .meta/version → map arch → download the pinned release → verify sha256 → exec → propagate exit code). The bash meta shim is unchanged.
  • install.ps1 (new): native irm https://raw.githubusercontent.com/tizz98/ai-meta/main/install.ps1 | iex bootstrapper, mirror of install.sh.
  • .gitattributes: pins *.cmd→CRLF and the bash-path files (*.sh, meta, .meta/version)→LF, so a Windows checkout never bakes a CRLF-broken bash shim into the binary via include_str!.
  • Dogfood: this repo carries the launchers and is pinned to v0.4.0 (the first release with a Windows asset) so ./meta resolves a binary in-repo.

Design (why no root meta.ps1)

PowerShell ranks a repo-root .ps1 above a PATHEXT .cmd, and a directly-invoked .ps1 is subject to execution policy. Keeping no root meta.ps1 makes PowerShell's ./meta fall through to meta.cmd, whose -ExecutionPolicy Bypass is immune to the machine policy. Verified empirically on PowerShell 5.1 and 7.

Test plan

  • cargo test — new scaffold::tests::generates_windows_launchers passes. (102 pass; the 2 failing src/process.rs tests are a pre-existing sh-on-Windows env issue, green on CI/Linux, untouched by this branch — follow-up chipped.)
  • cargo clippy --all-targets -- -D warnings, cargo fmt --all — clean.
  • E2E on Windows in a scratch repo: ./meta check under Restricted execution policy → exit 0 (downloaded the real ai-meta-x86_64-pc-windows-msvc.exe); .\meta in cmd.exe works; a nonzero exit propagates through both hops exactly once (no double-run).
  • install.ps1 real install → runnable meta.exe; checksum verified; PATH nudge is print-only.
  • CI green on ubuntu.

Follow-ups (not in this PR)

  • Generate a .gitattributes into managed repos (so a consumer's committed bash shim survives a Windows teammate's clone).
  • Fix which() PATHEXT resolution + the two sh-dependent src/process.rs tests on Windows.

🤖 Generated with Claude Code

tizz98 and others added 12 commits July 13, 2026 14:39
Route PowerShell/cmd through a policy-bypassing meta.cmd -> .meta/shim.ps1;
keep no root .ps1 so `./meta` is execution-policy-proof. Adds install.ps1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…shims

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…afety

A CRLF checkout on Windows (core.autocrlf) breaks the ./meta bash shim under
Git Bash (CRLF shebang; CR in the version string corrupts the release URL), and
a CRLF src/assets/shim.sh gets embedded via include_str! and shipped as a broken
bash shim to every managed repo. Pin the bash-path files to LF; .cmd stays CRLF.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The spec/plan under docs/superpowers/ are local planning artifacts, not part
of the deliverable. Untrack (keep on disk) and gitignore the directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tizz98
tizz98 merged commit b26afa2 into main Jul 13, 2026
4 checks passed
@tizz98
tizz98 deleted the claude/windows-meta-ps1-f3ab35 branch July 13, 2026 20:57
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