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
- Install: npm install -g @jackwener/opencli
- Run: opencli list
- Error: error: unknown command 'C:\Program Files\LobsterAI\node_modules@jackwener\opencli\dist\main.js'
Expected Behavior
- Direct execution: opencli list → Failed
- Full path: node "C:\Program Files\LobsterAI\node_modules@jackwener\opencli\dist\main.js" list → Failed
- Wrapper script: Created opencli-wrapper.cmd → Failed
- Source installation: Cloned from GitHub and installed → Failed
OpenCLI Version
1.4.1
Node.js Version
22.x
Operating System
Windows
Logs / Screenshots