Skip to content

Conversation

@PhenixStar
Copy link

Summary

  • Auto-detect Windows (MINGW/MSYS/CYGWIN) in install.sh — no longer errors on Windows
  • Install dependencies inside WSL automatically when Windows is detected
  • Create Windows-side codex-agent shim at ~/bin/codex-agent with path conversion
  • Add codex-agent-wsl.sh bridge wrapper handling 3 Windows path formats
  • Fix Linux script command syntax in tmux.ts (macOS BSD vs Linux util-linux)
  • Update README.md and SKILL.md with Windows/WSL documentation

How it works

  1. install.sh detects Windows via uname -s (CYGWIN/MINGW/MSYS)
  2. Checks WSL is available with a default distro (wsl --status)
  3. Re-invokes itself inside WSL for tmux/bun/codex install
  4. Creates ~/bin/codex-agent shim on Windows side
  5. Shim auto-converts Windows paths to WSL /mnt/ format and routes through wsl -e bash

Changes

  • scripts/install.sh: Added PLATFORM=windows detection, install_via_wsl(), create_windows_shim(), convert_to_wsl_path()
  • scripts/codex-agent-wsl.sh: New WSL bridge wrapper with 3-format path conversion (Git Bash /c/, CMD C:\, PowerShell C:/)
  • src/tmux.ts: Detect macOS vs Linux at runtime for script command syntax (script -q logfile cmd vs script -q -c "cmd" logfile)
  • README.md: Added Windows/WSL installation section
  • SKILL.md: Added Windows/WSL prerequisites note

Path conversion

The bridge converts -d/--dir and -f/--file flag values automatically:

  • /c/Users/foo/mnt/c/Users/foo (Git Bash)
  • C:\Users\foo/mnt/c/Users/foo (CMD)
  • C:/Users/foo/mnt/c/Users/foo (PowerShell)

CWD is also auto-converted so agents work in the correct directory.

Linux script fix

The script command in tmux.ts used macOS/BSD syntax (script -q logfile command). On Linux distros with util-linux, this requires -c flag (script -q -c "command" logfile). Without -c, the codex args were consumed by script as the logfile path. Now detects os.platform() at runtime.

Testing

  • Tested on Windows 11 with Git Bash + WSL 2 (Kali Linux)
  • codex-agent health, jobs, start --dry-run all verified from Git Bash
  • Linux/macOS install paths unchanged (no regression)
  • Install is idempotent — re-running updates cleanly

Test plan

  • Fresh install from Git Bash on Windows with WSL
  • codex-agent health returns "Status: Ready"
  • codex-agent start "test" -d "C:\Users\..." --dry-run converts paths
  • Re-run install.sh — idempotent update
  • Run install.sh inside WSL directly — normal Linux flow
  • Verify script command works on both macOS and Linux

- Auto-detect Windows (MINGW/MSYS/CYGWIN) in install.sh instead of erroring
- Install dependencies inside WSL automatically when on Windows
- Create Windows-side codex-agent shim with Win→WSL path conversion
- Add codex-agent-wsl.sh bridge wrapper handling 3 path formats
- Fix Linux script command syntax in tmux.ts (BSD vs util-linux)
- Update README and SKILL.md with Windows/WSL documentation
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