-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathcli-flags.ts
More file actions
1358 lines (1343 loc) · 37.5 KB
/
Copy pathcli-flags.ts
File metadata and controls
1358 lines (1343 loc) · 37.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { SESSION_SURFACES, type SessionSurface } from '../../core/session-surface.ts';
import type { RecordingExportQuality } from '../../core/recording-export-quality.ts';
import type { BackMode } from '../../core/back-mode.ts';
import type { ClickButton } from '../../core/click-button.ts';
import type { SwipePattern } from '../../core/scroll-gesture.ts';
import {
PLATFORM_SELECTORS,
type DeviceTarget,
type PlatformSelector,
} from '../../kernel/device.ts';
import {
type DaemonInstallSource,
type DaemonServerMode,
type DaemonTransportPreference,
type LeaseBackend,
type NetworkIncludeMode,
RESPONSE_LEVELS,
type ResponseLevel,
type SessionRuntimeHints,
type SessionIsolationMode,
} from '../../kernel/contracts.ts';
import type {
CloudProviderProfileFields,
RemoteConfigMetroOptions,
} from '../../remote/remote-config-schema.ts';
import {
SCREENSHOT_SPECIFIC_FLAG_DEFINITIONS,
type ScreenshotRequestFlags,
} from '../../contracts/screenshot.ts';
import { PERF_KIND_VALUES } from '../../contracts/perf.ts';
import {
MAESTRO_COMPAT_TRACKER_URL,
formatMaestroSupportedSubsetForCli,
} from '../../compat/maestro/support-matrix.ts';
export type CliFlags = CloudProviderProfileFields &
RemoteConfigMetroOptions &
ScreenshotRequestFlags & {
json: boolean;
config?: string;
remoteConfig?: string;
stateDir?: string;
daemonBaseUrl?: string;
daemonAuthToken?: string;
daemonTransport?: DaemonTransportPreference;
daemonServerMode?: DaemonServerMode;
proxyHost?: string;
proxyPort?: number;
tenant?: string;
sessionIsolation?: SessionIsolationMode;
runId?: string;
leaseId?: string;
leaseBackend?: LeaseBackend;
provider?: string;
providerSessionId?: string;
force?: boolean;
noLogin?: boolean;
kind?: string;
perfTemplate?: string;
sessionLock?: 'reject' | 'strip';
sessionLocked?: boolean;
sessionLockConflicts?: 'reject' | 'strip';
platform?: PlatformSelector;
target?: DeviceTarget;
device?: string;
udid?: string;
serial?: string;
iosSimulatorDeviceSet?: string;
iosXctestrunFile?: string;
iosXctestDerivedDataPath?: string;
iosXctestEnvDir?: string;
deviceHub?: boolean;
androidDeviceAllowlist?: string;
remote?: boolean;
session?: string;
targetApp?: string;
metroHost?: string;
metroPort?: number;
bundleUrl?: string;
launchUrl?: string;
verbose?: boolean;
cost?: boolean;
responseLevel?: ResponseLevel;
snapshotInteractiveOnly?: boolean;
snapshotDiff?: boolean;
snapshotDepth?: number;
snapshotScope?: string;
snapshotRaw?: boolean;
snapshotForceFull?: boolean;
artifact?: string;
dsym?: string;
searchPath?: string;
networkInclude?: NetworkIncludeMode;
baseline?: string;
threshold?: string;
appsFilter?: 'user-installed' | 'all';
count?: number;
fps?: number;
quality?: RecordingExportQuality | string;
hideTouches?: boolean;
intervalMs?: number;
delayMs?: number;
durationMs?: number;
holdMs?: number;
jitterPx?: number;
pixels?: number;
doubleTap?: boolean;
verify?: boolean;
settle?: boolean;
settleQuietMs?: number;
clickButton?: ClickButton;
backMode?: BackMode;
pauseMs?: number;
pattern?: SwipePattern;
activity?: string;
launchConsole?: string;
launchArgs?: string[];
header?: string[];
githubActionsArtifact?: string;
installSource?: DaemonInstallSource;
saveScript?: boolean | string;
shutdown?: boolean;
relaunch?: boolean;
surface?: SessionSurface;
headless?: boolean;
restart?: boolean;
noRecord?: boolean;
retainPaths?: boolean;
retentionMs?: number;
replayUpdate?: boolean;
replayMaestro?: boolean;
replayExportFormat?: 'maestro';
replayEnv?: string[];
replayShellEnv?: Record<string, string>;
failFast?: boolean;
timeoutMs?: number;
retries?: number;
recordVideo?: boolean;
artifactsDir?: string;
reporter?: string[];
reportJunit?: string;
shardAll?: number;
shardSplit?: number;
steps?: string;
stepsFile?: string;
findFirst?: boolean;
findLast?: boolean;
batchOnError?: 'stop';
batchMaxSteps?: number;
batchSteps?: Array<{
command: string;
input: Record<string, unknown>;
runtime?: SessionRuntimeHints;
}>;
out?: string;
help: boolean;
version: boolean;
};
export type DaemonExcludedCliFlag = 'json' | 'help' | 'version' | 'batchSteps' | 'replayMaestro';
export type FlagKey = keyof CliFlags;
type FlagType = 'boolean' | 'int' | 'enum' | 'string' | 'booleanOrString';
export type FlagDefinition = {
key: FlagKey;
names: readonly string[];
type: FlagType;
multiple?: boolean;
enumValues?: readonly string[];
min?: number;
max?: number;
setValue?: CliFlags[FlagKey];
usageLabel?: string;
usageDescription?: string;
};
function flagKeys<const TKeys extends readonly FlagKey[]>(...keys: TKeys): TKeys {
return keys;
}
export const SNAPSHOT_FLAGS = flagKeys(
'snapshotInteractiveOnly',
'snapshotDepth',
'snapshotScope',
'snapshotRaw',
);
export const SELECTOR_SNAPSHOT_FLAGS = flagKeys('snapshotDepth', 'snapshotScope', 'snapshotRaw');
export const METRO_PREPARE_FLAGS = flagKeys(
'metroProjectRoot',
'kind',
'metroKind',
'metroPublicBaseUrl',
'metroProxyBaseUrl',
'metroBearerToken',
'metroPreparePort',
'metroListenHost',
'metroStatusHost',
'metroStartupTimeoutMs',
'metroProbeTimeoutMs',
'metroRuntimeFile',
'metroNoReuseExisting',
'metroNoInstallDeps',
);
export const METRO_RELOAD_FLAGS = flagKeys('metroHost', 'metroPort', 'bundleUrl');
export const REPEATED_TOUCH_FLAGS = flagKeys(
'count',
'intervalMs',
'holdMs',
'jitterPx',
'doubleTap',
);
// Interaction commands with the descriptor post-action observation trait use
// these flags for `--settle` (#1101). --timeout doubles as the settle deadline
// (flag-sourced budget on the interaction descriptors, mirroring wait's
// positional budget).
export const SETTLE_FLAGS = flagKeys('settle', 'settleQuietMs', 'timeoutMs');
export const REPLAY_FLAGS = flagKeys('replayUpdate', 'replayEnv');
const FLAG_DEFINITIONS: readonly FlagDefinition[] = [
{
key: 'config',
names: ['--config'],
type: 'string',
usageLabel: '--config <path>',
usageDescription: 'Load CLI defaults from a specific config file',
},
{
key: 'remoteConfig',
names: ['--remote-config'],
type: 'string',
usageLabel: '--remote-config <path>',
usageDescription: 'Load remote host + Metro workflow settings from a specific profile file',
},
{
key: 'stateDir',
names: ['--state-dir'],
type: 'string',
usageLabel: '--state-dir <path>',
usageDescription:
'Daemon state directory (defaults to ~/.agent-device for packages, or a worktree-scoped dev dir from source)',
},
{
key: 'daemonBaseUrl',
names: ['--daemon-base-url'],
type: 'string',
usageLabel: '--daemon-base-url <url>',
usageDescription: 'Explicit remote HTTP daemon base URL (skip local daemon discovery/startup)',
},
{
key: 'daemonAuthToken',
names: ['--daemon-auth-token'],
type: 'string',
usageLabel: '--daemon-auth-token <token>',
usageDescription:
'Remote HTTP daemon or proxy auth token (sent as request token and bearer header)',
},
{
key: 'daemonTransport',
names: ['--daemon-transport'],
type: 'enum',
enumValues: ['auto', 'socket', 'http'],
usageLabel: '--daemon-transport auto|socket|http',
usageDescription: 'Daemon client transport preference',
},
{
key: 'daemonServerMode',
names: ['--daemon-server-mode'],
type: 'enum',
enumValues: ['socket', 'http', 'dual'],
usageLabel: '--daemon-server-mode socket|http|dual',
usageDescription: 'Daemon server mode used when spawning daemon',
},
{
key: 'proxyHost',
names: ['--host'],
type: 'string',
usageLabel: '--host <host>',
usageDescription: 'Proxy: host interface to bind (default: 127.0.0.1)',
},
{
key: 'proxyPort',
names: ['--port'],
type: 'int',
min: 1,
max: 65535,
usageLabel: '--port <port>',
usageDescription: 'Proxy: TCP port to bind (default: 0, choose a free port)',
},
{
key: 'tenant',
names: ['--tenant'],
type: 'string',
usageLabel: '--tenant <id>',
usageDescription: 'Tenant scope identifier for isolated daemon sessions',
},
{
key: 'sessionIsolation',
names: ['--session-isolation'],
type: 'enum',
enumValues: ['none', 'tenant'],
usageLabel: '--session-isolation none|tenant',
usageDescription: 'Session isolation strategy (tenant prefixes session namespace)',
},
{
key: 'runId',
names: ['--run-id'],
type: 'string',
usageLabel: '--run-id <id>',
usageDescription: 'Run identifier used for tenant lease admission checks',
},
{
key: 'leaseId',
names: ['--lease-id'],
type: 'string',
usageLabel: '--lease-id <id>',
usageDescription: 'Lease identifier bound to tenant/run admission scope',
},
{
key: 'leaseBackend',
names: ['--lease-backend'],
type: 'enum',
enumValues: ['ios-simulator', 'ios-instance', 'android-instance', 'web-instance'],
usageLabel: '--lease-backend ios-simulator|ios-instance|android-instance|web-instance',
usageDescription: 'Lease backend for remote tenant connection admission',
},
{
key: 'provider',
names: ['--provider'],
type: 'string',
usageLabel: '--provider <name>',
usageDescription: 'Cloud provider name for provider-scoped commands',
},
{
key: 'providerSessionId',
names: ['--provider-session'],
type: 'string',
usageLabel: '--provider-session <id>',
usageDescription: 'Cloud provider session id or ARN',
},
{
key: 'providerApp',
names: ['--provider-app'],
type: 'string',
usageLabel: '--provider-app <ref-or-path>',
usageDescription:
'Cloud provider app reference or local app path used when creating hosted WebDriver sessions',
},
{
key: 'providerOsVersion',
names: ['--provider-os-version', '--os-version'],
type: 'string',
usageLabel: '--provider-os-version <version>',
usageDescription: 'Hosted cloud provider OS version, for example 17 or 14.0',
},
{
key: 'providerProject',
names: ['--provider-project'],
type: 'string',
usageLabel: '--provider-project <name>',
usageDescription: 'Hosted cloud provider project label',
},
{
key: 'providerBuild',
names: ['--provider-build'],
type: 'string',
usageLabel: '--provider-build <name>',
usageDescription: 'Hosted cloud provider build label',
},
{
key: 'providerSessionName',
names: ['--provider-session-name'],
type: 'string',
usageLabel: '--provider-session-name <name>',
usageDescription: 'Hosted cloud provider session label',
},
{
key: 'awsProjectArn',
names: ['--aws-project-arn'],
type: 'string',
usageLabel: '--aws-project-arn <arn>',
usageDescription: 'AWS Device Farm project ARN for hosted WebDriver sessions',
},
{
key: 'awsDeviceArn',
names: ['--aws-device-arn'],
type: 'string',
usageLabel: '--aws-device-arn <arn>',
usageDescription: 'AWS Device Farm device ARN for hosted WebDriver sessions',
},
{
key: 'awsAppArn',
names: ['--aws-app-arn'],
type: 'string',
usageLabel: '--aws-app-arn <arn>',
usageDescription: 'AWS Device Farm app ARN attached to hosted remote access sessions',
},
{
key: 'awsRegion',
names: ['--aws-region'],
type: 'string',
usageLabel: '--aws-region <region>',
usageDescription: 'AWS region for Device Farm API calls',
},
{
key: 'awsInteractionMode',
names: ['--aws-interaction-mode'],
type: 'enum',
enumValues: ['INTERACTIVE', 'NO_VIDEO', 'VIDEO_ONLY'],
usageLabel: '--aws-interaction-mode INTERACTIVE|NO_VIDEO|VIDEO_ONLY',
usageDescription: 'AWS Device Farm remote access interaction mode',
},
{
key: 'rokuWebDriverUrl',
names: ['--roku-webdriver-url'],
type: 'string',
usageLabel: '--roku-webdriver-url <url>',
usageDescription: 'Roku WebDriver server URL for Roku provider sessions',
},
{
key: 'rokuDeviceIp',
names: ['--roku-device-ip'],
type: 'string',
usageLabel: '--roku-device-ip <ip>',
usageDescription: 'LAN IP address of the Roku device controlled by Roku WebDriver',
},
{
key: 'force',
names: ['--force'],
type: 'boolean',
usageLabel: '--force',
usageDescription: 'Force connection state replacement when reconnecting',
},
{
key: 'noLogin',
names: ['--no-login'],
type: 'boolean',
usageLabel: '--no-login',
usageDescription: 'Connect: fail instead of starting implicit cloud login',
},
{
key: 'sessionLock',
names: ['--session-lock'],
type: 'enum',
enumValues: ['reject', 'strip'],
usageLabel: '--session-lock reject|strip',
usageDescription:
'Lock bound-session device routing for this CLI invocation and nested batch steps',
},
{
key: 'sessionLocked',
names: ['--session-locked'],
type: 'boolean',
usageLabel: '--session-locked',
usageDescription: 'Deprecated alias for --session-lock reject',
},
{
key: 'sessionLockConflicts',
names: ['--session-lock-conflicts'],
type: 'enum',
enumValues: ['reject', 'strip'],
usageLabel: '--session-lock-conflicts reject|strip',
usageDescription: 'Deprecated alias for --session-lock',
},
{
key: 'platform',
names: ['--platform'],
type: 'enum',
enumValues: PLATFORM_SELECTORS,
usageLabel: `--platform ${PLATFORM_SELECTORS.join('|')}`,
usageDescription: 'Platform to target (`apple` aliases the Apple automation backend)',
},
{
key: 'target',
names: ['--target'],
type: 'enum',
enumValues: ['mobile', 'tv', 'desktop'],
usageLabel: '--target mobile|tv|desktop',
usageDescription: 'Device target class to match',
},
{
key: 'device',
names: ['--device'],
type: 'string',
usageLabel: '--device <name>',
usageDescription: 'Device name to target',
},
{
key: 'udid',
names: ['--udid'],
type: 'string',
usageLabel: '--udid <udid>',
usageDescription: 'iOS device UDID',
},
{
key: 'serial',
names: ['--serial'],
type: 'string',
usageLabel: '--serial <serial>',
usageDescription: 'Android device serial',
},
{
key: 'surface',
names: ['--surface'],
type: 'enum',
enumValues: SESSION_SURFACES,
usageLabel: '--surface app|frontmost-app|desktop|menubar',
usageDescription: 'macOS session surface for open (defaults to app)',
},
{
key: 'headless',
names: ['--headless'],
type: 'boolean',
usageLabel: '--headless',
usageDescription: 'Boot: launch Android emulator without a GUI window',
},
{
key: 'targetApp',
names: ['--app', '--target-app'],
type: 'string',
usageLabel: '--app <id-or-name>',
usageDescription: 'Doctor: verify an installed target app without opening a session',
},
{
key: 'metroHost',
names: ['--metro-host'],
type: 'string',
usageLabel: '--metro-host <host>',
usageDescription: 'Session-scoped Metro/debug host hint',
},
{
key: 'metroPort',
names: ['--metro-port'],
type: 'int',
min: 1,
max: 65535,
usageLabel: '--metro-port <port>',
usageDescription: 'Session-scoped Metro/debug port hint',
},
{
key: 'metroProjectRoot',
names: ['--project-root'],
type: 'string',
usageLabel: '--project-root <path>',
usageDescription: 'metro prepare: React Native project root (default: cwd)',
},
{
key: 'kind',
names: ['--kind'],
type: 'enum',
enumValues: ['auto', 'react-native', 'expo', 'repack', ...PERF_KIND_VALUES],
usageLabel: '--kind <kind>',
usageDescription:
'Kind selector for commands that support it, such as metro prepare or perf artifact collectors',
},
{
key: 'perfTemplate',
names: ['--template'],
type: 'string',
usageLabel: '--template <name>',
usageDescription: 'Perf xctrace template name, for example Time Profiler',
},
{
key: 'metroKind',
names: ['--metro-kind'],
type: 'enum',
enumValues: ['auto', 'react-native', 'expo', 'repack'],
usageLabel: '--metro-kind auto|react-native|expo|repack',
usageDescription: 'metro prepare: detect or force the React Native dev-server launcher kind',
},
{
key: 'metroPublicBaseUrl',
names: ['--public-base-url'],
type: 'string',
usageLabel: '--public-base-url <url>',
usageDescription: 'metro prepare: public base URL used for direct dev-server bundle hints',
},
{
key: 'metroProxyBaseUrl',
names: ['--proxy-base-url'],
type: 'string',
usageLabel: '--proxy-base-url <url>',
usageDescription: 'metro prepare: optional bridge origin for remote dev-server access',
},
{
key: 'metroBearerToken',
names: ['--bearer-token'],
type: 'string',
usageLabel: '--bearer-token <token>',
usageDescription:
'metro prepare: host bridge bearer token (or AGENT_DEVICE_METRO_BEARER_TOKEN; falls back to AGENT_DEVICE_DAEMON_AUTH_TOKEN)',
},
{
key: 'metroPreparePort',
names: ['--port'],
type: 'int',
min: 1,
max: 65535,
usageLabel: '--port <port>',
usageDescription: 'metro prepare: local dev-server port (default: 8081)',
},
{
key: 'metroListenHost',
names: ['--listen-host'],
type: 'string',
usageLabel: '--listen-host <host>',
usageDescription: 'metro prepare: host dev server listens on (default: 0.0.0.0)',
},
{
key: 'metroStatusHost',
names: ['--status-host'],
type: 'string',
usageLabel: '--status-host <host>',
usageDescription:
'metro prepare: host used for local dev-server /status polling (default: 127.0.0.1)',
},
{
key: 'metroStartupTimeoutMs',
names: ['--startup-timeout-ms'],
type: 'int',
min: 1,
usageLabel: '--startup-timeout-ms <ms>',
usageDescription: 'metro prepare: timeout while waiting for the dev server to become ready',
},
{
key: 'metroProbeTimeoutMs',
names: ['--probe-timeout-ms'],
type: 'int',
min: 1,
usageLabel: '--probe-timeout-ms <ms>',
usageDescription: 'metro prepare: timeout for /status and proxy bridge calls',
},
{
key: 'metroRuntimeFile',
names: ['--runtime-file'],
type: 'string',
usageLabel: '--runtime-file <path>',
usageDescription: 'metro prepare: optional file path to persist the JSON result',
},
{
key: 'metroNoReuseExisting',
names: ['--no-reuse-existing'],
type: 'boolean',
usageLabel: '--no-reuse-existing',
usageDescription: 'metro prepare: always start a fresh Metro process',
},
{
key: 'metroNoInstallDeps',
names: ['--no-install-deps'],
type: 'boolean',
usageLabel: '--no-install-deps',
usageDescription: 'metro prepare: skip package-manager install when node_modules is missing',
},
{
key: 'bundleUrl',
names: ['--bundle-url'],
type: 'string',
usageLabel: '--bundle-url <url>',
usageDescription: 'Session-scoped bundle URL hint',
},
{
key: 'launchUrl',
names: ['--launch-url'],
type: 'string',
usageLabel: '--launch-url <url>',
usageDescription: 'Session-scoped deep link / launch URL hint',
},
{
key: 'iosSimulatorDeviceSet',
names: ['--ios-simulator-device-set'],
type: 'string',
usageLabel: '--ios-simulator-device-set <path>',
usageDescription: 'Scope iOS simulator discovery/commands to this simulator device set',
},
{
key: 'iosXctestrunFile',
names: ['--ios-xctestrun-file'],
type: 'string',
usageLabel: '--ios-xctestrun-file <path>',
usageDescription: 'Use an externally built iOS XCTest runner .xctestrun artifact',
},
{
key: 'iosXctestDerivedDataPath',
names: ['--ios-xctest-derived-data-path'],
type: 'string',
usageLabel: '--ios-xctest-derived-data-path <path>',
usageDescription: 'Derived data path for external iOS XCTest runner execution',
},
{
key: 'iosXctestEnvDir',
names: ['--ios-xctest-env-dir'],
type: 'string',
usageLabel: '--ios-xctest-env-dir <path>',
usageDescription: 'Writable directory for per-session iOS XCTest runner env overlays',
},
{
key: 'deviceHub',
names: ['--device-hub'],
type: 'boolean',
usageLabel: '--device-hub',
usageDescription: 'open: use Xcode Device Hub when surfacing Apple simulators',
},
{
key: 'androidDeviceAllowlist',
names: ['--android-device-allowlist'],
type: 'string',
usageLabel: '--android-device-allowlist <serials>',
usageDescription: 'Comma/space separated Android serial allowlist for discovery/selection',
},
{
key: 'remote',
names: ['--remote'],
type: 'boolean',
usageLabel: '--remote',
usageDescription: 'Doctor: check remote connection setup instead of local device inventory',
},
{
key: 'activity',
names: ['--activity'],
type: 'string',
usageLabel: '--activity <component>',
usageDescription: 'Android app launch activity (package/Activity); not for URL opens',
},
{
key: 'launchConsole',
names: ['--launch-console'],
type: 'string',
usageLabel: '--launch-console <path>',
usageDescription: 'open: capture the initial iOS simulator launch console window to a file',
},
{
key: 'launchArgs',
names: ['--launch-args'],
type: 'string',
multiple: true,
usageLabel: '--launch-args <arg>',
usageDescription:
'open: repeatable launch argument forwarded verbatim to the platform launch command (iOS app process args; Android adb shell am start args). Linux and macOS reject the flag.',
},
{
key: 'header',
names: ['--header'],
type: 'string',
multiple: true,
usageLabel: '--header <name:value>',
usageDescription: 'install-from-source: repeatable HTTP header for URL downloads',
},
{
key: 'githubActionsArtifact',
names: ['--github-actions-artifact'],
type: 'string',
usageLabel: '--github-actions-artifact <owner/repo:artifact>',
usageDescription: 'install-from-source: GitHub Actions artifact resolved by a remote daemon',
},
{
key: 'installSource',
// Config-only virtual option; parsed explicitly from JSON before generic string options.
names: [],
type: 'string',
},
{
key: 'session',
names: ['--session'],
type: 'string',
usageLabel: '--session <name>',
usageDescription: 'Named session',
},
{
key: 'count',
names: ['--count'],
type: 'int',
min: 1,
max: 200,
usageLabel: '--count <n>',
usageDescription: 'Repeat count for press/swipe series',
},
{
key: 'fps',
names: ['--fps'],
type: 'int',
min: 1,
max: 120,
usageLabel: '--fps <n>',
usageDescription: 'Record: target frames per second (iOS physical device runner)',
},
{
key: 'quality',
names: ['--quality'],
type: 'string',
usageLabel: '--quality <medium|high>',
usageDescription:
'Record: output quality preset; Android maps this to screenrecord bitrate, Apple targets use it for export/encoding. Legacy numeric values 5-7 map to medium; 8-10 map to high',
},
{
key: 'hideTouches',
names: ['--hide-touches'],
type: 'boolean',
usageLabel: '--hide-touches',
usageDescription: 'Record: skip touch-overlay post-processing for faster raw benchmark videos',
},
{
key: 'intervalMs',
names: ['--interval-ms'],
type: 'int',
min: 0,
max: 10_000,
usageLabel: '--interval-ms <ms>',
usageDescription: 'Delay between press iterations',
},
{
key: 'delayMs',
names: ['--delay-ms'],
type: 'int',
min: 0,
max: 10_000,
usageLabel: '--delay-ms <ms>',
usageDescription: 'Delay between typed characters',
},
{
key: 'durationMs',
names: ['--duration-ms'],
type: 'int',
min: 0,
max: 10_000,
usageLabel: '--duration-ms <ms>',
usageDescription: 'Scroll: pace the gesture over this duration when supported',
},
{
key: 'holdMs',
names: ['--hold-ms'],
type: 'int',
min: 0,
max: 10_000,
usageLabel: '--hold-ms <ms>',
usageDescription: 'Press hold duration for each iteration',
},
{
key: 'jitterPx',
names: ['--jitter-px'],
type: 'int',
min: 0,
max: 100,
usageLabel: '--jitter-px <n>',
usageDescription: 'Deterministic coordinate jitter radius for press',
},
{
key: 'pixels',
names: ['--pixels'],
type: 'int',
min: 1,
max: 100_000,
usageLabel: '--pixels <n>',
usageDescription: 'Scroll: explicit gesture distance in pixels',
},
{
key: 'doubleTap',
names: ['--double-tap'],
type: 'boolean',
usageLabel: '--double-tap',
usageDescription: 'Use double-tap gesture per press iteration',
},
{
key: 'verify',
names: ['--verify'],
type: 'boolean',
usageLabel: '--verify',
usageDescription:
'Capture cheap post-action evidence (AX digest, node counts, changedFromBefore) instead of a follow-up snapshot',
},
{
key: 'settle',
names: ['--settle'],
type: 'boolean',
usageLabel: '--settle',
usageDescription:
'After the action, wait for the UI to go quiet and return the settled diff vs the pre-action tree in the same response (best-effort; never fails the action)',
},
{
key: 'settleQuietMs',
names: ['--settle-quiet'],
type: 'int',
min: 0,
usageLabel: '--settle-quiet <ms>',
usageDescription: 'Settle: quiet window the UI must hold to count as settled (default 500ms)',
},
{
key: 'clickButton',
names: ['--button'],
type: 'enum',
enumValues: ['primary', 'secondary', 'middle'],
usageLabel: '--button primary|secondary|middle',
usageDescription: 'Click: choose mouse button (middle reserved for future macOS support)',
},
// These aliases encode the value directly in the flag name so `back` reads naturally as
// `back --in-app` or `back --system` without introducing a separate `--back-mode` flag.
{
key: 'backMode',
names: ['--in-app'],
type: 'enum',
enumValues: ['in-app', 'system'],
setValue: 'in-app',
usageLabel: '--in-app',
usageDescription: 'Back: use app-provided back UI when available',
},
{
key: 'backMode',
names: ['--system'],
type: 'enum',
enumValues: ['in-app', 'system'],
setValue: 'system',
usageLabel: '--system',
usageDescription: 'Back: use system back input or gesture when available',
},
{
key: 'pauseMs',
names: ['--pause-ms'],
type: 'int',
min: 0,
max: 10_000,
usageLabel: '--pause-ms <ms>',
usageDescription: 'Delay between swipe iterations',
},
{
key: 'pattern',
names: ['--pattern'],
type: 'enum',
enumValues: ['one-way', 'ping-pong'],
usageLabel: '--pattern one-way|ping-pong',
usageDescription: 'Swipe repeat pattern',
},
{
key: 'verbose',
names: ['--debug', '--verbose', '-v'],
type: 'boolean',
usageLabel: '--debug, --verbose, -v',
usageDescription:
'Enable debug diagnostics; test --verbose prints per-test step timings without debug logs',
},
{
key: 'cost',
names: ['--cost'],
type: 'boolean',
usageLabel: '--cost',
usageDescription: 'Include per-command wall-clock latency (cost.wallClockMs) in the response',
},
{
key: 'responseLevel',
names: ['--level'],
type: 'enum',
enumValues: RESPONSE_LEVELS,
usageLabel: '--level digest|default|full',
usageDescription:
'Response detail level: digest (token-cheap), default (today), or full. Default keeps the wire shape unchanged.',
},
{
key: 'json',
names: ['--json'],
type: 'boolean',
usageLabel: '--json',
usageDescription: 'JSON output',
},
{
key: 'help',
names: ['--help', '-h'],
type: 'boolean',
usageLabel: '--help, -h',
usageDescription: 'Print help and exit',
},
{
key: 'version',
names: ['--version', '-V'],
type: 'boolean',
usageLabel: '--version, -V',
usageDescription: 'Print version and exit',
},
{
key: 'snapshotDiff',
names: ['--diff'],
type: 'boolean',
usageLabel: '--diff',
usageDescription: 'Snapshot: show structural diff against the previous session baseline',
},
{
key: 'saveScript',
names: ['--save-script'],
type: 'booleanOrString',
usageLabel: '--save-script [path]',
usageDescription: 'Save session script (.ad) on close; optional custom output path',
},
{
key: 'networkInclude',
names: ['--include'],
type: 'enum',
enumValues: ['summary', 'headers', 'body', 'all'],
usageLabel: '--include summary|headers|body|all',
usageDescription: 'Network: include headers, bodies, or both in output',
},