MCPcopy Create free account
hub / github.com/tiann/hapi / stripCodexCliOverrides

Function stripCodexCliOverrides

cli/src/codex/utils/codexCliOverrides.ts:90–123  ·  view source on GitHub ↗
(args?: string[])

Source from the content-addressed store, hash-verified

88}
89
90export function stripCodexCliOverrides(args?: string[]): string[] {
91 if (!args || args.length === 0) {
92 return [];
93 }
94
95 const filtered: string[] = [];
96
97 for (let i = 0; i < args.length; i++) {
98 const arg = args[i];
99 if (arg === '--') {
100 filtered.push(...args.slice(i));
101 break;
102 }
103
104 if (
105 arg === '--full-auto'
106 || arg === '--yolo'
107 || arg === '--dangerously-bypass-approvals-and-sandbox'
108 || arg.startsWith('--sandbox=')
109 || arg.startsWith('--ask-for-approval=')
110 ) {
111 continue;
112 }
113
114 if (arg === '-s' || arg === '--sandbox' || arg === '-a' || arg === '--ask-for-approval') {
115 i += 1;
116 continue;
117 }
118
119 filtered.push(arg);
120 }
121
122 return filtered;
123}

Callers 2

codexLocalLauncherFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected