Skip to content
Open
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
18 changes: 18 additions & 0 deletions packages/mobilewright/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { MobilecliDriver, DEFAULT_URL, resolveMobilecliBinary } from '@mobilewri
import { ensureMobilecliReachable } from './server.js';
import { loadConfig } from './config.js';
import { gatherChecks, renderTerminal, renderJSON } from './commands/doctor.js';
import { runInspect, type InspectOptions } from './commands/inspect.js';
import { runInspectUI } from './commands/inspect-ui.js';
import { brandReport } from './reporter.js';
import { telemetry } from './telemetry.js';

Expand Down Expand Up @@ -248,6 +250,22 @@ program
}
});

// ── inspect ───────────────────────────────────────────────────────
program
.command('inspect')
.description('dump the live accessibility tree of a connected device')
.option('-d, --device <id>', 'device ID (run "mobilewright devices" to list)')
.option('--url <url>', 'mobilecli server URL', DEFAULT_URL)
.option('--json', 'output raw ViewNode[] JSON instead of the terminal tree')
.option('--ui', 'open an interactive browser UI with auto-refresh and locator copy')
.action(async (opts: InspectOptions & { ui?: boolean }) => {
if (opts.ui) {
await runInspectUI(opts);
} else {
await runInspect(opts);
}
});

// ── install ───────────────────────────────────────────────────────
program
.command('install')
Expand Down
Loading