summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/config.ts
diff options
context:
space:
mode:
authorShreya Keshive <[email protected]>2025-07-17 12:59:57 -0400
committerGitHub <[email protected]>2025-07-17 16:59:57 +0000
commit88b5f209432c06c58b8bdf78d69ac5fccb26838f (patch)
treedfbb6983be1069131139375e2ab1f23b21b8bb6d /packages/cli/src/config/config.ts
parent79d36ac0a54c17a877264eb4d532854eb51e2e42 (diff)
Update companionPort not existing to be a warning so the user can still proceed with running /ide install (#4382)
Diffstat (limited to 'packages/cli/src/config/config.ts')
-rw-r--r--packages/cli/src/config/config.ts37
1 files changed, 19 insertions, 18 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts
index 83549139..c7c23901 100644
--- a/packages/cli/src/config/config.ts
+++ b/packages/cli/src/config/config.ts
@@ -312,27 +312,28 @@ export async function loadCliConfig(
);
}
const companionPort = process.env.GEMINI_CLI_IDE_SERVER_PORT;
- if (!companionPort) {
- throw new Error(
+ if (companionPort) {
+ const httpUrl = `http://localhost:${companionPort}/mcp`;
+ mcpServers[IDE_SERVER_NAME] = new MCPServerConfig(
+ undefined, // command
+ undefined, // args
+ undefined, // env
+ undefined, // cwd
+ undefined, // url
+ httpUrl, // httpUrl
+ undefined, // headers
+ undefined, // tcp
+ undefined, // timeout
+ false, // trust
+ 'IDE connection', // description
+ undefined, // includeTools
+ undefined, // excludeTools
+ );
+ } else {
+ logger.warn(
'Could not connect to IDE. Make sure you have the companion VS Code extension installed from the marketplace or via /ide install.',
);
}
- const httpUrl = `http://localhost:${companionPort}/mcp`;
- mcpServers[IDE_SERVER_NAME] = new MCPServerConfig(
- undefined, // command
- undefined, // args
- undefined, // env
- undefined, // cwd
- undefined, // url
- httpUrl, // httpUrl
- undefined, // headers
- undefined, // tcp
- undefined, // timeout
- false, // trust
- 'IDE connection', // description
- undefined, // includeTools
- undefined, // excludeTools
- );
}
const sandboxConfig = await loadSandboxConfig(settings, argv);