{"record":{"id":"592c8437e1d3654a","repo":"github/copilot-sdk","slug":"path-to-copilot-cli-is-required-please-supply-it","errorCode":null,"errorMessage":"Path to Copilot CLI is required. Please supply it via `RuntimeConnection.forStdio({ path })` or `RuntimeConnection.forTcp({ path })`, set the COPILOT_CLI_PATH environment variable, or use `RuntimeConnection.forUri(...)` to connect to an already-running runtime.","messagePattern":"Path to Copilot CLI is required\\. Please supply it via `RuntimeConnection\\.forStdio\\((.+?)\\)` or `RuntimeConnection\\.forTcp\\((.+?)\\)`, set the COPILOT_CLI_PATH environment variable, or use `RuntimeConnection\\.forUri\\(\\.\\.\\.\\)` to connect to an already-running runtime\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/client.ts","lineNumber":2642,"sourceCode":"                this.options.sessionIdleTimeoutSeconds !== undefined &&\n                this.options.sessionIdleTimeoutSeconds > 0\n            ) {\n                args.push(\n                    \"--session-idle-timeout\",\n                    this.options.sessionIdleTimeoutSeconds.toString()\n                );\n            }\n\n            if (this.options.enableRemoteSessions) {\n                args.push(\"--remote\");\n            }\n\n            // Suppress debug/trace output that might pollute stdout, and apply the\n            // shared runtime env (auth token, connection token, COPILOT_HOME, telemetry).\n            const envWithoutNodeDebug = this.buildRuntimeEnv();\n\n            if (!this.resolvedCliPath) {\n                throw new Error(\n                    \"Path to Copilot CLI is required. Please supply it via \" +\n                        \"`RuntimeConnection.forStdio({ path })` or \" +\n                        \"`RuntimeConnection.forTcp({ path })`, set the COPILOT_CLI_PATH \" +\n                        \"environment variable, or use `RuntimeConnection.forUri(...)` to \" +\n                        \"connect to an already-running runtime.\"\n                );\n            }\n\n            // Verify CLI exists before attempting to spawn\n            if (!existsSync(this.resolvedCliPath)) {\n                throw new Error(\n                    `Copilot CLI not found at ${this.resolvedCliPath}. Set COPILOT_CLI_PATH to use a custom installation.`\n                );\n            }\n\n            const stdioConfig: [\"pipe\", \"pipe\", \"pipe\"] | [\"ignore\", \"pipe\", \"pipe\"] =\n                this.connectionConfig.kind === \"stdio\"\n                    ? [\"pipe\", \"pipe\", \"pipe\"]","sourceCodeStart":2624,"sourceCodeEnd":2660,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/client.ts#L2624-L2660","documentation":"Error \"Path to Copilot CLI is required. Please supply it via `RuntimeConnection.forStdio({ path })` or `RuntimeConnection.forTcp({ path })`, set the COPILOT_CLI_PATH environment variable, or use `RuntimeConnection.forUri(...)` to connect to an already-running runtime.\" thrown in github/copilot-sdk.","triggerScenarios":"Thrown at nodejs/src/client.ts:2642 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the CLI path explicitly: RuntimeConnection.forStdio({ path: '/path/to/copilot' }) or forTcp({ path })","Set the COPILOT_CLI_PATH environment variable to the CLI executable","Use RuntimeConnection.forUri(...) to attach to an already-running runtime instead of launching one","Verify the CLI is installed and the path is executable"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}