MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / createCodexCliLaunchSpec

Function createCodexCliLaunchSpec

src/providers/codex/cli_command.ts:8–34  ·  view source on GitHub ↗
({
  command,
  args,
  platform = process.platform,
}: {
  command: string;
  args: string[];
  platform?: NodeJS.Platform;
})

Source from the content-addressed store, hash-verified

6}
7
8export function createCodexCliLaunchSpec({
9 command,
10 args,
11 platform = process.platform,
12}: {
13 command: string;
14 args: string[];
15 platform?: NodeJS.Platform;
16}): CodexCliLaunchSpec {
17 if (platform === 'win32' && /\.(cmd|bat)$/iu.test(command)) {
18 return {
19 command: buildWindowsShellCommandLine([command, ...args]),
20 args: null,
21 options: {
22 shell: true,
23 windowsHide: true,
24 },
25 displayCommand: command,
26 };
27 }
28 return {
29 command,
30 args,
31 options: {},
32 displayCommand: command,
33 };
34}
35
36function buildWindowsShellCommandLine(parts: string[]): string {
37 return parts.map(quoteWindowsShellArgument).join(' ');

Callers 3

execCodexCliSyncMethod · 0.85
startMethod · 0.85

Calls 1

Tested by

no test coverage detected