[cmux] not working as PATH does not allow finding cmux binary

Open Beginner friendly
#27,614 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
90/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
cli

Research direction

Start in extensions/cmux/src/cli.ts, where the cmux CLI is invoked with execFile, and compare the PATH handling with the music extension's src/util/exec.ts. Build the extension with npm install && npm run build, then verify the cmux commands work from Raycast when the CLI is installed in /usr/local/bin.

Written by the indexing model from the issue text.

Description

bug extension extension: cmux platform: macOS
Extension

https://www.raycast.com/steve_occhipinti/cmux

Raycast Version

1.104.15

OS Version

MacOS 26.3.1(a)

Description

Problem

The cmux extension fails to execute any commands with the error:

Failed to fetch latest data
spawn cmux ENOENT

This occurs when trying to use any of the extension's commands:

  • Search Workspaces
  • Search Surfaces
  • Jump to Latest Notification
  • New Workspace

Root Cause

The extension uses Node.js execFile() to execute the cmux CLI without specifying the env.PATH. Raycast extensions run in a GUI application context with a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin) that does not include /usr/local/bin, where the cmux CLI symlink is typically installed.
The cmux installation process creates a symlink at /usr/local/bin/cmux pointing to /Applications/cmux.app/Contents/Resources/bin/cmux, following standard macOS conventions. However, this location is not in the default PATH available to GUI applications.

Current Code

In src/cli.ts:

export function execFileAsync(command: string, args: string[]): Promise<string> {
  return new Promise((resolve, reject) => {
    execFile(command, args, { encoding: "utf8" }, (error, stdout) => {
      if (error) {
        reject(error);
        return;
      }
      resolve(stdout);
    });
  });
}

Solution

Add explicit PATH configuration to the execFile options to include /usr/local/bin:

export function execFileAsync(command: string, args: string[]): Promise<string> {
  return new Promise((resolve, reject) => {
    execFile(command, args, { 
      encoding: "utf8",
      env: {
        ...process.env,
        PATH: "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
      }
    }, (error, stdout) => {
      if (error) {
        reject(error);
        return;
      }
      resolve(stdout);
    });
  });
}

This pattern is already used in other Raycast extensions (e.g., music extension in src/util/exec.ts) to handle similar PATH issues with CLI tools.

Environment

  • cmux: 0.63.2 or later
  • cmux CLI location: /usr/local/bin/cmux → /Applications/cmux.app/Contents/Resources/bin/cmux
    Workaround
    Until this is fixed, users can:
  1. Clone the Raycast extensions repository
  2. Apply the PATH fix to extensions/cmux/src/cli.ts
  3. Build the extension: npm install && npm run build
  4. Import the local extension into Raycast using "Import Extension"
Steps To Reproduce
  1. Install cmux from https://cmux.app
  2. Verify cmux CLI works in terminal: cmux list-workspaces
  3. Install the cmux Raycast extension
  4. Open Raycast and try "Search Workspaces"
  5. Error appears: "spawn cmux ENOENT"
Current Behaviour

The cmux extension fails to execute any commands with the error:

Failed to fetch latest data
spawn cmux ENOENT
Expected Behaviour

It shall work

Dominant language
TypeScript
Stars
7.8k
Forks
6.9k
Avg merge
1d 23h
Merged PRs (30d)
450

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raycast/extensions

All issues in raycast/extensions

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.