MCPcopy
hub / github.com/ChromeDevTools/chrome-devtools-mcp / main

Function main

scripts/eval_gemini.ts:179–272  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179async function main() {
180 const apiKey = process.env.GEMINI_API_KEY;
181 if (!apiKey) {
182 throw new Error('GEMINI_API_KEY environment variable is required.');
183 }
184
185 const {values, positionals} = parseArgs({
186 options: {
187 model: {
188 type: 'string',
189 default: 'gemini-3-flash-preview',
190 },
191 debug: {
192 type: 'boolean',
193 default: false,
194 },
195 repeat: {
196 type: 'boolean',
197 default: false,
198 },
199 'include-skill': {
200 type: 'boolean',
201 default: false,
202 },
203 'server-args': {
204 type: 'string',
205 },
206 },
207 allowPositionals: true,
208 });
209
210 const modelId = values.model;
211 const debug = values.debug;
212 const repeat = values.repeat;
213 const includeSkill = values['include-skill'];
214 const extraServerArgs = values['server-args']
215 ? values['server-args'].split(/\s+/)
216 : [];
217
218 const scenarioFiles =
219 positionals.length > 0
220 ? positionals.map(p => path.resolve(p))
221 : fs
222 .readdirSync(SCENARIOS_DIR)
223 .filter(file => file.endsWith('.ts') || file.endsWith('.js'))
224 .map(file => path.join(SCENARIOS_DIR, file));
225
226 const server = new TestServer(TestServer.randomPort());
227 await server.start();
228
229 let successCount = 0;
230 let failureCount = 0;
231
232 try {
233 for (const scenarioPath of scenarioFiles) {
234 for (let i = 1; i <= (repeat ? 3 : 1); i++) {
235 try {
236 if (debug) {

Callers 1

eval_gemini.tsFile · 0.70

Calls 9

startMethod · 0.95
restoreMethod · 0.95
stopMethod · 0.95
runSingleScenarioFunction · 0.85
splitMethod · 0.80
joinMethod · 0.80
randomPortMethod · 0.80
logMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…