Skip to content

fix: Windows path support across CLI commands#66

Open
abevol wants to merge 1 commit intonumman-ali:mainfrom
abevol:fix/windows-path-support
Open

fix: Windows path support across CLI commands#66
abevol wants to merge 1 commit intonumman-ali:mainfrom
abevol:fix/windows-path-support

Conversation

@abevol
Copy link

@abevol abevol commented Jan 31, 2026

Summary

This PR fixes Windows path handling issues reported in #64 and #65, and adds support for both forward and backward slashes in path inputs.

Changes

Fixed Issues

Testing

  • ✅ Build passes successfully
  • ✅ All path formats are now correctly recognized as local paths
  • ✅ Tilde expansion works on both Unix and Windows

Before/After

Before

# Windows - tilde not expanded
npx openskills sync -o ~/.config/opencode/AGENTS.md
# Created: <CurrentPath>/~/.config/opencode/AGENTS.md ❌

# Windows - absolute path not recognized
npx openskills install C:/Users/jayvi/.agent/skills/gh-cli
# Error: Tries to clone from GitHub ❌

After

# Windows - tilde properly expanded
npx openskills sync -o ~/.config/opencode/AGENTS.md
# Created: C:\Users\username\.config\opencode\AGENTS.md ✅

# Windows - absolute path recognized
npx openskills install C:/Users/jayvi/.agent/skills/gh-cli
# Installed from local path ✅

Impact

This change makes the CLI more user-friendly for Windows users without affecting Unix/Linux/macOS behavior. All existing functionality is preserved while adding Windows-specific path format support.

- Fix numman-ali#64: sync command now expands tilde (~) on Windows
- Fix numman-ali#65: install command recognizes Windows absolute paths (C:/, C:\)
- Support both forward and backward slashes for tilde paths (~/ and ~\)
- Support Windows drive letters in both formats (C:/ and C:\)

Changes:
- Updated sync.ts to expand tilde paths before processing
- Enhanced isLocalPath() to detect Windows drive letters
- Updated expandPath() to handle both Unix and Windows tilde notation

This makes the CLI more intuitive for Windows users, especially those
using Git Bash or other Unix-like shells on Windows.
@abevol abevol changed the title Fix Windows path support across CLI commands feat: fix Windows path support across CLI commands Jan 31, 2026
@abevol abevol changed the title feat: fix Windows path support across CLI commands fix: Windows path support across CLI commands Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant