@hubspot/cli 8.0.7-experimental.0 → 8.0.8-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/mcp/__tests__/setup.test.js +1 -2
- package/lib/mcp/setup.js +12 -16
- package/package.json +1 -1
|
@@ -145,8 +145,7 @@ describe('lib/mcp/setup', () => {
|
|
|
145
145
|
mockedExecAsync.mockResolvedValueOnce({ stdout: '', stderr: '' });
|
|
146
146
|
const result = await setupCodex(mockMcpCommandWithEnv);
|
|
147
147
|
expect(result).toBe(true);
|
|
148
|
-
|
|
149
|
-
expect(mockedExecAsync).toHaveBeenCalledWith('codex mcp add "HubSpotDev" -- env HUBSPOT_MCP_STANDALONE=true test-command --arg1 --ai-agent codex');
|
|
148
|
+
expect(mockedExecAsync).toHaveBeenCalledWith('codex mcp add "HubSpotDev" -- test-command --arg1 --ai-agent codex --env HUBSPOT_MCP_STANDALONE=true');
|
|
150
149
|
});
|
|
151
150
|
});
|
|
152
151
|
describe('setupGemini', () => {
|
package/lib/mcp/setup.js
CHANGED
|
@@ -306,8 +306,7 @@ export async function setupCodex(mcpCommand = defaultMcpCommand) {
|
|
|
306
306
|
return false;
|
|
307
307
|
}
|
|
308
308
|
const mcpCommandWithAgent = buildCommandWithAgentString(mcpCommand, codex);
|
|
309
|
-
|
|
310
|
-
await execAsync(`codex mcp add "${mcpServerName}" -- ${commandString}`);
|
|
309
|
+
await execAsync(`codex mcp add "${mcpServerName}" -- ${mcpCommandWithAgent.command} ${mcpCommandWithAgent.args.join(' ')}${buildEnvFlagString(mcpCommand)}`);
|
|
311
310
|
SpinniesManager.succeed('codexSpinner', {
|
|
312
311
|
text: commands.mcp.setup.spinners.configuredCodex,
|
|
313
312
|
});
|
|
@@ -336,8 +335,7 @@ export async function setupGemini(mcpCommand = defaultMcpCommand) {
|
|
|
336
335
|
return false;
|
|
337
336
|
}
|
|
338
337
|
const mcpCommandWithAgent = buildCommandWithAgentString(mcpCommand, gemini);
|
|
339
|
-
|
|
340
|
-
await execAsync(`gemini mcp add -s user "${mcpServerName}" ${commandString}`);
|
|
338
|
+
await execAsync(`gemini mcp add -s user "${mcpServerName}" ${mcpCommandWithAgent.command} ${mcpCommandWithAgent.args.join(' ')}${buildEnvFlagString(mcpCommand)}`);
|
|
341
339
|
SpinniesManager.succeed('geminiSpinner', {
|
|
342
340
|
text: commands.mcp.setup.spinners.configuredGemini,
|
|
343
341
|
});
|
|
@@ -356,18 +354,16 @@ function buildCommandWithAgentString(mcpCommand, agent) {
|
|
|
356
354
|
mcpCommandCopy.args.push('--ai-agent', agent);
|
|
357
355
|
return mcpCommandCopy;
|
|
358
356
|
}
|
|
359
|
-
function
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
357
|
+
function buildEnvFlagString(mcpCommand) {
|
|
358
|
+
const envFlags = [];
|
|
359
|
+
if (mcpCommand.env) {
|
|
360
|
+
const env = Object.entries(mcpCommand.env);
|
|
361
|
+
env.forEach(([key, value]) => {
|
|
362
|
+
envFlags.push(`--env ${key}=${value}`);
|
|
363
|
+
});
|
|
364
364
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
parts.push(`HUBSPOT_CLI_VERSION=${mcpCommand.env.HUBSPOT_CLI_VERSION};`);
|
|
365
|
+
if (envFlags.length === 0) {
|
|
366
|
+
return '';
|
|
368
367
|
}
|
|
369
|
-
|
|
370
|
-
parts.push(mcpCommand.command);
|
|
371
|
-
parts.push(...mcpCommand.args);
|
|
372
|
-
return parts.join(' ');
|
|
368
|
+
return ` ${envFlags.join(' ')}`;
|
|
373
369
|
}
|
package/package.json
CHANGED