Skip to content

Add powershell (windows) support#238

Merged
Alan-Jowett merged 6 commits intomicrosoft:mainfrom
what-cloud:main
Apr 16, 2026
Merged

Add powershell (windows) support#238
Alan-Jowett merged 6 commits intomicrosoft:mainfrom
what-cloud:main

Conversation

@cnukaus
Copy link
Copy Markdown
Contributor

@cnukaus cnukaus commented Apr 9, 2026

Enhanced Powershell support:

I added Windows command resolution helpers, added codex detection, expanded the “no CLI found” message to include Codex, and changed npm-installed CLIs to prefer <name>.cmd on Windows before spawning.
That fixes the exact failure mode where PowerShell can run codex but child_process.spawn(\"codex\") cannot.

I also updated the CLI surface and docs, now advertises codex in --cli

@cnukaus
Copy link
Copy Markdown
Contributor Author

cnukaus commented Apr 9, 2026

@microsoft-github-policy-service agree

@Alan-Jowett
Copy link
Copy Markdown
Member

Thank you for this contribution, @cnukaus! 🎉 Adding Codex CLI support and fixing the Windows .cmd shim resolution issue with child_process.spawn() is a great improvement — this is a real pain point for Windows users.

The resolveSpawnCommand() approach is well thought out, the test coverage is solid, and the documentation updates are thorough. I've left a few review comments below — mostly around spec sync and a test edge case. Really appreciate you taking the time to submit this!

Copy link
Copy Markdown
Member

@Alan-Jowett Alan-Jowett left a comment

Choose a reason for hiding this comment

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

Thanks again for this well-structured PR! A few items to address before merge:

IMPLEMENTATION_PLAN.md — please remove (must fix)

This appears to be a development log from the implementation process. PromptKit doesn't maintain implementation plans at the repo root, and this would add noise to the project structure.

Spec files need codex added (should fix):

requirements.md has several references to the supported CLI list that need codex added:

  • REQ-CLI-010 — detection order (copilot → gh copilot → claude)
  • REQ-CLI-011 — valid --cli values (copilot, gh-copilot, claude)
  • REQ-CLI-017 — per-CLI spawn commands (missing codex entry)
  • ASSUMPTION-003 — accepted --cli values

validation.md should document the new TC-CLI-072A test case alongside existing TC-CLI-072.

Comment thread cli/tests/launch.test.js
Comment thread cli/specs/design.md
@what-cloud
Copy link
Copy Markdown
Contributor

Updated routing .cmd launches through cmd.exe in cli/lib/launch.js:67 while keeping
argument handling explicit, so it does not fall back to the old shell: true behavior.

The No supported LLM CLI found on PATH lines are still expected from the negative-path tests. The important part is that the spawn EINVAL should now be gone.

@Alan-Jowett
Copy link
Copy Markdown
Member

Hi @cnukaus / @what-cloud — thanks for the follow-up commits! A few items still need attention before we can merge:

  1. IMPLEMENTATION_PLAN.md — still present (must fix)
    This development log shouldn't live at the repo root. Please remove it from the PR.

  2. cli/specs/design.md line 148 — stale detection description
    The text still references execFileSync with where/which, but the implementation now uses direct PATH scanning. Since you're already editing this section, it would be great to correct this.

  3. cli/specs/requirements.md — character encoding corruption
    All em-dashes (, U+2014) in this file have been replaced with triple question marks (???, U+003F × 3) — 30 occurrences. This appears to be an editor or locale encoding issue. The base branch has the correct em-dashes; the PR branch has ??? in their place. The same issue also affects a few comments in cli/tests/launch.test.js.

    You can verify by searching for ??? in the file, or comparing the raw bytes against the upstream version.

Everything else looks good — the spec updates for codex, the test fixes, and the Windows .cmd shim logic are all solid. Just these three items to tidy up. Thanks again for the contribution! 🙏

@cnukaus cnukaus requested a review from Alan-Jowett April 16, 2026 11:31
@cnukaus
Copy link
Copy Markdown
Contributor Author

cnukaus commented Apr 16, 2026

@Alan-Jowett

  1. the file was removed
  2. updated
  3. can you re-check? I copied it again from your latest master

Hi @cnukaus / @what-cloud — thanks for the follow-up commits! A few items still need attention before we can merge:

  1. IMPLEMENTATION_PLAN.md — still present (must fix)
    This development log shouldn't live at the repo root. Please remove it from the PR.
  2. cli/specs/design.md line 148 — stale detection description
    The text still references execFileSync with where/which, but the implementation now uses direct PATH scanning. Since you're already editing this section, it would be great to correct this.
  3. cli/specs/requirements.md — character encoding corruption
    All em-dashes (, U+2014) in this file have been replaced with triple question marks (???, U+003F × 3) — 30 occurrences. This appears to be an editor or locale encoding issue. The base branch has the correct em-dashes; the PR branch has ??? in their place. The same issue also affects a few comments in cli/tests/launch.test.js.
    You can verify by searching for ??? in the file, or comparing the raw bytes against the upstream version.

Everything else looks good — the spec updates for codex, the test fixes, and the Windows .cmd shim logic are all solid. Just these three items to tidy up. Thanks again for the contribution! 🙏

@Alan-Jowett Alan-Jowett merged commit 291cb8c into microsoft:main Apr 16, 2026
4 checks passed
Alan-Jowett pushed a commit to Alan-Jowett/PromptKit that referenced this pull request Apr 16, 2026
PR microsoft#238 introduced encoding corruption where em-dash characters (—)
were replaced with ??? in four locations in launch.test.js. This
restores the original Unicode em-dash (U+2014) characters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alan-Jowett added a commit that referenced this pull request Apr 16, 2026
PR #238 introduced encoding corruption where em-dash characters (—)
were replaced with ??? in four locations in launch.test.js. This
restores the original Unicode em-dash (U+2014) characters.

Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants