Add a script to install superpowers on Codex#623
Conversation
📝 WalkthroughWalkthroughA new Bash installation management script is introduced to handle Codex installation, updates, migration, and removal with platform detection. Documentation and README files are updated to reflect the new scripted installation workflow. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@codex/install.sh`:
- Around line 83-96: The remove command is routed through health_check which
calls ensure_git and ensure_skills_link_dir and thus can block or mutate state
during cleanup; change remove to bypass those install-time checks by either (a)
adding a new minimal function (e.g., health_check_no_side_effects) that only
validates $HOME_DIR existence/permissions and the PowerShell check, or (b) add a
flag to health_check to skip ensure_git and ensure_skills_link_dir when invoked
from remove; update the remove invocation to use the new minimal check so remove
does not call ensure_git or ensure_skills_link_dir and therefore does not create
~/.agents/skills or require git.
- Around line 98-156: The doctor function currently skips verifying that
SKILLS_LINK_DIR exists and actually points to REPO_SKILLS_DIR; add a check after
the existing SKILLS_LINK_DIR branch to validate the link target: if
SKILLS_LINK_DIR exists and is a symlink (test -L), resolve its target (readlink
-f or realpath) and compare to REPO_SKILLS_DIR, using check_condition to report
success/failure (or mark failures=1) when the link is missing, not a symlink, or
points elsewhere; reference the doctor function, SKILLS_LINK_DIR,
REPO_SKILLS_DIR and check_condition to locate where to insert this validation.
- Around line 195-200: Windows link creation using New-Item -ItemType
SymbolicLink can fail without admin/DevMode; update the IS_WINDOWS branch to try
the symbolic link via run_powershell first and if that command fails fall back
to creating a directory junction (since REPO_SKILLS_DIR is always a directory).
Use ps_escape on REPO_SKILLS_DIR and LINK_PATH as already done, run
run_powershell "New-Item -ItemType SymbolicLink ..." and check its exit/status,
and on non-zero failure invoke run_powershell or cmd to create a Junction
(New-Item -ItemType Junction or mklink /J) and log/info about the fallback;
ensure the logic references IS_WINDOWS, REPO_SKILLS_DIR, LINK_PATH and
run_powershell so the fallback is applied only for directory links on Windows.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c9b62019-e24a-4e0e-bf62-c256ba5440d3
📒 Files selected for processing (3)
README.mdcodex/install.shdocs/README.codex.md
| health_check() { | ||
| if [ ! -d "$HOME_DIR" ]; then | ||
| fatal "home directory $HOME_DIR does not exist." | ||
| fi | ||
| if [ ! -w "$HOME_DIR" ]; then | ||
| fatal "no write permission for $HOME_DIR." | ||
| fi | ||
| ensure_git | ||
| ensure_skills_link_dir | ||
| if [ $IS_WINDOWS -eq 1 ] && [ ${#PWSH_BIN[@]} -eq 0 ]; then | ||
| fatal "PowerShell is required on Windows." | ||
| fi | ||
| info "Health check passed." | ||
| } |
There was a problem hiding this comment.
remove is gated by install-time checks and has side effects.
Line 292 routes remove through health_check, which currently requires git (Line 90) and creates ~/.agents/skills (Line 91). That can block or mutate a cleanup-only command.
Suggested fix
+health_check_install_like() {
+ if [ ! -d "$HOME_DIR" ]; then
+ fatal "home directory $HOME_DIR does not exist."
+ fi
+ if [ ! -w "$HOME_DIR" ]; then
+ fatal "no write permission for $HOME_DIR."
+ fi
+ ensure_git
+ ensure_skills_link_dir
+ if [ $IS_WINDOWS -eq 1 ] && [ ${`#PWSH_BIN`[@]} -eq 0 ]; then
+ fatal "PowerShell is required on Windows."
+ fi
+}
+
+health_check_remove() {
+ if [ ! -d "$HOME_DIR" ]; then
+ fatal "home directory $HOME_DIR does not exist."
+ fi
+ if [ ! -w "$HOME_DIR" ]; then
+ fatal "no write permission for $HOME_DIR."
+ fi
+}
+
health_check() {
- if [ ! -d "$HOME_DIR" ]; then
- fatal "home directory $HOME_DIR does not exist."
- fi
- if [ ! -w "$HOME_DIR" ]; then
- fatal "no write permission for $HOME_DIR."
- fi
- ensure_git
- ensure_skills_link_dir
- if [ $IS_WINDOWS -eq 1 ] && [ ${`#PWSH_BIN`[@]} -eq 0 ]; then
- fatal "PowerShell is required on Windows."
- fi
+ health_check_install_like
info "Health check passed."
}
@@
remove)
- health_check
+ health_check_remove
run_remove
;;Also applies to: 291-294
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@codex/install.sh` around lines 83 - 96, The remove command is routed through
health_check which calls ensure_git and ensure_skills_link_dir and thus can
block or mutate state during cleanup; change remove to bypass those install-time
checks by either (a) adding a new minimal function (e.g.,
health_check_no_side_effects) that only validates $HOME_DIR
existence/permissions and the PowerShell check, or (b) add a flag to
health_check to skip ensure_git and ensure_skills_link_dir when invoked from
remove; update the remove invocation to use the new minimal check so remove does
not call ensure_git or ensure_skills_link_dir and therefore does not create
~/.agents/skills or require git.
| doctor() { | ||
| info "Doctor mode: verifying prerequisites for install/update/migrate/remove." | ||
| local failures=0 | ||
| check_condition "Home directory $HOME_DIR exists (required by all commands)" test -d "$HOME_DIR" || failures=1 | ||
| check_condition "Home directory writable (needed to clone/pull and create links)" test -w "$HOME_DIR" || failures=1 | ||
| check_condition "Git command available (install/update/migrate)" command_exists git || failures=1 | ||
| local parent_dir | ||
| parent_dir=$(dirname "$SKILLS_LINK_DIR") | ||
| if [ -d "$SKILLS_LINK_DIR" ]; then | ||
| check_condition "Skills directory $SKILLS_LINK_DIR writable (link target)" test -w "$SKILLS_LINK_DIR" || failures=1 | ||
| else | ||
| if [ -d "$parent_dir" ]; then | ||
| check_condition "Skills parent directory $parent_dir writable (needed to create link dir)" test -w "$parent_dir" || failures=1 | ||
| else | ||
| local grandparent | ||
| grandparent=$(dirname "$parent_dir") | ||
| if [ -w "$grandparent" ]; then | ||
| printf " [INFO] Directory $parent_dir missing; grandparent $grandparent is writable and can host it.\n" | ||
| else | ||
| printf " [FAIL] Cannot create $SKILLS_LINK_DIR; grandparent $grandparent is not writable.\n" | ||
| failures=1 | ||
| fi | ||
| fi | ||
| fi | ||
| if [ $IS_WINDOWS -eq 1 ]; then | ||
| if command_exists pwsh; then | ||
| check_condition "pwsh available (Windows linking)" command_exists pwsh || failures=1 | ||
| elif command_exists powershell; then | ||
| check_condition "powershell available (Windows linking)" command_exists powershell || failures=1 | ||
| else | ||
| printf " [FAIL] PowerShell (pwsh/powershell) missing; Windows linking cannot work.\n" | ||
| failures=1 | ||
| fi | ||
| fi | ||
|
|
||
| if [ -d "$REPO_DIR/.git" ]; then | ||
| check_condition "Superpowers repo clone exists at $REPO_DIR" test -d "$REPO_DIR/.git" || failures=1 | ||
| else | ||
| printf " [INFO] Superpowers repo not cloned yet; install will create $REPO_DIR.\n" | ||
| fi | ||
|
|
||
| local agents_file="$HOME_DIR/.codex/AGENTS.md" | ||
| if [ -f "$agents_file" ]; then | ||
| if grep -q "superpowers-codex bootstrap" "$agents_file"; then | ||
| printf " [FAIL] %s still references the legacy bootstrap block; remove it.\n" "$agents_file" | ||
| failures=1 | ||
| else | ||
| printf " [OK] %s contains no legacy bootstrap block.\n" "$agents_file" | ||
| fi | ||
| else | ||
| printf " [INFO] %s not present; no legacy bootstrap block to remove.\n" "$agents_file" | ||
| fi | ||
|
|
||
| if [ $failures -ne 0 ]; then | ||
| error "Doctor found missing prerequisites. Fix the failures above before rerunning." | ||
| exit 1 | ||
| fi | ||
| info "Doctor check passed." | ||
| } |
There was a problem hiding this comment.
doctor does not verify the actual skills link state.
doctor reports environment readiness, but it never checks whether ~/.agents/skills/superpowers exists and points to $REPO_SKILLS_DIR. A broken/misdirected link currently passes.
Suggested fix
if [ -d "$REPO_DIR/.git" ]; then
check_condition "Superpowers repo clone exists at $REPO_DIR" test -d "$REPO_DIR/.git" || failures=1
else
printf " [INFO] Superpowers repo not cloned yet; install will create $REPO_DIR.\n"
fi
+
+ if [ -L "$LINK_PATH" ]; then
+ if [ $IS_WINDOWS -eq 1 ]; then
+ local link_path_ps
+ local target_ps
+ link_path_ps=$(ps_escape "$LINK_PATH")
+ target_ps=$(ps_escape "$REPO_SKILLS_DIR")
+ if run_powershell "\$i=Get-Item -LiteralPath '$link_path_ps' -ErrorAction SilentlyContinue; if (\$null -eq \$i) { exit 1 }; if (\$i.Target -eq '$target_ps') { exit 0 } else { exit 1 }"; then
+ printf " [OK] Skills link exists and points to %s.\n" "$REPO_SKILLS_DIR"
+ else
+ printf " [FAIL] Skills link exists but does not point to %s.\n" "$REPO_SKILLS_DIR"
+ failures=1
+ fi
+ else
+ if [ "$(readlink "$LINK_PATH")" = "$REPO_SKILLS_DIR" ]; then
+ printf " [OK] Skills link exists and points to %s.\n" "$REPO_SKILLS_DIR"
+ else
+ printf " [FAIL] Skills link exists but does not point to %s.\n" "$REPO_SKILLS_DIR"
+ failures=1
+ fi
+ fi
+ else
+ printf " [INFO] Skills link %s is not present yet; install will create it.\n" "$LINK_PATH"
+ fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| doctor() { | |
| info "Doctor mode: verifying prerequisites for install/update/migrate/remove." | |
| local failures=0 | |
| check_condition "Home directory $HOME_DIR exists (required by all commands)" test -d "$HOME_DIR" || failures=1 | |
| check_condition "Home directory writable (needed to clone/pull and create links)" test -w "$HOME_DIR" || failures=1 | |
| check_condition "Git command available (install/update/migrate)" command_exists git || failures=1 | |
| local parent_dir | |
| parent_dir=$(dirname "$SKILLS_LINK_DIR") | |
| if [ -d "$SKILLS_LINK_DIR" ]; then | |
| check_condition "Skills directory $SKILLS_LINK_DIR writable (link target)" test -w "$SKILLS_LINK_DIR" || failures=1 | |
| else | |
| if [ -d "$parent_dir" ]; then | |
| check_condition "Skills parent directory $parent_dir writable (needed to create link dir)" test -w "$parent_dir" || failures=1 | |
| else | |
| local grandparent | |
| grandparent=$(dirname "$parent_dir") | |
| if [ -w "$grandparent" ]; then | |
| printf " [INFO] Directory $parent_dir missing; grandparent $grandparent is writable and can host it.\n" | |
| else | |
| printf " [FAIL] Cannot create $SKILLS_LINK_DIR; grandparent $grandparent is not writable.\n" | |
| failures=1 | |
| fi | |
| fi | |
| fi | |
| if [ $IS_WINDOWS -eq 1 ]; then | |
| if command_exists pwsh; then | |
| check_condition "pwsh available (Windows linking)" command_exists pwsh || failures=1 | |
| elif command_exists powershell; then | |
| check_condition "powershell available (Windows linking)" command_exists powershell || failures=1 | |
| else | |
| printf " [FAIL] PowerShell (pwsh/powershell) missing; Windows linking cannot work.\n" | |
| failures=1 | |
| fi | |
| fi | |
| if [ -d "$REPO_DIR/.git" ]; then | |
| check_condition "Superpowers repo clone exists at $REPO_DIR" test -d "$REPO_DIR/.git" || failures=1 | |
| else | |
| printf " [INFO] Superpowers repo not cloned yet; install will create $REPO_DIR.\n" | |
| fi | |
| local agents_file="$HOME_DIR/.codex/AGENTS.md" | |
| if [ -f "$agents_file" ]; then | |
| if grep -q "superpowers-codex bootstrap" "$agents_file"; then | |
| printf " [FAIL] %s still references the legacy bootstrap block; remove it.\n" "$agents_file" | |
| failures=1 | |
| else | |
| printf " [OK] %s contains no legacy bootstrap block.\n" "$agents_file" | |
| fi | |
| else | |
| printf " [INFO] %s not present; no legacy bootstrap block to remove.\n" "$agents_file" | |
| fi | |
| if [ $failures -ne 0 ]; then | |
| error "Doctor found missing prerequisites. Fix the failures above before rerunning." | |
| exit 1 | |
| fi | |
| info "Doctor check passed." | |
| } | |
| doctor() { | |
| info "Doctor mode: verifying prerequisites for install/update/migrate/remove." | |
| local failures=0 | |
| check_condition "Home directory $HOME_DIR exists (required by all commands)" test -d "$HOME_DIR" || failures=1 | |
| check_condition "Home directory writable (needed to clone/pull and create links)" test -w "$HOME_DIR" || failures=1 | |
| check_condition "Git command available (install/update/migrate)" command_exists git || failures=1 | |
| local parent_dir | |
| parent_dir=$(dirname "$SKILLS_LINK_DIR") | |
| if [ -d "$SKILLS_LINK_DIR" ]; then | |
| check_condition "Skills directory $SKILLS_LINK_DIR writable (link target)" test -w "$SKILLS_LINK_DIR" || failures=1 | |
| else | |
| if [ -d "$parent_dir" ]; then | |
| check_condition "Skills parent directory $parent_dir writable (needed to create link dir)" test -w "$parent_dir" || failures=1 | |
| else | |
| local grandparent | |
| grandparent=$(dirname "$parent_dir") | |
| if [ -w "$grandparent" ]; then | |
| printf " [INFO] Directory $parent_dir missing; grandparent $grandparent is writable and can host it.\n" | |
| else | |
| printf " [FAIL] Cannot create $SKILLS_LINK_DIR; grandparent $grandparent is not writable.\n" | |
| failures=1 | |
| fi | |
| fi | |
| fi | |
| if [ $IS_WINDOWS -eq 1 ]; then | |
| if command_exists pwsh; then | |
| check_condition "pwsh available (Windows linking)" command_exists pwsh || failures=1 | |
| elif command_exists powershell; then | |
| check_condition "powershell available (Windows linking)" command_exists powershell || failures=1 | |
| else | |
| printf " [FAIL] PowerShell (pwsh/powershell) missing; Windows linking cannot work.\n" | |
| failures=1 | |
| fi | |
| fi | |
| if [ -d "$REPO_DIR/.git" ]; then | |
| check_condition "Superpowers repo clone exists at $REPO_DIR" test -d "$REPO_DIR/.git" || failures=1 | |
| else | |
| printf " [INFO] Superpowers repo not cloned yet; install will create $REPO_DIR.\n" | |
| fi | |
| if [ -L "$LINK_PATH" ]; then | |
| if [ $IS_WINDOWS -eq 1 ]; then | |
| local link_path_ps | |
| local target_ps | |
| link_path_ps=$(ps_escape "$LINK_PATH") | |
| target_ps=$(ps_escape "$REPO_SKILLS_DIR") | |
| if run_powershell "\$i=Get-Item -LiteralPath '$link_path_ps' -ErrorAction SilentlyContinue; if (\$null -eq \$i) { exit 1 }; if (\$i.Target -eq '$target_ps') { exit 0 } else { exit 1 }"; then | |
| printf " [OK] Skills link exists and points to %s.\n" "$REPO_SKILLS_DIR" | |
| else | |
| printf " [FAIL] Skills link exists but does not point to %s.\n" "$REPO_SKILLS_DIR" | |
| failures=1 | |
| fi | |
| else | |
| if [ "$(readlink "$LINK_PATH")" = "$REPO_SKILLS_DIR" ]; then | |
| printf " [OK] Skills link exists and points to %s.\n" "$REPO_SKILLS_DIR" | |
| else | |
| printf " [FAIL] Skills link exists but does not point to %s.\n" "$REPO_SKILLS_DIR" | |
| failures=1 | |
| fi | |
| fi | |
| else | |
| printf " [INFO] Skills link %s is not present yet; install will create it.\n" "$LINK_PATH" | |
| fi | |
| local agents_file="$HOME_DIR/.codex/AGENTS.md" | |
| if [ -f "$agents_file" ]; then | |
| if grep -q "superpowers-codex bootstrap" "$agents_file"; then | |
| printf " [FAIL] %s still references the legacy bootstrap block; remove it.\n" "$agents_file" | |
| failures=1 | |
| else | |
| printf " [OK] %s contains no legacy bootstrap block.\n" "$agents_file" | |
| fi | |
| else | |
| printf " [INFO] %s not present; no legacy bootstrap block to remove.\n" "$agents_file" | |
| fi | |
| if [ $failures -ne 0 ]; then | |
| error "Doctor found missing prerequisites. Fix the failures above before rerunning." | |
| exit 1 | |
| fi | |
| info "Doctor check passed." | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@codex/install.sh` around lines 98 - 156, The doctor function currently skips
verifying that SKILLS_LINK_DIR exists and actually points to REPO_SKILLS_DIR;
add a check after the existing SKILLS_LINK_DIR branch to validate the link
target: if SKILLS_LINK_DIR exists and is a symlink (test -L), resolve its target
(readlink -f or realpath) and compare to REPO_SKILLS_DIR, using check_condition
to report success/failure (or mark failures=1) when the link is missing, not a
symlink, or points elsewhere; reference the doctor function, SKILLS_LINK_DIR,
REPO_SKILLS_DIR and check_condition to locate where to insert this validation.
| if [ $IS_WINDOWS -eq 1 ]; then | ||
| local target="$(ps_escape "$REPO_SKILLS_DIR")" | ||
| local link_path="$(ps_escape "$LINK_PATH")" | ||
| info "Creating PowerShell symbolic link from $LINK_PATH to $REPO_SKILLS_DIR..." | ||
| run_powershell "New-Item -ItemType SymbolicLink -Path '$link_path' -Target '$target' -Force | Out-Null" | ||
| else |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -name "install.sh" -type f | head -20Repository: obra/superpowers
Length of output: 78
🏁 Script executed:
git ls-files | grep -E "(install\.sh|codex)" | head -20Repository: obra/superpowers
Length of output: 115
🌐 Web query:
PowerShell New-Item SymbolicLink vs Junction Windows 10 11 admin privileges requirements
💡 Result:
PowerShell New-Item: SymbolicLink vs Junction — admin / privilege requirements (Windows 10/11)
SymbolicLink (New-Item -ItemType SymbolicLink)
- Requires elevation (Run as Administrator) by default on Windows. [1] (learn.microsoft.com)
- Does not require elevation if Windows Developer Mode is enabled (Windows 10 build 14972+). [1] (learn.microsoft.com)
- Under the hood this is governed by the “Create symbolic links” user right (SeCreateSymbolicLinkPrivilege), which by default is granted to Administrators. [2] (learn.microsoft.com)
Junction (New-Item -ItemType Junction)
- Does not require SeCreateSymbolicLinkPrivilege / Developer Mode; it generally only requires normal NTFS permissions to create the entry in the parent directory (and it’s directories-only, local paths). [3] (geeksforgeeks.org)
Practical rule of thumb
- If you need a link that can target files, UNC/network paths, or use relative paths reliably, choose SymbolicLink (and ensure elevation or Developer Mode). [1] (learn.microsoft.com)
- If you just need a directory-to-directory redirect on local drives and want to avoid admin/Developer Mode hassles, choose Junction. [3] (geeksforgeeks.org)
Sources
- [1] Microsoft Learn — New-Item (
-ItemType SymbolicLinkelevation + Developer Mode/build 14972 note) (learn.microsoft.com) - [2] Microsoft Learn — Create symbolic links security policy (SeCreateSymbolicLinkPrivilege; default = Administrators) (learn.microsoft.com)
- [3] GeeksforGeeks — junction points overview (notes junction creation doesn’t require admin vs symlinks) (geeksforgeeks.org)
Citations:
- 1: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item
- 2: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item
- 3: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn221947%28v%3Dws.11%29?utm_source=openai
- 4: https://www.geeksforgeeks.org/operating-systems/ntfs-junction-points/?utm_source=openai
- 5: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item
- 6: https://www.geeksforgeeks.org/operating-systems/ntfs-junction-points/?utm_source=openai
- 7: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item
- 8: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn221947%28v%3Dws.11%29?utm_source=openai
- 9: https://www.geeksforgeeks.org/operating-systems/ntfs-junction-points/?utm_source=openai
🏁 Script executed:
sed -n '190,210p' ./codex/install.shRepository: obra/superpowers
Length of output: 877
Add junction fallback for Windows link creation to improve reliability.
On Windows, New-Item -ItemType SymbolicLink requires either administrator privileges or Developer Mode (Windows 10 build 14972+). Since REPO_SKILLS_DIR is always a directory (validated on line 192), using a Junction as a fallback is more reliable for users without elevated privileges. Junctions work for directory-to-directory scenarios without requiring special permissions.
Suggested fix
if [ $IS_WINDOWS -eq 1 ]; then
local target="$(ps_escape "$REPO_SKILLS_DIR")"
local link_path="$(ps_escape "$LINK_PATH")"
- info "Creating PowerShell symbolic link from $LINK_PATH to $REPO_SKILLS_DIR..."
- run_powershell "New-Item -ItemType SymbolicLink -Path '$link_path' -Target '$target' -Force | Out-Null"
+ info "Creating Windows link from $LINK_PATH to $REPO_SKILLS_DIR..."
+ run_powershell "try {
+ New-Item -ItemType SymbolicLink -Path '$link_path' -Target '$target' -Force -ErrorAction Stop | Out-Null
+ } catch {
+ New-Item -ItemType Junction -Path '$link_path' -Target '$target' -Force -ErrorAction Stop | Out-Null
+ }"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [ $IS_WINDOWS -eq 1 ]; then | |
| local target="$(ps_escape "$REPO_SKILLS_DIR")" | |
| local link_path="$(ps_escape "$LINK_PATH")" | |
| info "Creating PowerShell symbolic link from $LINK_PATH to $REPO_SKILLS_DIR..." | |
| run_powershell "New-Item -ItemType SymbolicLink -Path '$link_path' -Target '$target' -Force | Out-Null" | |
| else | |
| if [ $IS_WINDOWS -eq 1 ]; then | |
| local target="$(ps_escape "$REPO_SKILLS_DIR")" | |
| local link_path="$(ps_escape "$LINK_PATH")" | |
| info "Creating Windows link from $LINK_PATH to $REPO_SKILLS_DIR..." | |
| run_powershell "try { | |
| New-Item -ItemType SymbolicLink -Path '$link_path' -Target '$target' -Force -ErrorAction Stop | Out-Null | |
| } catch { | |
| New-Item -ItemType Junction -Path '$link_path' -Target '$target' -Force -ErrorAction Stop | Out-Null | |
| }" | |
| else |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 196-196: Declare and assign separately to avoid masking return values.
(SC2155)
[warning] 197-197: Declare and assign separately to avoid masking return values.
(SC2155)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@codex/install.sh` around lines 195 - 200, Windows link creation using
New-Item -ItemType SymbolicLink can fail without admin/DevMode; update the
IS_WINDOWS branch to try the symbolic link via run_powershell first and if that
command fails fall back to creating a directory junction (since REPO_SKILLS_DIR
is always a directory). Use ps_escape on REPO_SKILLS_DIR and LINK_PATH as
already done, run run_powershell "New-Item -ItemType SymbolicLink ..." and check
its exit/status, and on non-zero failure invoke run_powershell or cmd to create
a Junction (New-Item -ItemType Junction or mklink /J) and log/info about the
fallback; ensure the logic references IS_WINDOWS, REPO_SKILLS_DIR, LINK_PATH and
run_powershell so the fallback is applied only for directory links on Windows.
That PR add a script to install superpowers on Codex;
Add information about the script inside
docs/README.codex.mdand.codex/INSTALL.mdMotivation and Context
Testing the Superpowers I created that bash/powershell script to install it on Codex;
How Has This Been Tested?
I did a manual test of all options, it's a simple script.
The powershell part was tested on a Mac using the
pwshapp.Breaking Changes
Nothing will break because of this file;
Types of changes
Checklist