Skip to content

[Bug]: Windows: Command parsing treats executable path as first argument, causing all commands to fail #456

@JaeGerW2016

Description

@JaeGerW2016

Description

After installing opencli on Windows, executing any command results in an error:

error: unknown command 'C:\Program Files\LobsterAI\node_modules@jackwener\opencli\dist\main.js'

Root Cause

On Windows, opencli incorrectly parses command-line arguments and treats its own script path (the full path to main.js) as the first command argument instead of recognizing it as the executable file itself.

Steps to Reproduce

  1. Install: npm install -g @jackwener/opencli
  2. Run: opencli list
  3. Error: error: unknown command 'C:\Program Files\LobsterAI\node_modules@jackwener\opencli\dist\main.js'

Expected Behavior

  1. Direct execution: opencli list → Failed
  2. Full path: node "C:\Program Files\LobsterAI\node_modules@jackwener\opencli\dist\main.js" list → Failed
  3. Wrapper script: Created opencli-wrapper.cmd → Failed
  4. Source installation: Cloned from GitHub and installed → Failed

OpenCLI Version

1.4.1

Node.js Version

22.x

Operating System

Windows

Logs / Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions