This commit is contained in:
Chris Tate
2026-01-10 23:47:30 -06:00
parent aff8a056c6
commit a7e5de5e4f
6 changed files with 36 additions and 5 deletions
+16
View File
@@ -2,6 +2,7 @@
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import { execSync } from 'child_process';
import { send, setDebug, setSession, getSession } from './client.js';
import type { Response } from './types.js';
@@ -109,6 +110,9 @@ ${c('yellow', 'Debug:')}
${c('cyan', 'console')} View console logs
${c('cyan', 'errors')} View page errors
${c('yellow', 'Setup:')}
${c('cyan', 'install')} Install browser binaries
${c('yellow', 'Options:')}
--session <name> Isolated session (or AGENT_BROWSER_SESSION env)
--json JSON output
@@ -946,6 +950,18 @@ async function main(): Promise<void> {
process.exit(0);
}
case 'install': {
console.log(c('cyan', 'Installing Playwright browsers...'));
try {
execSync('npx playwright install', { stdio: 'inherit' });
console.log(c('green', '✓'), 'Browsers installed successfully');
process.exit(0);
} catch (error) {
console.error(c('red', '✗'), 'Failed to install browsers');
process.exit(1);
}
}
// === Legacy aliases for backwards compatibility ===
case 'url':
cmd = { id, action: 'url' };