fix: execute Claude CLI commands through WSL on Windows #139

Merged
naomi merged 3 commits from fix/windows into main 2026-02-08 13:48:03 -08:00
Owner

Resolves #137

Summary

Claude CLI commands (plugin list, MCP list, version check, etc.) were being executed directly in Windows context where the claude binary doesn't exist, causing "program not found" errors across the UI.

This PR adds a helper function that automatically prefixes commands with wsl on Windows builds, ensuring all Claude CLI commands execute in the correct context.

Changes

  • Added create_claude_command() helper function that:

    • On Windows: Creates command with wsl claude prefix
    • On Linux/Mac: Creates command with claude directly
  • Updated 8 command functions to use the helper:

    • get_claude_version
    • list_plugins
    • install_plugin
    • uninstall_plugin
    • list_mcp_servers
    • remove_mcp_server
    • add_mcp_server
    • get_mcp_server_details
  • Added comprehensive tests for both Windows and Linux contexts

What This Fixes

Memory pane will now display files correctly
CLI version will be detected properly
Plugin pane will work correctly
MCP servers pane will function properly
All Claude CLI commands will execute in the correct context on Windows

Testing

  • All 427 backend tests pass (added 1 new test)
  • All 387 frontend tests pass
  • All linting and formatting checks pass
  • check-all.sh reports: " All checks passed!"

This fix was created by Hikari~ 🌸

Resolves #137 ## Summary Claude CLI commands (plugin list, MCP list, version check, etc.) were being executed directly in Windows context where the `claude` binary doesn't exist, causing "program not found" errors across the UI. This PR adds a helper function that automatically prefixes commands with `wsl` on Windows builds, ensuring all Claude CLI commands execute in the correct context. ## Changes - **Added `create_claude_command()` helper function** that: - On Windows: Creates command with `wsl claude` prefix - On Linux/Mac: Creates command with `claude` directly - **Updated 8 command functions** to use the helper: - `get_claude_version` - `list_plugins` - `install_plugin` - `uninstall_plugin` - `list_mcp_servers` - `remove_mcp_server` - `add_mcp_server` - `get_mcp_server_details` - **Added comprehensive tests** for both Windows and Linux contexts ## What This Fixes ✅ Memory pane will now display files correctly ✅ CLI version will be detected properly ✅ Plugin pane will work correctly ✅ MCP servers pane will function properly ✅ All Claude CLI commands will execute in the correct context on Windows ## Testing - ✅ All 427 backend tests pass (added 1 new test) - ✅ All 387 frontend tests pass - ✅ All linting and formatting checks pass - ✅ `check-all.sh` reports: "✨ All checks passed!" ✨ This fix was created by Hikari~ 🌸
hikari added 2 commits 2026-02-08 12:04:55 -08:00
Resolves #137

Claude CLI commands (plugin list, MCP list, version check, etc.) were
being executed directly in Windows context where the `claude` binary
doesn't exist. This caused "program not found" errors across the UI.

Changes:
- Added `create_claude_command()` helper that automatically prefixes
  commands with `wsl` on Windows builds
- Updated 7 command functions to use the helper:
  - get_claude_version
  - list_plugins
  - install_plugin
  - uninstall_plugin
  - list_mcp_servers
  - enable_mcp_server
  - disable_mcp_server
- Added comprehensive tests for both Windows and Linux contexts

This ensures all Claude CLI commands execute in the correct WSL
context on Windows, fixing the memory pane, plugin pane, MCP servers
pane, and CLI version detection.

 This fix was created by Hikari~ 🌸
fix: execute Claude CLI commands through WSL on Windows
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m0s
CI / Lint & Test (pull_request) Successful in 17m40s
CI / Build Linux (pull_request) Successful in 24m39s
CI / Build Windows (cross-compile) (pull_request) Successful in 42m6s
269f33b52a
Resolves #137

Claude CLI commands (plugin list, MCP list, version check, etc.) were
being executed directly in Windows context where the `claude` binary
doesn't exist. This caused "program not found" errors across the UI.

Changes:
- Added `create_claude_command()` helper that automatically prefixes
  commands with `wsl` on Windows builds
- Updated 8 command functions to use the helper:
  - get_claude_version
  - list_plugins
  - install_plugin
  - uninstall_plugin
  - list_mcp_servers
  - remove_mcp_server
  - add_mcp_server
  - get_mcp_server_details
- Added comprehensive tests for both Windows and Linux contexts

This ensures all Claude CLI commands execute in the correct WSL
context on Windows, fixing the memory pane, plugin pane, MCP servers
pane, and CLI version detection.

 This fix was created by Hikari~ 🌸
naomi added 1 commit 2026-02-08 12:33:36 -08:00
fix: dynamically resolve Claude binary path on Windows
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 2m9s
CI / Lint & Test (pull_request) Successful in 21m19s
CI / Build Linux (pull_request) Successful in 24m4s
CI / Build Windows (cross-compile) (pull_request) Successful in 34m53s
dfbb6a9b64
Previously hardcoded `/home/naomi/.local/bin/claude` which would break
for other users. Now uses `wsl -e bash -l -c "which claude"` to find
the Claude binary dynamically using a login shell that has the full PATH.

Also updated 6 plugin/marketplace functions that were still using
`std::process::Command::new("claude")` directly instead of the
`create_claude_command()` helper:
- enable_plugin
- disable_plugin
- update_plugin
- list_marketplaces
- add_marketplace
- remove_marketplace

This ensures all Claude CLI commands work properly on Windows regardless
of where Claude is installed, whilst maintaining backwards compatibility.

 This fix was created by Hikari~ 🌸
naomi merged commit 0ea7861047 into main 2026-02-08 13:48:03 -08:00
naomi deleted branch fix/windows 2026-02-08 13:48:03 -08:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#139