Skip to content

fix(workspaces): Windows .cmd twins for alice CLI shims (closes #364)#369

Merged
luokerenx4 merged 1 commit into
masterfrom
feat/win-cli-cmd-shims
Jun 22, 2026
Merged

fix(workspaces): Windows .cmd twins for alice CLI shims (closes #364)#369
luokerenx4 merged 1 commit into
masterfrom
feat/win-cli-cmd-shims

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

The workspace CLI shims (alice / alice-workspace / alice-uta / traderhub) are extensionless Node scripts that rely on a Unix shebang. Windows resolves executables on PATH by extension (PATHEXT) and has no shebang concept, so an extensionless shim has no association → every invocation popped a "How do you want to open this file?" dialog inside the workspace PTY (community issue #364, Problem 2).

  • Add a .cmd twin per export. cliBinPath() prepends the whole bin dir to PATH and build.files already ships src/workspaces/cli/**, so PATHEXT finds the twins with no deploy change.
  • Each .cmd runs its own sibling shim (@node "%~dp0<name>" %*) — the shim self-detects its export from argv[1], so a .cmd pointing at the wrong shim would route to the wrong gateway export.
  • Shims stay byte-identical (existing drift test still guards them); .cmd content lives outside them. macOS/Linux ignore .cmd.

Issue #364, Problem 1 (bootstrap.sh exit 127 on Windows) was already resolved by #363 — it eliminated bash for built-in templates (bootstrap.mjs on bundled Node + dugite git) instead of patching Git-Bash path handling — so this PR closes the remaining half.

Test plan

  • npx tsc --noEmit clean
  • pnpm test — 2027 passing (new shim.spec.ts case: every export ships a .cmd twin that runs its own shim + forwards args)
  • Manual (Windows): launch a workspace, confirm alice / traderhub run with no file-association dialog

Credit

Reported by @lvysssss in #364 (detailed, verified repro). Per CONTRIBUTORS policy this is credited via a Reported-by: trailer, not a co-authorship trailer.

🤖 Generated with Claude Code

#364 P2)

The workspace CLI shims (alice / alice-workspace / alice-uta / traderhub) are
extensionless Node scripts — they rely on a Unix shebang. Windows has no shebang
concept: it resolves executables on PATH by extension (PATHEXT), and an
extensionless file has no association, so every invocation popped a "How do you
want to open this file?" dialog inside the workspace PTY.

Add a `.cmd` twin per export. cliBinPath() prepends the whole bin dir to PATH and
build.files already ships `src/workspaces/cli/**`, so the twins are picked up by
PATHEXT with no deploy change. Each `.cmd` invokes its OWN sibling shim
(`@node "%~dp0<name>"`), because the shim self-detects its export from argv[1] —
pointing at the wrong shim would route to the wrong gateway export.

Shims stay byte-identical (the existing drift test still guards that); the .cmd
content lives outside them. macOS/Linux ignore .cmd entirely.

issue #364's other half (bootstrap.sh exit 127 on Windows) was already resolved
by #363, which eliminated bash for built-in templates (bootstrap.mjs on bundled
Node + dugite git) rather than fixing the Git-Bash path handling.

Reported-by: @lvysssss
Closes #364

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jun 22, 2026 3:06pm

Request Review

@luokerenx4 luokerenx4 merged commit 1a946b6 into master Jun 22, 2026
5 checks passed
@luokerenx4 luokerenx4 mentioned this pull request Jun 22, 2026
3 tasks
pull Bot pushed a commit to dubbypanda/OpenAlice that referenced this pull request Jun 22, 2026
… fixes

Filed issue TraderAlice#364 with a detailed, verified repro of both Windows blockers — the
bootstrap path/bash failures and the extensionless CLI-shim file-association
dialog. Both are now resolved (TraderAlice#363 + TraderAlice#369). Credited per the CONTRIBUTORS
policy (recognition, not a co-authorship claim).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pull Bot pushed a commit to dubbypanda/OpenAlice that referenced this pull request Jun 22, 2026
Since beta.4:
- fix(workspaces): Windows .cmd twins for the alice CLI shims — no more file-association dialog on every shim call (TraderAlice#369, closes TraderAlice#364)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.

1 participant