{"record":{"id":"75030634d0f12e94","repo":"chenhg5/cc-connect","slug":"cursor-q-cli-not-found-in-path-install-with-np","errorCode":null,"errorMessage":"cursor: %q CLI not found in PATH, install with: npm i -g @anthropic-ai/cursor-agent (or from Cursor IDE settings)","messagePattern":"cursor: %q CLI not found in PATH, install with: npm i -g @anthropic-ai/cursor-agent \\(or from Cursor IDE settings\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/cursor/cursor.go","lineNumber":56,"sourceCode":"\tcliExtraArgs []string // extra args from cmd after the binary name\n\tconfigEnv    []string // env vars from [projects.agent.options.env]\n\tproviders    []core.ProviderConfig\n\tactiveIdx    int\n\tsessionEnv   []string\n\tmu           sync.RWMutex\n}\n\nfunc New(opts map[string]any) (core.Agent, error) {\n\tworkDir, _ := opts[\"work_dir\"].(string)\n\tif workDir == \"\" {\n\t\tworkDir = \".\"\n\t}\n\tmodel, _ := opts[\"model\"].(string)\n\tmode, _ := opts[\"mode\"].(string)\n\tmode = normalizeMode(mode)\n\tcmd, extraArgs := core.ParseCmdOpts(opts, \"agent\")\n\tif _, err := exec.LookPath(cmd); err != nil {\n\t\treturn 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)\n\t}\n\n\treturn &Agent{\n\t\tworkDir:      workDir,\n\t\tmodel:        model,\n\t\tmode:         mode,\n\t\tcmd:          cmd,\n\t\tcliExtraArgs: extraArgs,\n\t\tconfigEnv:    core.ParseConfigEnv(opts),\n\t\tactiveIdx:    -1,\n\t}, nil\n}\n\nfunc normalizeMode(raw string) string {\n\tswitch strings.ToLower(strings.TrimSpace(raw)) {\n\tcase \"force\", \"yolo\", \"auto\":\n\t\treturn \"force\"\n\tcase \"plan\":","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/cursor/cursor.go#L38-L74","documentation":"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.","triggerScenarios":"Thrown at agent/cursor/cursor.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the Cursor CLI: npm i -g @anthropic-ai/cursor-agent (or via Cursor IDE settings)","Ensure the install directory is on the daemon's PATH","Or set the agent cmd option to the binary's absolute path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}