Skip to content

[BUG] -o parameter does not expand tilde (~) to user home directory on Windows #64

@abevol

Description

@abevol

Bug Description

On Windows, the -o parameter does not correctly expand the tilde (~) character to the user's home directory. Instead, it treats ~ as a literal directory name.

Environment

  • OS: Windows
  • openskills version: 1.5.0

Steps to Reproduce

  1. Open a terminal on Windows
  2. Run:
    npx openskills sync -o ~/.config/opencode/AGENTS.md

Expected Behavior

The file should be written to:

C:\Users\<username>\.config\opencode\AGENTS.md

Actual Behavior

The file is created at:

<CurrentPath>\~\.config\opencode\AGENTS.md

The ~ is not expanded to the user's home directory and is instead treated as a literal directory name in the current working directory.

Possible Solution

The path expansion logic should handle the tilde (~) character and expand it to the user's home directory (using os.homedir() or similar) before resolving the full path.

Additional Context

This works correctly on Unix-like systems where the shell expands ~ before passing it to the program. However, on Windows, this expansion does not happen automatically, so the application needs to handle it internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions