Kaynağa Gözat

fix: add Windows launcher for Codex CLI (#243, #285)

Windows cannot execute extensionless scripts with shebangs. Added
.cmd wrapper that invokes Node.js directly.

Changes:
- Add .codex/superpowers-codex.cmd (Windows shim)
- Update docs/README.codex.md with Windows installation instructions
- Add Windows troubleshooting section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Jesse Vincent 7 ay önce
ebeveyn
işleme
c3d478dc47
3 değiştirilmiş dosya ile 59 ekleme ve 3 silme
  1. 14 0
      .codex/superpowers-codex.cmd
  2. 6 0
      RELEASE-NOTES.md
  3. 39 3
      docs/README.codex.md

+ 14 - 0
.codex/superpowers-codex.cmd

@@ -0,0 +1,14 @@
+@echo off
+setlocal
+
+REM Windows shim for the extensionless Node.js launcher (superpowers-codex).
+REM
+REM Windows cannot execute extensionless scripts with shebangs, so this wrapper
+REM invokes Node.js directly.
+REM
+REM Usage:
+REM   superpowers-codex.cmd bootstrap
+REM   superpowers-codex.cmd use-skill superpowers:brainstorming
+REM   superpowers-codex.cmd find-skills
+
+node "%~dp0superpowers-codex" %*

+ 6 - 0
RELEASE-NOTES.md

@@ -44,6 +44,12 @@ Claude Code 2.1.x changed how hooks execute on Windows: it now auto-detects `.sh
 
 Fix: hooks.json now calls session-start.sh directly. Claude Code 2.1.x handles the bash invocation automatically. Also added .gitattributes to enforce LF line endings for shell scripts (fixes CRLF issues on Windows checkout).
 
+**Fixed Windows Codex launcher (#243, #285)**
+
+Windows cannot execute extensionless scripts with shebangs, so the `superpowers-codex` script would either open an "Open with" dialog or produce no output in PowerShell.
+
+Fix: Added `.codex/superpowers-codex.cmd` wrapper that invokes Node.js directly. Updated docs with Windows-specific installation and usage instructions.
+
 ### Improvements
 
 **Instruction priority clarified in using-superpowers**

+ 39 - 3
docs/README.codex.md

@@ -19,13 +19,27 @@ Fetch and follow instructions from https://raw.githubusercontent.com/obra/superp
 
 ### Installation Steps
 
-#### 1. Clone Superpowers
+#### macOS / Linux
 
 ```bash
 mkdir -p ~/.codex/superpowers
 git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
 ```
 
+#### Windows
+
+**Command Prompt:**
+```cmd
+mkdir "%USERPROFILE%\.codex\superpowers"
+git clone https://github.com/obra/superpowers.git "%USERPROFILE%\.codex\superpowers"
+```
+
+**PowerShell:**
+```powershell
+New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex\superpowers"
+git clone https://github.com/obra/superpowers.git "$env:USERPROFILE\.codex\superpowers"
+```
+
 #### 2. Install Bootstrap
 
 The bootstrap file is included in the repository at `.codex/superpowers-bootstrap.md`. Codex will automatically use it from the cloned location.
@@ -34,12 +48,20 @@ The bootstrap file is included in the repository at `.codex/superpowers-bootstra
 
 Tell Codex:
 
+**macOS / Linux:**
 ```
 Run ~/.codex/superpowers/.codex/superpowers-codex find-skills to show available skills
 ```
 
+**Windows:**
+```
+Run ~/.codex/superpowers/.codex/superpowers-codex.cmd find-skills to show available skills
+```
+
 You should see a list of available skills with descriptions.
 
+> **Note:** On Windows, always use the `.cmd` extension when running superpowers-codex commands.
+
 ## Usage
 
 ### Finding Skills
@@ -126,12 +148,26 @@ git pull
 2. Check CLI works: `~/.codex/superpowers/.codex/superpowers-codex find-skills`
 3. Verify skills have SKILL.md files
 
-### CLI script not executable
+### CLI script not executable (macOS/Linux)
 
 ```bash
 chmod +x ~/.codex/superpowers/.codex/superpowers-codex
 ```
 
+### Windows: "Open with" dialog or no output
+
+On Windows, you must use the `.cmd` wrapper:
+
+```cmd
+~/.codex/superpowers/.codex/superpowers-codex.cmd find-skills
+```
+
+Or invoke with Node directly:
+
+```cmd
+node "%USERPROFILE%\.codex\superpowers\.codex\superpowers-codex" find-skills
+```
+
 ### Node.js errors
 
 The CLI script requires Node.js. Verify:
@@ -140,7 +176,7 @@ The CLI script requires Node.js. Verify:
 node --version
 ```
 
-Should show v14 or higher (v18+ recommended for ES module support).
+Should show v14 or higher (v18+ recommended).
 
 ## Getting Help