You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Riff already builds for Windows via goreleaser and has a sysproc_windows.go build-tagged file, but the binary does not work properly on Windows due to several POSIX assumptions throughout the codebase. This issue tracks everything needed to make riff a fully functional Windows CLI.
Audit Results
Every .go file was evaluated. The codebase breaks down into three categories:
Already cross-platform (no changes needed)
Area
Files
Notes
Entry point / routing
main.go
Pure flag parsing, no OS-specific code
Colors
internal/colors.go
ANSI escapes work on Windows 10+ and Windows Terminal
TTY detection
internal/prompt.go
os.ModeCharDevice works on Windows
Project metadata
internal/projects.go
Uses filepath.Join, os.ReadDir, etc.
File copy / export
cmd/export.go
Uses filepath.Walk, os.Open, etc.
List / clean / config
cmd/list.go, cmd/clean.go, cmd/config.go
stdlib-only file I/O
Update docs
cmd/update_docs.go
No OS-specific code
LLM detection
internal/describe.go
exec.LookPath works cross-platform
Process detach
internal/sysproc_windows.go
Already handled with build tags
Data directory
internal/config.go (InitPaths)
os.UserHomeDir() + filepath.Join — correct on Windows
Then replace both call sites in cmd/new.go with internal.ShellCommand(...).
2. CRITICAL — riff init has no PowerShell/cmd support
File:cmd/init.go
The command only emits shell wrappers for bash, zsh, and fish. On Windows the primary shells are PowerShell (pwsh/powershell) and cmd.exe. Without a wrapper, the auto-cd-after-create feature is broken on Windows.
Windows does not set the SHELL environment variable. This always returns "" on Windows, which causes EnsureShellWrapper to fall through to a generic message rather than auto-configuring.
Git for Windows ships with MSYS2/MinGW and executes hooks through its own sh, so this likely works as-is. However, the & for backgrounding could behave unexpectedly.
Recommendation: Verify this works with Git for Windows. If not, conditionally write a .bat-style hook or use start /b for backgrounding.
7. LOW — CI lacks a Windows test runner
File:.github/workflows/ci.yml
CI only runs on ubuntu-latest. There are no Windows-specific tests to catch regressions.
Summary
Riff already builds for Windows via goreleaser and has a
sysproc_windows.gobuild-tagged file, but the binary does not work properly on Windows due to several POSIX assumptions throughout the codebase. This issue tracks everything needed to make riff a fully functional Windows CLI.Audit Results
Every
.gofile was evaluated. The codebase breaks down into three categories:Already cross-platform (no changes needed)
main.gointernal/colors.gointernal/prompt.goos.ModeCharDeviceworks on Windowsinternal/projects.gofilepath.Join,os.ReadDir, etc.cmd/export.gofilepath.Walk,os.Open, etc.cmd/list.go,cmd/clean.go,cmd/config.gocmd/update_docs.gointernal/describe.goexec.LookPathworks cross-platforminternal/sysproc_windows.gointernal/config.go(InitPaths)os.UserHomeDir()+filepath.Join— correct on WindowsNeeds changes
1. CRITICAL —
sh -cfor command executionFiles:
cmd/new.go:116,cmd/new.go:129Windows does not have
sh. Both template execution and--runare completely broken.Proposed fix: Create a build-tagged helper in
internal/:Then replace both call sites in
cmd/new.gowithinternal.ShellCommand(...).2. CRITICAL —
riff inithas no PowerShell/cmd supportFile:
cmd/init.goThe command only emits shell wrappers for
bash,zsh, andfish. On Windows the primary shells are PowerShell (pwsh/powershell) andcmd.exe. Without a wrapper, the auto-cd-after-create feature is broken on Windows.Proposed fix: Add a PowerShell wrapper:
And a
cmd.exewrapper (batch):Update the
switchinRunInitto handle"powershell","pwsh", and"cmd".3. CRITICAL —
DetectShell()returns""on WindowsFile:
internal/config.go:100-107Windows does not set the
SHELLenvironment variable. This always returns""on Windows, which causesEnsureShellWrapperto fall through to a generic message rather than auto-configuring.Proposed fix: Add Windows-specific detection. Check for:
PSModulePathenv var → PowerShellCOMSPECenv var → cmd.exeExample:
4. CRITICAL —
EnsureShellWrapper()only handles Unix config filesFile:
internal/config.go:111-178This function writes
eval "$(riff init)"to~/.bashrc,~/.zshrc, or~/.config/fish/config.fish. None of these exist on Windows.Proposed fix: Add cases for PowerShell profile paths:
$HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1(PowerShell 7+)$HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1(Windows PowerShell 5.x)The init line for PowerShell would be:
. (riff init powershell)orInvoke-Expression (riff init powershell).For
cmd.exe, auto-injection isn't practical (AutoRun registry key is invasive), so print manual instructions instead.5. MODERATE — Hardcoded
/path separator in display stringFile:
internal/config.go:149On Windows,
homeuses\separators, soTrimPrefixwithhome+"/"will never match and the display path will be wrong.Proposed fix:
6. LOW RISK — Git post-commit hook is a POSIX shell script
File:
cmd/new.go:145-156Git for Windows ships with MSYS2/MinGW and executes hooks through its own
sh, so this likely works as-is. However, the&for backgrounding could behave unexpectedly.Recommendation: Verify this works with Git for Windows. If not, conditionally write a
.bat-style hook or usestart /bfor backgrounding.7. LOW — CI lacks a Windows test runner
File:
.github/workflows/ci.ymlCI only runs on
ubuntu-latest. There are no Windows-specific tests to catch regressions.Proposed fix: Add a matrix strategy:
Note: the test report step uses
grepand shell constructs that would need adjustment on Windows, or could be skipped viaif: runner.os != 'Windows'.Implementation Checklist
internal/shellcmd_unix.goandinternal/shellcmd_windows.go(build-tagged shell exec helper)cmd/new.goto useinternal.ShellCommand()instead ofexec.Command("sh", "-c", ...)cmd/init.gocmd/init.goRunInitswitch to handlepowershell,pwsh,cmdDetectShell()to detect PowerShell and cmd.exe on WindowsEnsureShellWrapper()with PowerShell profile path support/separator inEnsureShellWrapper()display stringwindows-latestto CI matrixriff new,riff new bun,riff new --run "echo hello",riff init powershell,riff list,riff open,riff clean,riff exportLabels
enhancement