@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.
@@ -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
- // The HUBSPOT_MCP_STANDALONE env var is now passed in the command string using 'env'
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
- const commandString = buildCommandStringWithEnv(mcpCommandWithAgent);
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
- const commandString = buildCommandStringWithEnv(mcpCommandWithAgent);
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 buildCommandStringWithEnv(mcpCommand) {
360
- const parts = [];
361
- // Only pass HUBSPOT_MCP_STANDALONE environment variable if it exists
362
- if (mcpCommand.env?.HUBSPOT_MCP_STANDALONE) {
363
- parts.push(`HUBSPOT_MCP_STANDALONE=${mcpCommand.env.HUBSPOT_MCP_STANDALONE};`);
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
- // Only pass HUBSPOT_MCP_STANDALONE environment variable if it exists
366
- if (mcpCommand.env?.HUBSPOT_CLI_VERSION) {
367
- parts.push(`HUBSPOT_CLI_VERSION=${mcpCommand.env.HUBSPOT_CLI_VERSION};`);
365
+ if (envFlags.length === 0) {
366
+ return '';
368
367
  }
369
- // Add the command and args
370
- parts.push(mcpCommand.command);
371
- parts.push(...mcpCommand.args);
372
- return parts.join(' ');
368
+ return ` ${envFlags.join(' ')}`;
373
369
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "8.0.7-experimental.0",
3
+ "version": "8.0.8-experimental.0",
4
4
  "description": "The official CLI for developing on HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/HubSpot/hubspot-cli",