Skip to content

fix: detect TaskMaster CLI installation on Windows#871

Open
pipipigu wants to merge 1 commit into
siteboon:mainfrom
pipipigu:fix/taskmaster-detection-windows
Open

fix: detect TaskMaster CLI installation on Windows#871
pipipigu wants to merge 1 commit into
siteboon:mainfrom
pipipigu:fix/taskmaster-detection-windows

Conversation

@pipipigu

@pipipigu pipipigu commented Jun 12, 2026

Copy link
Copy Markdown

Problem

On Windows, the TaskMaster setup screen always reports the CLI as not installed ("TaskMaster CLI not found in PATH"), even when task-master-ai is installed globally via npm and available on PATH.

Cause

checkTaskMasterInstallation() in server/routes/taskmaster.js runs:

const child = spawn('which', ['task-master'], { shell: true });

With shell: true on Windows, Node spawns cmd.exe, which has no which command (the Windows equivalent is where). The lookup therefore always exits non-zero and the endpoint returns isInstalled: false.

Fix

  • Use where on win32 and which elsewhere.
  • Take only the first line of the lookup output for installPath, since where can return multiple matches (e.g. task-master and task-master.cmd).

Testing

Verified on Windows 11 with task-master-ai@0.43.1 installed globally: the detection now resolves isInstalled: true with the correct install path and version. The non-Windows code path is unchanged (which as before).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved task-master binary detection across Windows and Unix-based platforms, ensuring more reliable installation path resolution and verification.

checkTaskMasterInstallation spawned 'which' via shell, but cmd.exe has
no 'which' builtin, so the check always failed on Windows and reported
TaskMaster as not installed even when it was on PATH. Use 'where' on
win32 and take the first line of its output, since 'where' can return
multiple matches (task-master and task-master.cmd).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7c721df3-aa83-43d8-8a65-e6d80b6abcb7

📥 Commits

Reviewing files that changed from the base of the PR and between 86f6479 and 13cac8d.

📒 Files selected for processing (1)
  • server/routes/taskmaster.js

📝 Walkthrough

Walkthrough

checkTaskMasterInstallation() now uses platform-specific commands to locate the task-master binary: where on Windows and which otherwise. When lookup succeeds, the installation path is extracted from the first line of output to handle multiple matches. Return objects now use the computed path instead of raw command output.

Changes

Task-master cross-platform installation detection

Layer / File(s) Summary
Cross-platform binary lookup with path extraction
server/routes/taskmaster.js
Platform-specific command selection (where vs which) is applied to task-master binary lookup. installPath is computed from the first line of command output to handle multiple matches on Windows. Return objects use the extracted installPath instead of raw command output in both success and error paths.

Suggested reviewers

  • viper151

Poem

🐰 A rabbit hops through Windows and Unix with glee,
Finding task-master binaries, wherever they be!
Platform-aware paths extracted with care,
No ambiguous matches, just precise paths to share. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: detecting TaskMaster CLI installation on Windows using the correct platform-specific command.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant