-
Notifications
You must be signed in to change notification settings - Fork 8
feat: native Windows support #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
797587e
chore: add .gitattributes for cross-platform line endings
Kevin7Qi d6f1a47
fix: cross-platform paths and process handling for Windows support
Kevin7Qi 2d52f82
fix: use explicit falsy check in getHome() instead of try/catch
Kevin7Qi 134e73c
fix: use os.tmpdir() and path.join() in tests for Windows support
Kevin7Qi ed9ea78
feat: add install.ps1 Windows installer with .cmd shim
Kevin7Qi 70fec6e
ci: add Windows runner to CI matrix
Kevin7Qi 8f89b48
docs: add Windows installation instructions to README
Kevin7Qi 83ce0a9
fix: harden installer error handling and fix review feedback
Kevin7Qi ab718f9
docs: restructure README installation section
Kevin7Qi 45fb701
fix: Windows testing and installer issues from real-device feedback
Kevin7Qi 136bc65
fix: work around bun test .rejects flush issue on Windows
Kevin7Qi 2a30f1f
fix: use bash shebang in Windows extensionless shim
Kevin7Qi bf5c52c
fix: harden Windows process cleanup and installer error handling
Kevin7Qi 3eacb99
fix: suppress spurious taskkill warning on Windows
Kevin7Qi 23d7399
fix: address Codex review findings for Windows support
Kevin7Qi e6f3500
ci: install codex CLI and fix Windows smoke test invocation
Kevin7Qi 0b4b747
fix: simplify installer shim creation and harden test assertions
Kevin7Qi 1315c85
fix: skip server operations in kill when thread is already killed
Kevin7Qi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Normalize all text files to LF in the repo | ||
| * text=auto eol=lf | ||
|
|
||
| # Windows scripts use CRLF (required by CMD/BAT; conventional for .ps1) | ||
| *.ps1 text eol=crlf | ||
| *.cmd text eol=crlf | ||
| *.bat text eol=crlf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| #Requires -Version 5.1 | ||
| <# | ||
| .SYNOPSIS | ||
| Install codex-collab on Windows. | ||
| .PARAMETER Dev | ||
| Symlink source files for live development instead of building. | ||
| #> | ||
| param( | ||
| [switch]$Dev, | ||
| [switch]$Help | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| $RepoDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $SkillDir = Join-Path $env:USERPROFILE ".claude\skills\codex-collab" | ||
| $BinDir = Join-Path $env:USERPROFILE ".local\bin" | ||
|
|
||
| function Show-Usage { | ||
| Write-Host "Usage: powershell -File install.ps1 [-Dev]" | ||
| Write-Host "" | ||
| Write-Host " (default) Build and copy a self-contained skill directory" | ||
| Write-Host " -Dev Symlink source files for live development" | ||
| } | ||
|
|
||
| if ($Help) { | ||
| Show-Usage | ||
| exit 0 | ||
| } | ||
|
|
||
| # Check prerequisites | ||
| $missing = @() | ||
| if (-not (Get-Command bun -ErrorAction SilentlyContinue)) { $missing += "bun" } | ||
| if (-not (Get-Command codex -ErrorAction SilentlyContinue)) { $missing += "codex" } | ||
|
|
||
| if ($missing.Count -gt 0) { | ||
| Write-Host "Missing prerequisites: $($missing -join ', ')" | ||
| Write-Host " bun: https://bun.sh/" | ||
| Write-Host " codex: npm install -g @openai/codex" | ||
| exit 1 | ||
| } | ||
|
|
||
| # Install dependencies | ||
| Write-Host "Installing dependencies..." | ||
| Push-Location $RepoDir | ||
| try { | ||
| bun install | ||
| if ($LASTEXITCODE -ne 0) { throw "'bun install' failed with exit code $LASTEXITCODE" } | ||
| } catch { | ||
| Write-Host "Error: $_" | ||
| exit 1 | ||
| } finally { | ||
| Pop-Location | ||
| } | ||
|
|
||
| if ($Dev) { | ||
| Write-Host "Installing in dev mode (symlinks)..." | ||
| Write-Host "Note: Symlinks on Windows may require Developer Mode or elevated privileges." | ||
|
|
||
| # Create skill directory | ||
| New-Item -ItemType Directory -Path (Join-Path $SkillDir "scripts") -Force | Out-Null | ||
|
|
||
| # Symlink skill files (requires Developer Mode or elevated privileges) | ||
| $links = @( | ||
| @{ Path = (Join-Path $SkillDir "SKILL.md"); Target = (Join-Path $RepoDir "SKILL.md") } | ||
| @{ Path = (Join-Path $SkillDir "scripts\codex-collab"); Target = (Join-Path $RepoDir "src\cli.ts") } | ||
| @{ Path = (Join-Path $SkillDir "LICENSE.txt"); Target = (Join-Path $RepoDir "LICENSE") } | ||
| ) | ||
|
|
||
| foreach ($link in $links) { | ||
| if (Test-Path $link.Path) { Remove-Item $link.Path -Force } | ||
| try { | ||
| New-Item -ItemType SymbolicLink -Path $link.Path -Target $link.Target -Force | Out-Null | ||
| } catch { | ||
| Write-Host "" | ||
| Write-Host "Error: Cannot create symlinks. Dev mode requires one of:" | ||
| Write-Host " 1. Enable Developer Mode: Settings > Update & Security > For developers" | ||
| Write-Host " 2. Run this script in an elevated (Administrator) terminal" | ||
| Write-Host "" | ||
| Write-Host "Alternatively, use build mode (without -Dev) which does not need symlinks." | ||
| exit 1 | ||
| } | ||
| } | ||
| Write-Host "Linked skill to $SkillDir" | ||
|
|
||
| $shimTarget = Join-Path $RepoDir "src\cli.ts" | ||
|
|
||
| } else { | ||
| Write-Host "Building..." | ||
|
|
||
| # Build bundled JS | ||
| $skillBuild = Join-Path $RepoDir "skill\codex-collab" | ||
| if (Test-Path $skillBuild) { Remove-Item $skillBuild -Recurse -Force } | ||
| New-Item -ItemType Directory -Path (Join-Path $skillBuild "scripts") -Force | Out-Null | ||
|
|
||
| $built = Join-Path $skillBuild "scripts\codex-collab" | ||
| try { | ||
| bun build (Join-Path $RepoDir "src\cli.ts") --outfile $built --target bun | ||
| if ($LASTEXITCODE -ne 0) { throw "'bun build' failed with exit code $LASTEXITCODE" } | ||
| } catch { | ||
| Write-Host "Error: $_" | ||
| exit 1 | ||
| } | ||
|
|
||
| # Prepend shebang if missing (needed for Unix execution; harmless on Windows with Bun) | ||
| $content = Get-Content $built -Raw | ||
| if (-not $content.StartsWith("#!/")) { | ||
| [System.IO.File]::WriteAllText($built, "#!/usr/bin/env bun`n" + $content, [System.Text.UTF8Encoding]::new($false)) | ||
| } | ||
|
|
||
| # Copy SKILL.md and LICENSE | ||
| Copy-Item (Join-Path $RepoDir "SKILL.md") (Join-Path $skillBuild "SKILL.md") | ||
| Copy-Item (Join-Path $RepoDir "LICENSE") (Join-Path $skillBuild "LICENSE.txt") | ||
|
|
||
| # Install skill | ||
| if (Test-Path $SkillDir) { Remove-Item $SkillDir -Recurse -Force } | ||
| New-Item -ItemType Directory -Path (Split-Path $SkillDir) -Force | Out-Null | ||
| Copy-Item $skillBuild $SkillDir -Recurse | ||
| Write-Host "Installed skill to $SkillDir" | ||
|
|
||
| $shimTarget = Join-Path $SkillDir "scripts\codex-collab" | ||
| } | ||
|
|
||
| # Create .cmd shim (CMD/PowerShell) and extensionless bash wrapper (Git Bash/MSYS2) | ||
| New-Item -ItemType Directory -Path $BinDir -Force | Out-Null | ||
| $cmdShim = Join-Path $BinDir "codex-collab.cmd" | ||
| [System.IO.File]::WriteAllText($cmdShim, "@bun `"$shimTarget`" %*`r`n", [System.Text.UTF8Encoding]::new($false)) | ||
| $bashShim = Join-Path $BinDir "codex-collab" | ||
| [System.IO.File]::WriteAllText($bashShim, "#!/usr/bin/env bash`nexec bun `"$shimTarget`" `"`$@`"", [System.Text.UTF8Encoding]::new($false)) | ||
| Write-Host "Created binary shims at $BinDir" | ||
|
|
||
| # Add bin dir to user PATH if not already present | ||
| $userPath = [Environment]::GetEnvironmentVariable("Path", "User") | ||
| if ($userPath -notlike "*$BinDir*") { | ||
| [Environment]::SetEnvironmentVariable("Path", "$BinDir;$userPath", "User") | ||
| Write-Host "Added $BinDir to user PATH (permanent)." | ||
| } | ||
| # Update current session PATH | ||
| if ($env:Path -notlike "*$BinDir*") { | ||
| $env:Path = "$BinDir;$env:Path" | ||
| } | ||
|
|
||
| # Verify and health check | ||
| Write-Host "" | ||
| codex-collab health | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Error: 'codex-collab health' failed. The installation may be broken." | ||
| exit 1 | ||
| } | ||
|
|
||
| $mode = if ($Dev) { "dev" } else { "build" } | ||
| Write-Host "" | ||
| Write-Host "Done ($mode mode). Open a new terminal, then run 'codex-collab --help' to get started." |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.