Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/playwright-core/src/cli/DEPS.list
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
../remote/
../server/trace/viewer/
../tools/cli-client/program.ts
../tools/mcp/program.ts
../tools/trace/traceCli.ts
../bootstrap.ts
node_modules/commander
Expand Down
8 changes: 7 additions & 1 deletion packages/playwright-core/src/cli/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { installBrowsers, uninstallBrowsers, installDeps } from './installAction
import { runTraceInBrowser, runTraceViewerApp } from '../server/trace/viewer/traceViewer';
import { screenshot, pdf } from './browserActions';
import { program as cliProgram } from '../tools/cli-client/program';
import { decorateMCPCommand } from '../tools/mcp/program';

import type { TraceViewerServerOptions } from '../server/trace/viewer/traceViewer';
import type { Command } from 'commander';
Expand Down Expand Up @@ -236,14 +237,19 @@ export function decorateProgram(program: Command) {
addTraceCommands(program, logErrorAndExit);

program
.command('cli', { hidden: true })
.command('cli')
.description('run playwright cli commands from terminal')
.allowExcessArguments(true)
.allowUnknownOption(true)
.helpOption(false)
.action(async options => {
process.argv.splice(process.argv.indexOf('cli'), 1);
cliProgram().catch(logErrorAndExit);
});

decorateMCPCommand(program
.command('mcp')
.description('run the Playwright MCP server'));
}

function logErrorAndExit(e: Error) {
Expand Down
Loading