Branch: feature/windows-multiplatform-support
Issue: #5 - Bug: Windows Clone Fails - Colons in File Paths
Created: 2026-01-25
Status: RESEARCH COMPLETE - Implementation Pending
PAI-OpenCode is currently NOT Windows-compatible. This document tracks all identified issues and the implementation plan to achieve multi-platform support.
Key Finding: OpenCode itself has known Windows issues (GitHub Issue #631 tracks 23 problems with only 10 resolved). Our approach must account for upstream limitations.
| # | Issue | Severity | Windows Native | WSL | Fix Complexity |
|---|---|---|---|---|---|
| 1 | Colons in filenames (URL cache) | BLOCKER | ❌ Clone fails | HIGH (git history) | |
| 2 | /tmp paths hardcoded |
HIGH | ❌ Path not found | ✅ Works | LOW |
| 3 | process.env.HOME |
HIGH | ❌ Undefined | ✅ Works | LOW |
| 4 | Symlink requirement | HIGH | ✅ Works | MEDIUM | |
| 5 | .zshrc/.bashrc config |
MEDIUM | ❌ Not applicable | ✅ Works | MEDIUM |
| 6 | process.env.SHELL detection |
MEDIUM | ❌ Undefined | ✅ Works | LOW |
| 7 | Bash scripts | MEDIUM | ❌ Can't run | ✅ Works | MEDIUM |
| 8 | ~ tilde expansion |
MEDIUM | ✅ Works | LOW |
4 files in .opencode/skills/Browser/ use URLs as filenames, which contain colons:
.opencode/skills/Browser/Tools/https:/danielmiessler.com/blog/introducing-amazon-curate-i-wish
.opencode/skills/Browser/Browser/Tools/https:/danielmiessler.com/blog/introducing-amazon-curate-i-wish
.opencode/skills/Browser/Browser/http:/localhost:5173/ideas
.opencode/skills/Browser/Browser/http:/localhost:5173/ideas#the-full-archive
Windows filesystem forbids these characters: < > : " / \ | ? *
The Browser skill automatically caches screenshots/pages using the URL as the path. These caches were accidentally committed to git.
Option A: Remove from git history (Recommended)
# Using git-filter-repo (safer than filter-branch)
pip install git-filter-repo
git filter-repo --path '.opencode/skills/Browser/Tools/https:' --invert-paths
git filter-repo --path '.opencode/skills/Browser/Browser/Tools/https:' --invert-paths
git filter-repo --path '.opencode/skills/Browser/Browser/Tools/http:' --invert-paths
git filter-repo --path '.opencode/skills/Browser/Browser/http:' --invert-paths
# Force push (destructive!)
git push origin --force --allOption B: Sparse checkout workaround (for users)
git clone --no-checkout https://github.com/Steffen025/pai-opencode.git
cd pai-opencode
git sparse-checkout init
git sparse-checkout set "/*" "!*/Browser/Browser/Tools/https:*" "!*/Browser/Browser/http:*" "!*/Browser/Tools/https:*"
git checkoutAdd to .gitignore:
# Browser skill caches (contain URLs with colons)
.opencode/skills/Browser/**/https:*
.opencode/skills/Browser/**/http:*
.opencode/skills/Browser/**/*#*| File | Line(s) | Current | Fix |
|---|---|---|---|
Browser/Tools/BrowserSession.ts |
38 | /tmp/browser-session.json |
os.tmpdir() |
Browser/Tools/Browse.ts |
23, 321, 427 | /tmp/... |
os.tmpdir() |
Browser/Browser/Tools/* |
(duplicates) | Same | Same |
CORE/Tools/SplitAndTranscribe.ts |
- | /tmp/transcript-... |
os.tmpdir() |
// Before (Unix only):
const STATE_FILE = '/tmp/browser-session.json'
// After (cross-platform):
import { tmpdir } from 'os'
import path from 'path'
const STATE_FILE = path.join(tmpdir(), 'browser-session.json')- Installer engine:
PAI-Install/engine/actions.ts,PAI-Install/engine/steps-fresh.ts,PAI-Install/engine/steps-migrate.ts - CLI entrypoint:
PAI-Install/cli/quick-install.ts Telos/Tools/UpdateTelos.tsCORE/Tools/Banner*.tsCORE/Tools/FeatureRegistry.tsCORE/Tools/LearningPatternSynthesis.ts
// Before (Unix only):
const HOME = process.env.HOME!
// After (cross-platform):
import { homedir } from 'os'
const HOME = homedir()Installer code assumes process.env.SHELL is set and may modify .bashrc/.zshrc.
import { homedir } from 'os'
import path from 'path'
const platform = process.platform
function getShellConfig(): string | null {
const HOME = homedir()
if (platform === 'win32') {
// Windows: Return null, use environment variables instead
// Or target PowerShell profile:
// return path.join(HOME, 'Documents', 'PowerShell', 'profile.ps1')
return null
} else if (platform === 'darwin') {
return path.join(HOME, '.zshrc')
} else {
// Linux: Check SHELL env
const shell = process.env.SHELL || ''
return path.join(HOME, shell.includes('zsh') ? '.zshrc' : '.bashrc')
}
}INSTALL.md uses ln -s which requires admin/Developer Mode on Windows.
Provide copy-based alternative:
# Unix:
ln -s $(pwd)/.opencode ~/.opencode
# Windows (PowerShell):
Copy-Item -Recurse -Force .\.opencode $env:USERPROFILE\.opencode
# Or create junction (no admin required):
cmd /c mklink /J %USERPROFILE%\.opencode .\.opencodePAI-OpenCode works in WSL2 because it provides full Linux filesystem semantics.
Clone INSIDE WSL filesystem, NOT in /mnt/c/
# WRONG (will fail due to Windows filesystem):
cd /mnt/c/Users/YourName/Projects
git clone https://github.com/Steffen025/pai-opencode.git
# CORRECT:
cd ~
git clone https://github.com/Steffen025/pai-opencode.git# 1. Open WSL
wsl
# 2. Navigate to WSL home (NOT /mnt/c/)
cd ~
# 3. Clone repository
git clone https://github.com/Steffen025/pai-opencode.git
cd pai-opencode
# 4. Install Bun if not present
curl -fsSL https://bun.sh/install | bash
source ~/.bashrc
# 5. Run installer
bash PAI-Install/install.shReference: OpenCode Windows Support Issue #631
OpenCode (the base tool) has known Windows issues:
- 23 tracked problems, only 10 resolved
- Text input issues in PowerShell
- Bun macro crashes
- Missing tool dependencies
Implication: Some issues may be upstream and outside our control. WSL remains the recommended path for Windows users until OpenCode improves native Windows support.
- Remove URL cache files from git history
- Add
.gitignorerules for Browser caches - Test clone on Windows
- Replace
/tmpwithos.tmpdir()in all files - Replace
process.env.HOMEwithos.homedir()in all files - Update tilde (
~) expansions
- Ensure installer + tools avoid hardcoded Unix-only paths
- Create Windows-specific shell configuration logic
- Add symlink alternative for Windows
- Update
INSTALL.mdwith Windows/WSL sections - Create troubleshooting guide for Windows users
- Add platform badges to README
- Test clone on Windows 10/11
- Test full installation in WSL2
- Test core functionality on each platform
| Test | Windows Native | WSL2 | macOS | Linux |
|---|---|---|---|---|
| git clone | ❌ BLOCKED | ⏳ | ✅ | ✅ |
| Installer (CLI) | ⏳ | ⏳ | ✅ | ✅ |
| Browser skill | ⏳ | ⏳ | ✅ | ✅ |
| CORE skill | ⏳ | ⏳ | ✅ | ✅ |
| Art skill | ⏳ | ⏳ | ✅ | ✅ |
- GitHub Issue #5 - Original bug report
- OpenCode Windows Issue #631 - Upstream tracking
- Bun Windows Support - Runtime compatibility
- Node.js path module - Cross-platform path handling
- Node.js os module - Cross-platform OS utilities
Document created: 2026-01-25 Branch: feature/windows-multiplatform-support