chenhg5/cc-connect · error

cursor: %q CLI not found in PATH, install with: npm i -g @an

Error message

cursor: %q CLI not found in PATH, install with: npm i -g @anthropic-ai/cursor-agent (or from Cursor IDE settings)

What it means

Pre-flight validation in the cursor agent factory (New): exec.LookPath cannot find the configured cursor-agent CLI. The %q is the command looked up. Agent creation aborts because the CLI is required to run sessions.

Source

Thrown at agent/cursor/cursor.go:56

	cliExtraArgs []string // extra args from cmd after the binary name
	configEnv    []string // env vars from [projects.agent.options.env]
	providers    []core.ProviderConfig
	activeIdx    int
	sessionEnv   []string
	mu           sync.RWMutex
}

func New(opts map[string]any) (core.Agent, error) {
	workDir, _ := opts["work_dir"].(string)
	if workDir == "" {
		workDir = "."
	}
	model, _ := opts["model"].(string)
	mode, _ := opts["mode"].(string)
	mode = normalizeMode(mode)
	cmd, extraArgs := core.ParseCmdOpts(opts, "agent")
	if _, err := exec.LookPath(cmd); err != nil {
		return nil, fmt.Errorf("cursor: %q CLI not found in PATH, install with: npm i -g @anthropic-ai/cursor-agent (or from Cursor IDE settings)", cmd)
	}

	return &Agent{
		workDir:      workDir,
		model:        model,
		mode:         mode,
		cmd:          cmd,
		cliExtraArgs: extraArgs,
		configEnv:    core.ParseConfigEnv(opts),
		activeIdx:    -1,
	}, nil
}

func normalizeMode(raw string) string {
	switch strings.ToLower(strings.TrimSpace(raw)) {
	case "force", "yolo", "auto":
		return "force"
	case "plan":

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Install the Cursor CLI: npm i -g @anthropic-ai/cursor-agent (or via Cursor IDE settings)
  2. Ensure the install directory is on the daemon's PATH
  3. Or set the agent cmd option to the binary's absolute path
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agent/cursor/cursor.go:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/75030634d0f12e94. Report an issue: GitHub.