peachsim 0.1.2400 → 0.1.2401

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +2 -2
  2. package/cli/bin.ts +1 -1
  3. package/cli/catalog/content.ts +520 -0
  4. package/cli/catalog/index.ts +4 -0
  5. package/cli/catalog/meta.ts +3881 -0
  6. package/cli/catalog/renderers.ts +659 -0
  7. package/cli/catalog/routes.ts +237 -0
  8. package/cli/catalog/types.ts +96 -0
  9. package/cli/commands/inspect.ts +3 -3
  10. package/cli/commands/record.ts +1 -1
  11. package/cli/dev-build-freshness.ts +1 -0
  12. package/cli/help-core.ts +6 -6
  13. package/cli/hidden-runtime-alias.ts +1 -1
  14. package/cli/parse-args.ts +1 -1
  15. package/dist-lib/agent-daemon-client.cjs +1 -1
  16. package/dist-lib/agent-events.cjs +1 -1
  17. package/dist-lib/attached-projects.cjs +1 -1
  18. package/dist-lib/auth/shared-session.cjs +1 -1
  19. package/dist-lib/backend-origin.cjs +1 -1
  20. package/dist-lib/beta.cjs +1 -1
  21. package/dist-lib/beta.mjs +1 -1
  22. package/dist-lib/bridge-constants.cjs +1 -1
  23. package/dist-lib/bridge-contract-input.cjs +1 -1
  24. package/dist-lib/bridge-contract-input.mjs +1 -1
  25. package/dist-lib/bridge-contract.cjs +1 -1
  26. package/dist-lib/bridge-contract.mjs +1 -1
  27. package/dist-lib/bundle-channel.cjs +32 -32
  28. package/dist-lib/capture-contract.cjs +1 -1
  29. package/dist-lib/capture-contract.mjs +1 -1
  30. package/dist-lib/cloud-contract.cjs +1 -1
  31. package/dist-lib/cloud-contract.mjs +1 -1
  32. package/dist-lib/cloud-test-args.cjs +1 -1
  33. package/dist-lib/cloud-test-args.mjs +1 -1
  34. package/dist-lib/cloud.cjs +1 -1
  35. package/dist-lib/cloud.mjs +1 -1
  36. package/dist-lib/config.cjs +1 -1
  37. package/dist-lib/config.mjs +1 -1
  38. package/dist-lib/detox/index.cjs +1 -1
  39. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  40. package/dist-lib/expo-swift-bundle.cjs +31 -31
  41. package/dist-lib/expo-swift-metadata.cjs +1 -1
  42. package/dist-lib/expo-swift-metadata.mjs +1 -1
  43. package/dist-lib/home-paths.cjs +1 -1
  44. package/dist-lib/host/bridge-host.cjs +32 -32
  45. package/dist-lib/host/fetch-proxy-handler.cjs +43 -40
  46. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  47. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  48. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  49. package/dist-lib/host/websocket-proxy.cjs +1 -1
  50. package/dist-lib/index.cjs +47 -44
  51. package/dist-lib/jump-to-source-babel.cjs +1 -1
  52. package/dist-lib/jump-to-source-native.cjs +1 -1
  53. package/dist-lib/kotlin-host.cjs +1 -1
  54. package/dist-lib/menu.cjs +1 -1
  55. package/dist-lib/menu.mjs +1 -1
  56. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  57. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  58. package/dist-lib/metro-production-bundle.cjs +1 -1
  59. package/dist-lib/metro-production-bundle.mjs +1 -1
  60. package/dist-lib/metro.cjs +52 -49
  61. package/dist-lib/native-app-identity-project.cjs +22 -19
  62. package/dist-lib/native-app-identity-project.mjs +4 -3
  63. package/dist-lib/native-app-identity.cjs +1 -1
  64. package/dist-lib/native-app-identity.mjs +1 -1
  65. package/dist-lib/native-firebase-metadata.cjs +1 -1
  66. package/dist-lib/native-firebase-metadata.mjs +1 -1
  67. package/dist-lib/pdfium-raster.cjs +1 -1
  68. package/dist-lib/pdfium-raster.mjs +1 -1
  69. package/dist-lib/plist.cjs +1 -1
  70. package/dist-lib/plist.mjs +1 -1
  71. package/dist-lib/profiles.cjs +1 -1
  72. package/dist-lib/public-brand.cjs +1 -1
  73. package/dist-lib/public-origins-lib-esm.json +24 -24
  74. package/dist-lib/public-origins-lib.json +59 -59
  75. package/dist-lib/react-native-host-modules.cjs +1 -1
  76. package/dist-lib/react-native-host-modules.mjs +1 -1
  77. package/dist-lib/reap-browser.cjs +1 -1
  78. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  79. package/dist-lib/sdk.cjs +1 -1
  80. package/dist-lib/sdk.mjs +1 -1
  81. package/dist-lib/skills.cjs +47 -47
  82. package/dist-lib/swift-compile.cjs +28 -30
  83. package/dist-lib/swift-compile.mjs +24 -26
  84. package/dist-lib/swift-package.cjs +1 -1
  85. package/dist-lib/swift-package.mjs +1 -1
  86. package/dist-lib/swift-submit.cjs +1 -1
  87. package/dist-lib/swift-submit.mjs +1 -1
  88. package/dist-lib/swift-toolchain.cjs +1 -1
  89. package/dist-lib/swift.cjs +1 -1
  90. package/dist-lib/vite-swift.cjs +29 -31
  91. package/dist-lib/vite.cjs +38 -35
  92. package/dist-lib/worklet-executable.cjs +1 -1
  93. package/dist-lib/worklet-executable.mjs +1 -1
  94. package/kotlin/sdk.tar.gz +0 -0
  95. package/kotlin/toolchain.json +2 -2
  96. package/package.json +1 -3
  97. package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GKState.h +78 -0
  98. package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GKStateMachine.h +69 -0
  99. package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.apinotes +269 -0
  100. package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.h +15 -0
  101. package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKitBase.h +38 -0
  102. package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Modules/module.modulemap +6 -0
  103. package/src/wasm-optimize.ts +23 -24
  104. package/src/worklets-babel.ts +2 -6
  105. package/cli/registry.ts +0 -2
@@ -0,0 +1,3881 @@
1
+ import type {
2
+ CliCommandMeta,
3
+ CliDocRenderContext,
4
+ CliExampleMeta,
5
+ CliGlobalFlagMeta,
6
+ CliInspectVerbMeta,
7
+ CliOptionMeta,
8
+ } from './types'
9
+
10
+ export const DEFAULT_CLI_DOC_CONTEXT: CliDocRenderContext = {
11
+ bridgePort: 7668,
12
+ defaultShellUrl: 'http://localhost:7668/',
13
+ }
14
+
15
+ export const cliGlobalFlags: CliGlobalFlagMeta[] = [
16
+ { flag: '-h, --help', description: 'show help' },
17
+ { flag: '-V, --version', description: 'show version' },
18
+ { flag: '-v, --verbose', description: 'verbose output' },
19
+ {
20
+ flag: '-p, --port <number>',
21
+ description: 'bridge port, depending on command',
22
+ },
23
+ { flag: '-d, --device <model>', description: 'override the simulated device model' },
24
+ {
25
+ flag: '-t, --theme <scheme>',
26
+ description: 'override light, dark, or auto color scheme',
27
+ },
28
+ {
29
+ flag: '--headless',
30
+ description: 'run browser automation without a visible window where supported',
31
+ },
32
+ {
33
+ flag: '--redact',
34
+ description:
35
+ 'mask keys, tokens, account ids and emails in the output of logs, network, what-happened and get, so it can be shared',
36
+ },
37
+ ]
38
+
39
+ function option(flag: string, description: string, hidden?: boolean): CliOptionMeta {
40
+ return hidden ? { flag, description, hidden } : { flag, description }
41
+ }
42
+
43
+ // the commands that print through this process only accept --redact.
44
+ const REDACT_OPTION = option(
45
+ '--redact',
46
+ 'mask tokens, emails and account ids so the output can be shared',
47
+ )
48
+
49
+ function example(
50
+ command: string,
51
+ description?: string,
52
+ hidden?: boolean,
53
+ ): CliExampleMeta {
54
+ return hidden ? { command, description, hidden } : { command, description }
55
+ }
56
+
57
+ export const cliCommandMetas: CliCommandMeta[] = [
58
+ {
59
+ id: 'cleanup',
60
+ slug: 'cleanup',
61
+ navTitle: 'cleanup',
62
+ title: 'peach cleanup',
63
+ description: 'inspect and reclaim local peach disk usage',
64
+ summary:
65
+ 'Preview reclaimable disk usage, then remove downloaded runtime archives, excess inactive runtimes, and disposable browser caches without touching the active runtime or persistent app storage. Aggressive mode also removes the rollback runtime and user-created recordings.',
66
+ order: 58,
67
+ usage: [
68
+ 'peach cleanup',
69
+ 'peach cleanup --apply',
70
+ 'peach cleanup --aggressive',
71
+ 'peach cleanup --apply --aggressive',
72
+ ],
73
+ options: [
74
+ option(
75
+ '--apply',
76
+ 'perform the previewed cleanup; without it the command is read-only',
77
+ ),
78
+ option(
79
+ '--aggressive',
80
+ 'also remove the rollback runtime plus user-created recordings and captured frames',
81
+ ),
82
+ ],
83
+ examples: [
84
+ example('peach cleanup', 'show exact reclaimable disk usage without deleting'),
85
+ example('peach cleanup --apply', 'reclaim safe caches and old runtimes'),
86
+ example(
87
+ 'peach cleanup --apply --aggressive',
88
+ 'also remove the rollback runtime and recordings',
89
+ ),
90
+ ],
91
+ related: ['runtime', 'storage', 'daemon'],
92
+ },
93
+ {
94
+ id: 'record',
95
+ slug: 'record',
96
+ navTitle: 'record',
97
+ title: 'peach record',
98
+ description:
99
+ 'create a Recording, render webm/mp4, capture a gif, or sample N png frames',
100
+ summary:
101
+ 'Video recording captures the app scene during the take and renders a video after stop in an isolated viewer. The render subcommand exports a saved scene stream at 60 fps by default. Use atomic mode for a fixed duration or start and stop around interactions. GIF and PNG capture use atomic mode. Upload a Recording with `peach record upload`; add --live-bundle to include Live. Combined recordings include events and upload automatically. Bundle-bearing `live` and `combined` uploads reuse the bundle-derived URL when the same app is recorded again. `--three` films a flow on the 3D device stage: the flow runs at full speed on the flat canvas while the screen is captured, then the capture plays back on the 3D phone under a camera script and the stage is saved as a clip; stage decor takes the same flags as `peach mode three configure`. Recording needs a signed-in account: `peach login` or PEACH_API_KEY.',
102
+ order: 60,
103
+ usage: [
104
+ 'peach record [options]',
105
+ 'peach record start [options]',
106
+ 'peach record render --scene <path> --shell-url <url> --output <video.mp4>',
107
+ 'peach record prelude-start [--origin <url>]',
108
+ 'peach record stop [--output <path>]',
109
+ 'peach record status # reports the record-start session; also probes the engine',
110
+ 'peach record cancel # cancels a record-start session',
111
+ 'peach record upload (--events <path> | --video <path> | --scene <path>) [--live-bundle] [--open]',
112
+ 'peach record --three <flow.yaml> [--script <id>] [--output <path>]',
113
+ ],
114
+ options: [
115
+ option(
116
+ '--format <type>',
117
+ 'webm | mp4 | gif | png (inferred from --output extension; stateful mode is webm/mp4 only)',
118
+ ),
119
+ option(
120
+ '--mode <kind>',
121
+ 'video | live | combined (default: video). live captures the event stream; combined captures both and uploads automatically. live/combined upload to /preview/<id> whose id is bundle-derived, so re-recording the same app overwrites the previous Recording',
122
+ ),
123
+ option(
124
+ '--duration <seconds>',
125
+ 'recording duration (default: 10, atomic mode only)',
126
+ ),
127
+ option(
128
+ '--capture <kind>',
129
+ 'recording plays the full take; run trims the lead-in (default: recording, or run for agents and CI)',
130
+ ),
131
+ option(
132
+ '--scene <path>',
133
+ 'saved scene stream to render (record render), or upload without a live bundle (record upload)',
134
+ ),
135
+ option(
136
+ '--shell-url <url>',
137
+ 'Peach shell URL used by the isolated scene renderer (record render)',
138
+ ),
139
+ option('--fps <number>', 'target frame rate for video/gif (default: 30)'),
140
+ option(
141
+ '--three',
142
+ 'run the flow file given, then film its playback on the 3D device stage (default output ~/Desktop/peach-recordings/<flow>.webm)',
143
+ ),
144
+ option('--script <id>', 'camera script for --three (default: hero-arc)'),
145
+ option('--slow <ms>', 'per-step delay for the --three flow run'),
146
+ option('--keep-three', 'leave 3D mode and the recording editor on after --three'),
147
+ option(
148
+ '--background <id>',
149
+ 'stage background for --three, with --gradient, --colorway, --environment, --room and --focus as in mode three configure',
150
+ ),
151
+ option('--output <path>', 'output file, or directory when --frames is set'),
152
+ option('--frames <n>', 'sample N evenly-spaced png frames instead of a video'),
153
+ option('--max-width <px>', 'limit the width of rendered video or gif frames'),
154
+ option('--scene-only', 'save the scene stream without rendering a video'),
155
+ option(
156
+ '--lockstep',
157
+ 'step the live app at exactly 1/fps per frame (record start/stop, mp4 only); this uses live frame capture and virtual time runs slower than wall time, compressing timers and gestures relative to the output timeline',
158
+ ),
159
+ option(
160
+ '--no-shell',
161
+ 'exclude the simulated iOS chrome (status bar, keyboard, toasts) and record the tenant surfaces only',
162
+ ),
163
+ option('--shell-only', 'record only the shell chrome'),
164
+ option(
165
+ '--open',
166
+ 'open the uploaded Recording in the browser after stop (live/combined)',
167
+ ),
168
+ option('--sim <sim>', 'target a specific sim'),
169
+ option(
170
+ '--origin <url>',
171
+ 'billing/upload origin for live/combined (default: https://peachsim.com; also honors PEACH_UPLOAD_ORIGIN)',
172
+ ),
173
+ option(
174
+ '--owner <org>',
175
+ 'associate live/combined Recordings with a linked org repo; pass with --repo',
176
+ ),
177
+ option(
178
+ '--repo <repo>',
179
+ 'repo name for --owner; the signed-in user must belong to the owning org team',
180
+ ),
181
+ option('--events <path>', 'for upload: gzipped events .jsonl.gz file to attach'),
182
+ option('--video <path>', 'for upload: mp4/gif recording to attach'),
183
+ option(
184
+ '--live-bundle',
185
+ 'for upload: include the running app bundle for Live alongside --scene',
186
+ ),
187
+ option('--assets-only', 'for upload: keep assets only; re-issue API calls live'),
188
+ ],
189
+ examples: [
190
+ example('peach record --duration 5'),
191
+ example('peach record --format mp4 --output demo.mp4 --duration 8'),
192
+ example('peach record --output demo.gif --duration 3'),
193
+ example('peach record --frames 10 --output ./frames/'),
194
+ example(
195
+ 'peach record --mode combined --duration 8 --open --owner my-org --repo my-app',
196
+ 'capture video + events and upload a repo-associated Recording',
197
+ ),
198
+ example(
199
+ 'peach record start --format mp4',
200
+ 'begin; interact freely across any number of CLI calls',
201
+ ),
202
+ example(
203
+ 'peach record start --mode combined',
204
+ 'start a Recording with events and video',
205
+ ),
206
+ example(
207
+ 'peach record prelude-start',
208
+ 'capture hidden setup events before starting the visible proof segment',
209
+ ),
210
+ example('peach record stop --output flow.mp4', 'finalize + save'),
211
+ example(
212
+ 'peach record cancel',
213
+ 'discard a record-start session (atomic --duration runs own their own lifecycle)',
214
+ ),
215
+ example('peach record upload --events ./my-run.jsonl.gz --open'),
216
+ example('peach record upload --video /tmp/peach-flow.mp4'),
217
+ example(
218
+ 'peach record --three flows/feed-scroll.yaml',
219
+ 'film a flow on the 3D stage',
220
+ ),
221
+ example(
222
+ 'peach record --three flows/swap.yaml --script hero-arc --background gradient-tide --output ~/Desktop/swap-3d.mp4',
223
+ ),
224
+ ],
225
+ related: ['screenshot', 'test'],
226
+ },
227
+ {
228
+ id: 'storage',
229
+ slug: 'storage',
230
+ navTitle: 'storage',
231
+ title: 'peach storage',
232
+ description: 'manage guest app storage and launch profiles',
233
+ summary:
234
+ "Clear the current guest app's local storage through the live reload bridge, or manage persistent storage profiles for the native desktop app, Windows Electron, and Playwright launches. Profiles isolate cookies, localStorage, IndexedDB, cache, permissions, and service workers. Selecting a profile creates a fresh managed sim because storage identity is fixed at launch.",
235
+ order: 65,
236
+ usage: [
237
+ 'peach storage clear [--sim <id>] [--json]',
238
+ 'peach storage profile list',
239
+ 'peach storage profile create <id>',
240
+ 'peach storage profile clear <id>',
241
+ 'peach storage profile delete <id>',
242
+ ],
243
+ options: [
244
+ option('--sim <id>', 'target a specific connected sim for `storage clear`'),
245
+ option('--json', 'emit { cleared, ready, reload } for `storage clear`'),
246
+ option('<id>', 'profile id: letters, numbers, dot, dash, or underscore'),
247
+ ],
248
+ examples: [
249
+ example('peach storage clear'),
250
+ example('peach storage clear --sim a9 --json'),
251
+ example('peach storage profile list'),
252
+ example('peach storage profile create qa'),
253
+ example('peach open 8081 --profile qa --driver playwright'),
254
+ example('peach storage profile clear qa'),
255
+ ],
256
+ related: ['open', 'desktop'],
257
+ },
258
+ {
259
+ id: 'permissions',
260
+ slug: 'permissions',
261
+ navTitle: 'permissions',
262
+ title: 'peach permissions',
263
+ description: 'inspect and change simulated operating-system permissions',
264
+ summary:
265
+ 'Read the installed-app permission registry or set and reset one app permission through the typed simulator bridge. Changes are immediately visible to guest permission APIs and the Settings app.',
266
+ order: 65.5,
267
+ usage: [
268
+ 'peach permissions list [--json]',
269
+ 'peach permissions get <app-id> [--json]',
270
+ 'peach permissions set <app-id> <kind> <status> [options]',
271
+ 'peach permissions reset <app-id> [kind] [--json]',
272
+ ],
273
+ options: [
274
+ option('--once', 'make an authorized grant expire when the app closes'),
275
+ option('--accuracy <value>', 'full or reduced location accuracy'),
276
+ option('--json', 'emit structured JSON'),
277
+ option('--sim <id>', 'target a specific connected sim'),
278
+ ],
279
+ examples: [
280
+ example('peach permissions list'),
281
+ example('peach permissions get dock-8081 --json'),
282
+ example('peach permissions set dock-8081 camera denied'),
283
+ example('peach permissions set dock-8081 photo-library limited'),
284
+ example('peach permissions reset dock-8081 camera'),
285
+ ],
286
+ related: ['storage', 'open', 'location'],
287
+ },
288
+ {
289
+ id: 'location',
290
+ slug: 'location',
291
+ navTitle: 'location',
292
+ title: 'peach location',
293
+ description: "control the simulator's simulated device location",
294
+ summary:
295
+ "Read, set, or clear the device's one simulated location, the `simctl location` equivalent. It feeds every app through the host-service geolocation seam and never reads the host Mac's real position. `clear` returns the device to iOS's own default location; `set` is read immediately by `getCurrentPosition` and by every active `watchPosition` subscriber.",
296
+ order: 65.6,
297
+ usage: [
298
+ 'peach location get [--json]',
299
+ 'peach location set <lat>,<lon> [options]',
300
+ 'peach location clear',
301
+ ],
302
+ options: [
303
+ option('--altitude <m>', 'meters above sea level'),
304
+ option('--accuracy <m>', 'horizontal accuracy in meters'),
305
+ option('--heading <deg>', 'course in degrees, 0-359.9, relative to true north'),
306
+ option('--speed <m/s>', 'ground speed in meters per second'),
307
+ option('--json', 'emit structured JSON'),
308
+ option('--sim <id>', 'target a specific connected sim'),
309
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
310
+ ],
311
+ examples: [
312
+ example('peach location set 37.785834,-122.406417'),
313
+ example(
314
+ 'peach location set 40.748817,-73.985428 --accuracy 10',
315
+ 'set a location with explicit accuracy',
316
+ ),
317
+ example('peach location get'),
318
+ example('peach location clear', "return to iOS's own default location"),
319
+ ],
320
+ related: ['permissions', 'open'],
321
+ },
322
+ {
323
+ id: 'push',
324
+ slug: 'push',
325
+ navTitle: 'push',
326
+ title: 'peach push',
327
+ description: 'deliver an APNs payload to an installed app',
328
+ summary:
329
+ 'Inject a remote notification by bundle identifier, like simctl push. The simulator applies the app’s notification settings and retains permitted background alerts for the Lock Screen and Notification Center. Payloads may be a JSON file, inline JSON, or stdin with -.',
330
+ order: 65.7,
331
+ usage: ['peach push <bundle-id> <payload.json|inline-json|-> [options]'],
332
+ options: [
333
+ option('--json', 'emit the delivery receipt as JSON'),
334
+ option('--sim <id>', 'target a specific connected sim'),
335
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
336
+ ],
337
+ examples: [example('peach push com.example.app notification.apns')],
338
+ related: ['permissions', 'shell'],
339
+ },
340
+ {
341
+ id: 'defaults',
342
+ slug: 'defaults',
343
+ navTitle: 'defaults',
344
+ title: 'peach defaults',
345
+ description: 'write an app-group UserDefaults value into the running app',
346
+ summary:
347
+ 'Write one value into an app-group UserDefaults suite, as an app extension sharing the group would. Pair it with peach open <url> to hand the app the URL a share extension opens. A value is a string, a JSON array of strings, or text stored as Data.',
348
+ order: 65.8,
349
+ usage: [
350
+ 'peach defaults write <suite> <key> (--string <text> | --strings <json-array> | --data <text>) [options]',
351
+ ],
352
+ options: [
353
+ option('--string <text>', 'store the value as a string'),
354
+ option('--strings <json-array>', 'store the value as an array of strings'),
355
+ option('--data <text>', 'store the UTF-8 bytes of the text as Data'),
356
+ option('--sim <id>', 'target a specific connected sim'),
357
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
358
+ ],
359
+ examples: [
360
+ example(
361
+ 'peach defaults write group.com.example.app ShareKey --data \'{"text":"hi"}\'',
362
+ 'what a share extension saves before it opens the app',
363
+ ),
364
+ ],
365
+ related: ['open', 'push'],
366
+ },
367
+ {
368
+ id: 'state',
369
+ slug: 'state',
370
+ navTitle: 'state',
371
+ title: 'peach state',
372
+ description: 'capture the current app state in one call',
373
+ summary:
374
+ 'Captures the semantic tree and a screenshot of the current app in one bridge call, the first call of a debugging pass. `peach get state` answers what the sim is doing right now; `peach debug state <kind>` dumps raw runtime state for one subsystem.',
375
+ order: 65.7,
376
+ usage: ['peach state [--json] [--sim <id>]'],
377
+ options: [
378
+ option('--json', 'print the complete structured result, including the screenshot'),
379
+ option('--sim <sim>', 'target a specific connected sim'),
380
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
381
+ ],
382
+ examples: [example('peach state'), example('peach state --json')],
383
+ related: ['get', 'debug', 'screenshot'],
384
+ },
385
+ {
386
+ id: 'reset',
387
+ slug: 'reset',
388
+ navTitle: 'reset',
389
+ title: 'peach reset',
390
+ description: 'clear the current guest app and relaunch it',
391
+ summary:
392
+ 'Clears the current guest app data and relaunches it. `--full` also clears keychain, user defaults, and permissions.',
393
+ order: 65.8,
394
+ usage: ['peach reset [--full] [--json] [--sim <id>]'],
395
+ options: [
396
+ option('--full', 'also clear keychain, user defaults, and permissions'),
397
+ option('--json', 'print the structured reset result'),
398
+ option('--sim <sim>', 'target a specific connected sim'),
399
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
400
+ ],
401
+ examples: [example('peach reset'), example('peach reset --full --json')],
402
+ related: ['storage', 'permissions', 'shell'],
403
+ },
404
+ {
405
+ id: 'camera',
406
+ slug: 'camera',
407
+ navTitle: 'camera',
408
+ title: 'peach camera',
409
+ description: 'control the simulator camera source',
410
+ summary:
411
+ 'Replaces the live camera with a local video fixture (m4v, mov, mp4 or webm) that runs through the same frame pump and barcode detection as a device camera, or restores the live source. `peach do scan` injects a synthetic barcode result when there is no media.',
412
+ order: 65.9,
413
+ usage: [
414
+ 'peach camera play <file> [--loop] [--rate <number>]',
415
+ 'peach camera stop',
416
+ 'peach camera status [--json]',
417
+ ],
418
+ options: [
419
+ option('--loop', 'loop fixture playback'),
420
+ option('--rate <n>', 'fixture playback rate (default: 1)'),
421
+ option('--json', 'print status or result as JSON'),
422
+ option('--sim <sim>', 'target a specific connected sim'),
423
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
424
+ ],
425
+ examples: [
426
+ example('peach camera play ./fixtures/qr.mp4 --loop'),
427
+ example('peach camera status'),
428
+ example('peach camera stop'),
429
+ ],
430
+ related: ['permissions', 'location'],
431
+ },
432
+ {
433
+ id: 'perf',
434
+ slug: 'perf',
435
+ navTitle: 'perf',
436
+ title: 'peach perf',
437
+ description: 'CPU, React render, shell frame, and scroll-layer profiling',
438
+ summary:
439
+ 'One profiling group for sampled JS CPU profiles, React render-cost tables, shell and compositor frame timing, and timestamp-aligned scroll offsets from the tenant, shell, and compositor workers.',
440
+ order: 66,
441
+ usage: [
442
+ 'peach perf cpu [options]',
443
+ 'peach perf react <profile|summary|slow|rerenders|tree|why> [options]',
444
+ 'peach perf shell <start|stop|transition> [options]',
445
+ 'peach perf scroll <start|stop> [options]',
446
+ ],
447
+ options: [
448
+ option(
449
+ '--host',
450
+ "for `perf cpu`: profile the desktop app's realms through its host, no Chrome",
451
+ ),
452
+ option(
453
+ '--cdp-port <port>',
454
+ 'for `perf cpu`: Chrome DevTools port (default: $PEACH_CDP_PORT or 9222)',
455
+ ),
456
+ option('--duration <seconds>', 'for `perf cpu`: recording duration (default: 5)'),
457
+ option(
458
+ '--match <substring>',
459
+ 'for `perf cpu`: pick the page target by URL substring',
460
+ ),
461
+ option('--output <path>', 'for `perf cpu`: output .cpuprofile path'),
462
+ option(
463
+ '--include-props',
464
+ 'for `perf react profile start`: record shallow prop previews',
465
+ ),
466
+ option(
467
+ '--limit <n>',
468
+ 'for `perf react`: rows; for `perf scroll`: samples per layer',
469
+ ),
470
+ option('--json', 'structured output where supported'),
471
+ option('--sim <sim>', 'target a specific connected sim'),
472
+ ],
473
+ examples: [
474
+ example('peach open 8089 --new --driver playwright --cdp-port 9222'),
475
+ example('peach perf cpu --cdp-port 9222 --duration 5'),
476
+ example('peach perf cpu --host --duration 8'),
477
+ example('peach perf react profile start'),
478
+ example('peach perf react summary --limit 10'),
479
+ example('peach perf shell start'),
480
+ example('peach perf shell stop --json'),
481
+ example('peach perf scroll start'),
482
+ example('peach perf scroll stop --json'),
483
+ ],
484
+ related: ['open', 'record', 'test', 'debug'],
485
+ },
486
+ {
487
+ id: 'screenshot',
488
+ slug: 'screenshot',
489
+ navTitle: 'screenshot',
490
+ title: 'peach screenshot',
491
+ description: 'capture PNGs and manage App Store screenshot assets',
492
+ summary:
493
+ 'Capture the current canvas as a PNG, drive the live App Store slide composer, or run the plan-based capture pipeline. Bare `peach screenshot` is the same as `peach screenshot capture`. The separate `appstore capture --org --repo` helper requires the Peach source workspace and is unavailable in the standalone CLI.',
494
+ order: 70,
495
+ usage: [
496
+ 'peach screenshot [capture] [output] [options]',
497
+ 'peach screenshot layers --ids <testID,testID,...> [--out-dir <dir>]',
498
+ 'peach screenshot slides <list|set|add|remove|focus|overview|capture|export> [args]',
499
+ 'peach screenshot appstore --plan <plan.yaml> [options]',
500
+ 'peach screenshot appstore capture --org <org> --repo <repo> [options]',
501
+ ],
502
+ options: [
503
+ option(
504
+ '--output <path>',
505
+ 'for capture: output PNG path (default: /tmp/peach-inspect.png). aliases: -o, --out, --file, --path',
506
+ ),
507
+ option(
508
+ '--area <x,y,w,h>',
509
+ 'for capture: crop to a logical peach rect. aliases: --rect, --crop',
510
+ ),
511
+ option(
512
+ '--id <testID>',
513
+ 'for capture: crop to the bounding box of a node by testID. alias: --testid',
514
+ ),
515
+ option(
516
+ '--text <text>',
517
+ 'for capture: crop to the bounding box of a node by text content',
518
+ ),
519
+ option('--no-shell', 'for capture/flows: exclude simulated iOS chrome'),
520
+ option('--shell-only', 'for capture/flows: capture only shell chrome'),
521
+ option('--plan <path>', 'for appstore: screenshot plan yaml'),
522
+ option('--org <org>', 'for appstore capture: github org slug'),
523
+ option('--repo <repo>', 'for appstore capture: repo name'),
524
+ option('--compose-only', 'for appstore: skip flow capture and reuse existing raws'),
525
+ option('--capture-only', 'for appstore: stop after raw/framed intermediates'),
526
+ option(
527
+ '--ids <list>',
528
+ 'for layers: comma-separated testIDs of the subtrees to isolate',
529
+ ),
530
+ option(
531
+ '--out-dir <dir>',
532
+ 'for layers: output directory (default: /tmp/peach-layers)',
533
+ ),
534
+ ],
535
+ examples: [
536
+ example('peach screenshot', 'capture the current sim to a PNG'),
537
+ example('peach screenshot --output app.png'),
538
+ example('peach screenshot capture --no-shell --output tenant-only.png'),
539
+ example('peach screenshot --area 0,200,393,400'),
540
+ example('peach screenshot slides', 'list the current live deck'),
541
+ example('peach screenshot slides capture 1'),
542
+ example('peach screenshot slides export --out ./exports'),
543
+ example('peach screenshot appstore --plan .peach/app-store.yaml'),
544
+ example(
545
+ 'peach screenshot appstore --plan .peach/app-store.yaml --compose-only',
546
+ 'rerender marketing canvases from existing raw PNGs',
547
+ ),
548
+ example(
549
+ 'peach screenshot appstore capture --org acme --repo my-app --dry-run',
550
+ 'headlessly capture editable org-deck slides without uploading',
551
+ ),
552
+ ],
553
+ related: ['mode', 'record', 'test'],
554
+ },
555
+ {
556
+ id: 'mode',
557
+ slug: 'mode',
558
+ navTitle: 'mode',
559
+ title: 'peach mode',
560
+ description:
561
+ 'toggle screenshot, touch indicators, the agent indicator, and 3D display modes',
562
+ summary:
563
+ 'Toggle live shell display modes using the same plugin-owned action paths as the rail and menus. `mode screenshot` hides browser chrome for clean captures; `mode show-touches` renders authentic OS touch indicators over the app; `mode agent-indicator off` hides the connected agent indicator so scripted recordings film clean devices; `mode three` toggles and configures the live 3D device stage.',
564
+ order: 73,
565
+ usage: [
566
+ 'peach mode screenshot [on|off|toggle]',
567
+ 'peach mode show-touches [on|off|toggle]',
568
+ 'peach mode agent-indicator [on|off|toggle]',
569
+ 'peach mode three [on|off|toggle]',
570
+ 'peach mode three configure [flags]',
571
+ 'peach mode three load <timeline.json>',
572
+ 'peach mode three seek <time-ms>',
573
+ 'peach mode three play|pause',
574
+ 'peach mode three render <timeline.json> --output <dir> [flags]',
575
+ ],
576
+ options: [
577
+ option('(no argument)', 'report the current state without changing it'),
578
+ option('screenshot on|off|toggle', 'toggle screenshot-mode chrome overlay'),
579
+ option(
580
+ 'show-touches on|off|toggle',
581
+ 'toggle OS touch indicators (Show Single Touches / Show taps)',
582
+ ),
583
+ option(
584
+ 'agent-indicator on|off|toggle',
585
+ 'show or hide the connected agent indicator while a CLI or agent drives the sim',
586
+ ),
587
+ option('three on|off|toggle', 'toggle the live 3D device stage'),
588
+ option('--background <id>', 'set the 3d background'),
589
+ option(
590
+ '--gradient <stops>',
591
+ 'custom gradient bg: comma-separated css hex stops (overrides --background)',
592
+ ),
593
+ option(
594
+ '--gradient-angle <deg>',
595
+ 'custom gradient angle (default 180 = top→bottom)',
596
+ ),
597
+ option('--colorway <id>', 'set the phone colorway'),
598
+ option('--script <id>', 'apply a camera preset pose'),
599
+ option('--progress <0..1>', 'script progress to sample (default: 1)'),
600
+ option('--animate', 'run the script instead of sampling one frame'),
601
+ option('--slow', 'run the script slowly when --animate is set'),
602
+ option('--environment <on|off>', 'enable or disable environment objects'),
603
+ option('--env-shape <id>', 'orb | pill | diamond | pane'),
604
+ option('--env-spread <id>', 'tight | medium | wide'),
605
+ option('--env-size <id>', 'small | medium | large'),
606
+ option('--env-color <id>', 'peach | gold | mint | sky | violet'),
607
+ option('--env-glow <on|off>', 'enable or disable environment glow'),
608
+ option('--env-plastic <on|off>', 'enable or disable environment plastic material'),
609
+ option(
610
+ '--setting <id>',
611
+ 'none | room | window-wall | white-backdrop | cyclorama | terrain',
612
+ ),
613
+ option('--focus <on|off>', 'enable or disable Focus depth of field'),
614
+ option('--focus-amount <id>', 'subtle | medium | strong | dramatic'),
615
+ option('--focus-range <id>', 'tight | balanced | wide'),
616
+ option('--reset-pose', 'return to the default hero pose before other changes'),
617
+ option('--output <dir>', 'for render: frame-%05d.png sequence output directory'),
618
+ option('--fps <number>', 'for render: exact frame rate (default 30)'),
619
+ option('--width <px>', 'for render: exact frame width (default 1920)'),
620
+ option('--height <px>', 'for render: exact frame height (default 1080)'),
621
+ option('--from <ms>', 'for render: first timeline time (default 0)'),
622
+ option('--to <ms>', 'for render: exclusive timeline end time'),
623
+ option('--overwrite', 'for render: replace existing timeline frames in output'),
624
+ ],
625
+ examples: [
626
+ example('peach mode screenshot on', 'hide browser chrome around the canvas'),
627
+ example('peach mode screenshot off'),
628
+ example('peach mode show-touches on', 'enable authentic OS touch indicators'),
629
+ example('peach mode show-touches off'),
630
+ example('peach mode three on', 'force 3d mode on'),
631
+ example(
632
+ 'peach mode three configure --colorway sky --background gradient-sunset',
633
+ 'set the phone and background to specific options',
634
+ ),
635
+ example(
636
+ 'peach mode three configure --setting room --gradient "#0a1822,#0d2233,#06101a"',
637
+ 'physical room setting + a custom brand-color gradient background',
638
+ ),
639
+ example(
640
+ 'peach mode three configure --focus on --focus-amount strong --focus-range tight',
641
+ 'enable a strong Focus with a tight sharp band',
642
+ ),
643
+ example(
644
+ 'peach mode three configure --script hero-pan --animate --slow',
645
+ 'play a camera script slowly',
646
+ ),
647
+ example('peach mode three configure --reset-pose', 'return to the default pose'),
648
+ example(
649
+ 'peach mode three render ./cinematic.json --output ./frames --fps 30',
650
+ 'render deterministic transparent RGBA PNG frames',
651
+ ),
652
+ ],
653
+ related: ['screenshot'],
654
+ },
655
+ {
656
+ id: 'describe',
657
+ slug: 'describe',
658
+ navTitle: 'describe',
659
+ title: 'peach describe',
660
+ description: 'curated human-readable UI summary (default inspection tool)',
661
+ summary:
662
+ 'The default way to see what is on screen. Lists visible UI elements with type, text, position, size, and style: buttons show [button], tappable views show [tap], inputs show [input]. Structural noise (icon wrappers, layout containers, duplicate text inside buttons) is pruned by the semantic inspection tree. Use --json to script against it. Reach for describe before screenshots or DOM poking.',
663
+ order: 68,
664
+ usage: [
665
+ 'peach describe [filter] [--verbose] [--watch] [--json] [--compact] [--no-xy] [--only <glob>] [--subtree <id>] [--testid-like <pat>]',
666
+ ],
667
+ options: [
668
+ option('--verbose', 'include ids, labels, and extra style info'),
669
+ option('--watch', 'redraw as the UI changes (ctrl-c to stop)'),
670
+ option(
671
+ '--json',
672
+ 'emit structured JSON. rows keep their full text and labels: the terminal dump clips a long string to keep a row on one line, and a machine reader cannot undo that, so a red-box message or a bundle-eval stack comes back whole here',
673
+ ),
674
+ option('--compact', 'render the tree in a tighter format'),
675
+ option('--no-xy', 'hide x,y coordinates from each row'),
676
+ option('--only <glob>', 'glob filter across text/role/testID'),
677
+ option('--subtree <id>', 'limit the dump to a subtree rooted at the given testID'),
678
+ option(
679
+ '--testid-like <pattern>',
680
+ 'fuzzy-match nodes whose testID contains the pattern',
681
+ ),
682
+ ],
683
+ examples: [
684
+ example('peach describe'),
685
+ example('peach describe button'),
686
+ example('peach describe --verbose'),
687
+ example('peach describe --json'),
688
+ example('peach describe --watch'),
689
+ example('peach describe --subtree feedListRoot', 'limit to one subtree'),
690
+ example('peach describe --only "*Header*"', 'glob-match across text/role/testID'),
691
+ ],
692
+ related: ['find', 'get', 'do'],
693
+ },
694
+ {
695
+ id: 'find',
696
+ slug: 'find',
697
+ navTitle: 'find',
698
+ title: 'peach find',
699
+ description: 'locate nodes by text / testID / role / type / predicate',
700
+ summary:
701
+ 'The unified finder. A bare argument matches node text (findByText); flag forms match by testID, role, component type, or predicate. --pressable and --visible list every tappable or visible node, and --interactive-targets (alias --actions) ranks visible+pressable nodes and prints a ready-to-run `peach do tap-...` command per row, so the next tap is one copy away. Use --verbose for full node JSON and --json to script.',
702
+ order: 68.5,
703
+ usage: [
704
+ 'peach find <text>',
705
+ 'peach find --testid <id>',
706
+ 'peach find --role <role>',
707
+ 'peach find --type <component-type>',
708
+ 'peach find --pressable',
709
+ 'peach find --visible',
710
+ 'peach find --interactive-targets',
711
+ ],
712
+ options: [
713
+ option('--text <text>', 'match node text content (same as bare positional)'),
714
+ option('--testid <id>', 'match node testID or id exactly'),
715
+ option('--role <role>', 'match accessibilityRole'),
716
+ option(
717
+ '--type <type>',
718
+ 'match engine node type (view, text, ...), not a React component name',
719
+ ),
720
+ option(
721
+ '--pressable',
722
+ 'list all tappable nodes. an empty result is not proof a screen has no affordance: it lists registered touch responders, and a styled() view whose onPress comes from the call site is tappable without appearing here',
723
+ ),
724
+ option('--visible', 'list all visible (non-zero) nodes'),
725
+ option(
726
+ '--interactive-targets, --actions',
727
+ 'ranked tappable nodes, each with a ready-to-run tap command',
728
+ ),
729
+ option('--verbose, --dump', 'emit full node JSON for each result'),
730
+ option('--json', 'emit structured JSON'),
731
+ ],
732
+ examples: [
733
+ example('peach find "Sign in"'),
734
+ example('peach find --testid loginButton'),
735
+ example('peach find --role button'),
736
+ example('peach find --pressable'),
737
+ example('peach find --visible --json'),
738
+ example(
739
+ 'peach find --interactive-targets',
740
+ 'ranked visible+pressable nodes with copy-paste tap commands',
741
+ ),
742
+ ],
743
+ related: ['describe', 'get', 'do'],
744
+ },
745
+ {
746
+ id: 'assert',
747
+ slug: 'assert',
748
+ navTitle: 'assert',
749
+ title: 'peach assert',
750
+ description: 'run any read verb and convert its output into an exit code',
751
+ summary:
752
+ 'Thin wrapper that spawns a read verb (describe, find, get errors, …) with --json forced on, parses stdout, and evaluates assertion flags over the payload. Exit codes are bisect-friendly: 0 pass, 1 fail, 125 skip (app not loaded / verb crashed), 2 misuse. Flag-level composition (--count / --contains / --jq / --has-path / --within) means the same predicate surface works across every read verb.',
753
+ order: 69,
754
+ usage: ['peach assert <verb> <verb-args...> <assertion-flags...>'],
755
+ options: [
756
+ option('--count <n>', 'result array has exactly n items'),
757
+ option('--count-at-least <n>', 'length >= n'),
758
+ option('--count-at-most <n>', 'length <= n'),
759
+ option('--exists', 'non-null, non-empty (default when no flag given)'),
760
+ option('--empty', 'null or zero length'),
761
+ option('--contains <str>', 'stringified result contains str (repeatable)'),
762
+ option('--not-contains <str>', 'stringified result does not contain str'),
763
+ option('--matches <regex>', 'stringified result matches regex'),
764
+ option('--not-matches <regex>', 'stringified result does not match regex'),
765
+ option('--equals <literal>', 'scalar equality'),
766
+ option('--has-path <dotted.path>', 'nested path exists'),
767
+ option('--path-equals <path> <value>', 'nested path equals value'),
768
+ option('--jq <expr>', 'jq expression is truthy (requires jq on PATH)'),
769
+ option('--within <ms>', 'retry verb + predicates until pass or deadline'),
770
+ option('--allow-timeout', 'treat verb auto-wait timeout as fail, not skip'),
771
+ option('--negate, !', 'flip pass/fail (does not flip skip)'),
772
+ option('--quiet', 'suppress the one-line pass/fail summary'),
773
+ ],
774
+ examples: [
775
+ example(
776
+ 'peach assert find --testid set-max-input --count 4',
777
+ 'exactly four matching nodes',
778
+ ),
779
+ example(
780
+ 'peach assert describe --contains swap-form-header',
781
+ 'substring anywhere in the tree dump',
782
+ ),
783
+ example(
784
+ 'peach assert get errors --count 0',
785
+ 'fail the commit if any console error',
786
+ ),
787
+ example(
788
+ 'peach assert find --testid submit --exists --within 3000',
789
+ 'poll for 3s before failing',
790
+ ),
791
+ example(
792
+ `peach assert describe --jq '.shell.state == "app"'`,
793
+ 'jq predicate over the payload',
794
+ ),
795
+ example(
796
+ 'git bisect run peach assert find --testid set-max-input --count 4',
797
+ 'git-bisect integration',
798
+ ),
799
+ ],
800
+ related: ['find', 'describe', 'get', 'list'],
801
+ },
802
+ {
803
+ id: 'get',
804
+ slug: 'get',
805
+ navTitle: 'get',
806
+ title: 'peach get',
807
+ description: 'read runtime state (tree, a11y, layout, url, count, errors, …)',
808
+ summary:
809
+ 'Grouping verb for pure reads. `peach get <noun>` covers the read side of the bridge: tree, a11y, layout (including native rendered text contrast with `--styling`), url, count, console errors/warnings/requests, globals, and single-node lookups.',
810
+ order: 70,
811
+ usage: ['peach get <noun> [args]'],
812
+ examples: [
813
+ example('peach get tree'),
814
+ example('peach get a11y 3'),
815
+ example('peach get layout --styling'),
816
+ example('peach get url'),
817
+ example('peach get count'),
818
+ example('peach get errors 5'),
819
+ example('peach get requests 5'),
820
+ example('peach get node loginButton'),
821
+ example('peach get layout loginButton'),
822
+ example('peach get globals'),
823
+ ],
824
+ options: [REDACT_OPTION],
825
+ related: ['do', 'find', 'describe'],
826
+ },
827
+ {
828
+ id: 'do',
829
+ slug: 'do',
830
+ navTitle: 'do',
831
+ title: 'peach do',
832
+ description: 'drive the app (tap, type, scroll, swipe, key, reload, …)',
833
+ summary:
834
+ 'Grouping verb for user-interaction actions. `peach do <action>` covers the write side of the bridge: taps, typing, key presses, touch/scroll/drag/swipe/pinch gestures, reload, and local timing helpers. Repeat `--then` before each additional batchable action to run one ordered engine batch.',
835
+ order: 71,
836
+ usage: [
837
+ 'peach do <action> [args]',
838
+ 'peach do <action> [args] [--then <action> [args] ...]',
839
+ ],
840
+ examples: [
841
+ example(
842
+ 'peach do tap email --then type user@example.com --then tap submit',
843
+ 'run three existing do actions as one batch',
844
+ ),
845
+ example('peach do tap 196 727'),
846
+ example('peach do double-tap 196 400'),
847
+ example('peach do tap-text "Sign in"'),
848
+ example('peach do tap loginNextButton'),
849
+ example('peach do type "natew.bsky.social"'),
850
+ example('peach do type-into email "me@example.com"'),
851
+ example('peach do key return'),
852
+ example('peach do key-sequence shift h i'),
853
+ example('peach do dismiss'),
854
+ example('peach do scroll feed 0 400'),
855
+ example('peach do drag 200 720 200 160'),
856
+ example('peach do swipe 200 720 200 160'),
857
+ example('peach do gesture swipe-from-bottom-edge'),
858
+ example('peach do reload'),
859
+ ],
860
+ options: [
861
+ option('--then <action>', 'append an action to the same ordered engine batch'),
862
+ option('--json', 'for an inline chain, print every engine-step result'),
863
+ option('--no-wait', 'for an inline chain, skip the final auto-settle'),
864
+ ],
865
+ related: ['shell', 'get', 'find', 'describe', 'wait'],
866
+ },
867
+ {
868
+ id: 'wait',
869
+ slug: 'wait',
870
+ navTitle: 'wait',
871
+ title: 'peach wait',
872
+ description: 'block until the runtime reaches a known state',
873
+ summary:
874
+ 'Grouping verb for explicit synchronization. Use instead of guessing with `sleep`. Every subverb has a bounded timeout and exits non-zero when it times out, so automations fail loudly rather than silently racing animations or missing nodes.',
875
+ order: 72,
876
+ usage: ['peach wait <kind> [args]'],
877
+ examples: [
878
+ example('peach wait ready', 'block until the app bundle is loaded and painted'),
879
+ example('peach wait idle', 'block until animations + rAF queue are settled'),
880
+ example(
881
+ 'peach wait selector loginButton',
882
+ 'block until a node with this testID is present',
883
+ ),
884
+ example(
885
+ 'peach wait selector feedList --max-ms 3000',
886
+ 'cap how long to wait for a node',
887
+ ),
888
+ ],
889
+ related: ['do', 'find', 'describe', 'get'],
890
+ },
891
+ {
892
+ id: 'shell',
893
+ slug: 'shell',
894
+ navTitle: 'shell',
895
+ title: 'peach shell',
896
+ description: 'drive shell state and simulator chrome',
897
+ summary:
898
+ 'Top-level shell controls for app launch, home/switcher transitions, simulator-owned chrome such as appearance and lock state, and native desktop simulator window frame and scale mode.',
899
+ order: 72,
900
+ usage: [
901
+ 'peach shell launch <appId> [waitMs] [--clear-state]',
902
+ 'peach shell home [waitMs]',
903
+ 'peach shell switcher [waitMs]',
904
+ 'peach shell open-card <appId> [waitMs]',
905
+ 'peach shell appearance <light|dark|auto|toggle>',
906
+ 'peach shell window [get | <x> <y> [width] [height] | scale <physical|point|pixel|fit>] [--scale <mode>] [--animate | --duration <ms>] [--linear] [--sim <id>] [--json]',
907
+ 'peach shell lock',
908
+ 'peach shell shake',
909
+ ],
910
+ examples: [
911
+ example('peach shell launch photos'),
912
+ example('peach shell home'),
913
+ example('peach shell switcher 800'),
914
+ example('peach shell appearance dark'),
915
+ example('peach shell window 120 140 430 880 --sim a1'),
916
+ example('peach shell window 480 220 520 960 --animate --duration 600 --sim a1'),
917
+ example('peach shell window scale point --sim a1'),
918
+ example('peach shell lock'),
919
+ ],
920
+ related: ['do', 'debug'],
921
+ },
922
+ {
923
+ id: 'network',
924
+ slug: 'network',
925
+ navTitle: 'network',
926
+ title: 'peach network',
927
+ description: 'inspect live network traffic from the running peach worker',
928
+ summary:
929
+ 'Read the shared observability store (fetch + XHR captured in the render worker) from the terminal. List recent requests, tail in real time, filter by URL or status, inspect one entry in detail, or clear the buffer. Shares its data source with the in-shell devtools dock so both views stay in lock-step.',
930
+ order: 85,
931
+ usage: [
932
+ 'peach network [limit]',
933
+ 'peach network --failed',
934
+ 'peach network --slow [--threshold <ms>]',
935
+ 'peach network --filter <substring>',
936
+ 'peach network --tail',
937
+ 'peach network get <id>',
938
+ 'peach network clear',
939
+ ],
940
+ options: [
941
+ REDACT_OPTION,
942
+ option('--failed', 'only show errored or non-2xx responses'),
943
+ option(
944
+ '--slow',
945
+ 'only show requests slower than --threshold (default 1000ms), sorted by duration desc',
946
+ ),
947
+ option(
948
+ '--threshold <ms>',
949
+ 'slow threshold in milliseconds for --slow (default 1000)',
950
+ ),
951
+ option('--filter <substring>', 'URL substring filter (case-insensitive)'),
952
+ option('--limit <n>', 'max entries to print (default 20)'),
953
+ option('--tail, -f', 'follow mode: stream new entries as they land'),
954
+ option('--json', 'emit structured JSON instead of formatted rows'),
955
+ option('--sim <sim>', 'target a specific connected sim'),
956
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
957
+ ],
958
+ examples: [
959
+ example('peach network', 'list the last 20 requests'),
960
+ example('peach network 100', 'list the last 100'),
961
+ example('peach network --failed', 'only errors and 4xx/5xx'),
962
+ example(
963
+ 'peach network --slow',
964
+ 'requests slower than 1000ms, sorted by duration desc',
965
+ ),
966
+ example(
967
+ 'peach network --slow --threshold 200',
968
+ 'tighten the slow threshold to 200ms',
969
+ ),
970
+ example('peach network --filter api.example.com'),
971
+ example('peach network --tail', 'live follow mode, ctrl-c to stop'),
972
+ example('peach network --tail --failed'),
973
+ example('peach network get req-42-l7k9'),
974
+ example('peach network clear'),
975
+ ],
976
+ related: ['debug', 'get', 'logs'],
977
+ },
978
+ {
979
+ id: 'logs',
980
+ slug: 'logs',
981
+ navTitle: 'logs',
982
+ title: 'peach logs',
983
+ description: 'inspect live console output from the running peach worker',
984
+ summary:
985
+ 'Read the shared observability log store (console.log/info/warn/error/debug plus uncaught errors and unhandled rejections, captured in the render worker) from the terminal. List recent logs, tail in real time, filter by level or substring, or clear the buffer. Shares its data source with the devtools dock so both views stay in lock-step.',
986
+ order: 86,
987
+ usage: [
988
+ 'peach logs [limit]',
989
+ 'peach logs --level <csv>',
990
+ 'peach logs --filter <substring>',
991
+ 'peach logs --tail',
992
+ 'peach logs clear',
993
+ ],
994
+ options: [
995
+ REDACT_OPTION,
996
+ option('--level <csv>', 'comma-separated level filter (log,info,warn,error,debug)'),
997
+ option('--filter <substring>', 'message substring filter (case-insensitive)'),
998
+ option('--limit <n>', 'max entries to print (default 50)'),
999
+ option('--tail, -f', 'follow mode: stream new log entries as they land'),
1000
+ option('--json', 'emit structured JSON instead of formatted rows'),
1001
+ option(
1002
+ '--internal, --all',
1003
+ 'include engine-internal logs (bundle loader, HMR traps, etc.), hidden by default so guest-app output stays readable',
1004
+ ),
1005
+ option('--sim <sim>', 'target a specific connected sim'),
1006
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1007
+ ],
1008
+ examples: [
1009
+ example('peach logs', 'last 50 log entries'),
1010
+ example('peach logs 200', 'last 200'),
1011
+ example('peach logs --level error,warn'),
1012
+ example('peach logs --filter "hydrate"'),
1013
+ example('peach logs --tail', 'live follow mode, ctrl-c to stop'),
1014
+ example('peach logs --tail --level error'),
1015
+ example('peach logs --internal', 'include engine-internal logs'),
1016
+ example('peach logs clear'),
1017
+ ],
1018
+ related: ['network', 'get'],
1019
+ },
1020
+ {
1021
+ id: 'debug',
1022
+ slug: 'debug',
1023
+ navTitle: 'debug',
1024
+ title: 'peach debug',
1025
+ description: 'drive __sootsimDebug: channels, snapshots, and inspectors',
1026
+ summary:
1027
+ 'Toggle engine debug channels, capture snapshots, and diff internal state from the terminal while targeting any connected sim.',
1028
+ order: 90,
1029
+ usage: ['peach debug <subcommand> [args]'],
1030
+ options: [
1031
+ option('--sim <sim>', 'target a specific connected sim'),
1032
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1033
+ option('--json', 'emit compact JSON for machine consumption'),
1034
+ option('--pretty', 'emit formatted JSON for human inspection'),
1035
+ ],
1036
+ examples: [
1037
+ example('peach debug enable sheets,portals'),
1038
+ example('peach debug snapshot before'),
1039
+ example('peach debug diff before after'),
1040
+ example('peach debug recent portals 20'),
1041
+ ],
1042
+ related: ['open', 'what-happened'],
1043
+ },
1044
+ {
1045
+ id: 'what-happened',
1046
+ slug: 'what-happened',
1047
+ navTitle: 'what-happened',
1048
+ title: 'peach what-happened',
1049
+ description:
1050
+ 'show recent semantic events: toasts, keyboards, screens, alerts, fetches, errors',
1051
+ summary:
1052
+ "Read the unified semantic timeline across host, shell worker, and tenant worker. Defaults to events since the previous CLI call (per-agent cursor), so 'what-happened' reliably shows what's new instead of replaying state you already saw. Catches ephemeral UI like toasts that disappear before describe/find can find them.",
1053
+ order: 91,
1054
+ usage: [
1055
+ 'peach what-happened',
1056
+ 'peach what-happened --summary',
1057
+ 'peach what-happened --since 5s --kinds toast,fetch',
1058
+ ],
1059
+ options: [
1060
+ REDACT_OPTION,
1061
+ option('--summary', 'one-line counts by kind, no event list'),
1062
+ option(
1063
+ '--flow',
1064
+ 'section the event stream by screen/route boundaries (demo-friendly recap)',
1065
+ ),
1066
+ option('--all', 'full ring (ignore the per-identity cursor)'),
1067
+ option('--since <duration>', 'absolute window; accepts e.g. 5s, 500ms, 2m'),
1068
+ option(
1069
+ '--kinds <csv>',
1070
+ 'filter to specific kinds: toast, keyboard, screen, alert, fetch, console, ...',
1071
+ ),
1072
+ option('--limit <n>', 'cap returned events (default 200)'),
1073
+ option('--json', 'emit structured JSON'),
1074
+ option('--no-advance', 'do not advance the read cursor after rendering'),
1075
+ option(
1076
+ '--noisy',
1077
+ 'include react-commit, layout, and scroll events (suppressed by default so taps/fetches/screen transitions are not buried)',
1078
+ ),
1079
+ option('--sim <sim>', 'target a specific connected sim'),
1080
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1081
+ ],
1082
+ examples: [
1083
+ example('peach what-happened', 'since the previous CLI call'),
1084
+ example('peach what-happened --summary', '5 errors · 2 warnings · 1 toast'),
1085
+ example(
1086
+ 'peach what-happened --kinds toast,fetch --since 10s',
1087
+ 'trace a toast back to its trigger',
1088
+ ),
1089
+ example(
1090
+ 'peach what-happened --flow --since 5m',
1091
+ 'section the last 5 minutes by screen/route, a demo-friendly recap',
1092
+ ),
1093
+ example('peach what-happened --all --json', 'dump full ring as JSON'),
1094
+ ],
1095
+ related: ['timeline', 'debug', 'logs', 'network'],
1096
+ },
1097
+ {
1098
+ id: 'timeline',
1099
+ slug: 'timeline',
1100
+ navTitle: 'timeline',
1101
+ title: 'peach timeline',
1102
+ description: 'control the semantic event timeline (enable opt-in kinds, clear, dump)',
1103
+ summary:
1104
+ 'Distinct from `peach record` (video) and `peach debug record` (engine channels): manages the semantic agent-facing event stream that backs `peach what-happened`. Cheap kinds record at all times; opt-in kinds (scroll, gesture, text-input, reanimated, animation) need to be enabled.',
1105
+ order: 92,
1106
+ usage: ['peach timeline <subcommand> [args]'],
1107
+ options: [
1108
+ option('--sim <sim>', 'target a specific connected sim'),
1109
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1110
+ option('--json', 'emit compact JSON for machine consumption'),
1111
+ ],
1112
+ examples: [
1113
+ example('peach timeline status'),
1114
+ example('peach timeline start scroll,gesture', 'enable opt-in kinds'),
1115
+ example('peach timeline stop all', 'silence everything'),
1116
+ example('peach timeline dump /tmp/events.json'),
1117
+ ],
1118
+ related: ['what-happened', 'debug', 'record'],
1119
+ },
1120
+ {
1121
+ id: 'ios',
1122
+ slug: 'ios',
1123
+ navTitle: 'ios',
1124
+ title: 'peach ios',
1125
+ description: 'start an iOS simulator',
1126
+ summary:
1127
+ 'Start a simulator on iOS. The platform picks the device: your current device is kept when it is already an iOS model, otherwise the default iOS device is used. Use --remote with your app folder, or a prebuilt bundle, to run it on the production service and open its viewer.',
1128
+ order: 98,
1129
+ usage: [
1130
+ 'peach ios [target] [--device <model>]',
1131
+ 'peach ios --remote <app-dir|bundle-path|https-url> [--device <model>]',
1132
+ 'peach ios --remote <metro-bundle-url> --watch',
1133
+ ],
1134
+ options: [
1135
+ option('--stream', 'stream this local simulator to your team until Ctrl+C'),
1136
+ option(
1137
+ '--watch',
1138
+ 'keep a remote simulator connected to your Metro server until Ctrl+C',
1139
+ ),
1140
+ option(
1141
+ '--device <model>',
1142
+ 'pick a specific iOS device model. an Android model here is refused by name rather than silently overriding the platform',
1143
+ ),
1144
+ option(
1145
+ '--remote',
1146
+ 'build the app folder, or take the bundle, and run it on a remote simulator with its viewer open',
1147
+ ),
1148
+ ],
1149
+ examples: [
1150
+ example(
1151
+ 'peach ios',
1152
+ 'start an iOS simulator on your current or default iOS device',
1153
+ ),
1154
+ example('peach ios --device iphone-16', 'start on a specific iOS device'),
1155
+ example(
1156
+ 'peach ios --remote .',
1157
+ 'build the app in this folder, with its native modules, and run it remotely',
1158
+ ),
1159
+ example(
1160
+ 'peach ios --remote ./dist/main.js',
1161
+ 'run a local bundle remotely, finding and embedding its assets for you',
1162
+ ),
1163
+ example(
1164
+ 'peach ios --remote https://cdn.example.com/main.js',
1165
+ 'run an HTTPS bundle URL on a remote simulator',
1166
+ ),
1167
+ ],
1168
+ related: ['android', 'open', 'device'],
1169
+ },
1170
+ {
1171
+ id: 'android',
1172
+ slug: 'android',
1173
+ navTitle: 'android',
1174
+ title: 'peach android',
1175
+ description: 'start an Android simulator',
1176
+ summary:
1177
+ 'Start a simulator on Android. The platform picks the device: your current device is kept when it is already an Android model, otherwise the default Android device is used. Use --remote with your app folder, or a prebuilt bundle, to run it on the production service and open its viewer.',
1178
+ order: 99,
1179
+ usage: [
1180
+ 'peach android [target] [--device <model>]',
1181
+ 'peach android --remote <app-dir|bundle-path|https-url> [--device <model>]',
1182
+ 'peach android --remote <metro-bundle-url> --watch',
1183
+ ],
1184
+ options: [
1185
+ option(
1186
+ '--watch',
1187
+ 'keep a remote simulator connected to your Metro server until Ctrl+C',
1188
+ ),
1189
+ option(
1190
+ '--device <model>',
1191
+ 'pick a specific Android device model. an iOS model here is refused by name rather than silently overriding the platform',
1192
+ ),
1193
+ option(
1194
+ '--remote',
1195
+ 'build the app folder, or take the bundle, and run it on a remote simulator with its viewer open',
1196
+ ),
1197
+ ],
1198
+ examples: [
1199
+ example(
1200
+ 'peach android',
1201
+ 'start an Android simulator on your current or default Android device',
1202
+ ),
1203
+ example('peach android --device pixel-10', 'start on a specific Android device'),
1204
+ example(
1205
+ 'peach android --remote .',
1206
+ 'build the app in this folder, with its native modules, and run it remotely',
1207
+ ),
1208
+ example(
1209
+ 'peach android --remote ./dist/main.js',
1210
+ 'run a local bundle remotely, finding and embedding its assets for you',
1211
+ ),
1212
+ example(
1213
+ 'peach android --remote https://cdn.example.com/main.js',
1214
+ 'run an HTTPS bundle URL on a remote simulator',
1215
+ ),
1216
+ ],
1217
+ related: ['ios', 'open', 'device'],
1218
+ },
1219
+ {
1220
+ id: 'remote',
1221
+ slug: 'remote',
1222
+ navTitle: 'remote',
1223
+ title: 'peach remote',
1224
+ description: 'run your app on a remote simulator',
1225
+ summary:
1226
+ 'Builds your app folder, or takes a prebuilt iOS or Android bundle, runs it on the production service and opens its viewer. The platform forms peach ios --remote and peach android --remote launch the same hosted path.',
1227
+ order: 100,
1228
+ usage: [
1229
+ 'peach remote ios <app-dir|bundle.js|https://bundle-url> [--device <model>]',
1230
+ 'peach remote android <app-dir|bundle.js|https://bundle-url>',
1231
+ 'peach remote ios|android <metro-bundle-url> --watch',
1232
+ 'peach remote list [--json]',
1233
+ 'peach remote stop <sim-id>',
1234
+ 'peach remote close',
1235
+ ],
1236
+ options: [
1237
+ option('--device <model>', 'pick a specific device model'),
1238
+ option(
1239
+ '--watch',
1240
+ 'keep a remote simulator connected to your Metro server until Ctrl+C',
1241
+ ),
1242
+ // nano is experimental and never documented publicly (specs/peach/cloud/box-nano.md)
1243
+ option('--nano', 'use the experimental nano simulator service', true),
1244
+ ],
1245
+ examples: [
1246
+ example('peach remote ios .'),
1247
+ example('peach remote ios ./dist/main.js'),
1248
+ example('peach remote android ./dist/main.js'),
1249
+ example(
1250
+ 'peach remote list --json',
1251
+ 'list this account’s running remote simulators',
1252
+ ),
1253
+ example('peach remote stop <sim-id>', 'stop the simulator named by remote list'),
1254
+ example('peach remote close', 'close the active remote session'),
1255
+ ],
1256
+ related: ['ios', 'android'],
1257
+ },
1258
+ {
1259
+ id: 'preview',
1260
+ slug: 'preview',
1261
+ navTitle: 'preview',
1262
+ title: 'peach preview',
1263
+ description: 'publish an Expo export or bundle as a Build',
1264
+ summary:
1265
+ 'Uploads a prebuilt Metro or One Rolldown JavaScript bundle, including the output of `npx expo export --no-bytecode` (a dist directory or a single exported .js bundle with its hashed assets). Publishes an immutable Build using your account or API key and prints its link and artifact receipt. A Build starts private: only signed-in members of your account can open it until you turn on **Public link** in its share menu.',
1266
+ order: 101,
1267
+ usage: ['peach preview <dist|bundle> [--platform ios|android] [--open] [--json]'],
1268
+ options: [
1269
+ option(
1270
+ '--platform ios|android',
1271
+ 'select the viewer device platform, defaults to ios',
1272
+ ),
1273
+ option('--open', 'open the published Build in a browser'),
1274
+ option('--json', 'print the Build link and artifact receipt as JSON'),
1275
+ ],
1276
+ examples: [
1277
+ example(
1278
+ 'peach preview ./dist --open',
1279
+ 'preview an `npx expo export --no-bytecode` directory, picking the --platform bundle',
1280
+ ),
1281
+ example(
1282
+ 'peach preview ./dist/_expo/static/js/ios/entry-abc123.js',
1283
+ 'preview one exported bundle with its hashed assets',
1284
+ ),
1285
+ example(
1286
+ 'peach preview ./dist/main.js --open',
1287
+ 'finding and embedding its assets for you',
1288
+ ),
1289
+ example('peach preview ./dist/main.js --platform android'),
1290
+ ],
1291
+ related: ['record', 'remote'],
1292
+ },
1293
+ {
1294
+ id: 'map',
1295
+ slug: 'map',
1296
+ navTitle: 'map',
1297
+ title: 'peach map',
1298
+ description: 'capture screens tied to routes and publish the branch map',
1299
+ summary:
1300
+ 'Builds a screen map of the running app one capture at a time: `peach map add` screenshots the current sim and ties it to a route, with an optional edge recording the tap that got there. `peach map crawl` opens each route by deep link and captures it in order, discovering routes from `--app` or taking a listed `--routes`. The working file is peach-map.json with pngs under peach-map-assets/. `peach map publish` uploads the map to Peach Cloud, where the repo Map section shows it by branch, device and appearance. `peach canvas map` puts the map on a canvas beside anything else there, every route a live app.',
1301
+ order: 102,
1302
+ usage: [
1303
+ 'peach map add --route <path> [--title <text>] [--from <screen> --label <text>]',
1304
+ 'peach map crawl --scheme <myapp://> --routes /,/settings',
1305
+ 'peach map crawl --app <dir> [--scheme <myapp://>] [--routes /,/settings]',
1306
+ 'peach map list',
1307
+ 'peach map publish --owner <org> --repo <name> [--branch <name>]',
1308
+ ],
1309
+ options: [
1310
+ option('--route <path>', 'route this screen answers to; also its screen id'),
1311
+ option('--title <text>', 'display title, defaults to the route'),
1312
+ option('--state <name>', 'a second state of the same screen, e.g. signed-in'),
1313
+ option('--from <screen>', 'screen the tap started from; adds an edge'),
1314
+ option('--label <text>', 'tapped control label recorded on the edge'),
1315
+ option('--png <file>', 'use an existing png instead of capturing the sim'),
1316
+ option('--app <dir>', 'crawl: discover routes from the app router dir'),
1317
+ option('--scheme <url>', 'crawl: deep link scheme, e.g. myapp://'),
1318
+ option('--routes <list>', 'crawl: comma separated routes to capture'),
1319
+ option('--settle-ms <n>', 'crawl: wait per route for the tree to change'),
1320
+ option('--owner <org>', 'publish: github owner the cloud repo is linked under'),
1321
+ option('--repo <name>', 'publish: repo name'),
1322
+ option('--branch <name>', 'publish: branch the map belongs to'),
1323
+ option('--file <path>', 'working file, defaults to peach-map.json'),
1324
+ ],
1325
+ examples: [
1326
+ example('peach map add --route / --title Home', 'map the current screen as Home'),
1327
+ example(
1328
+ 'peach map add --route /settings --from / --label Settings',
1329
+ 'map Settings with the tap that opened it',
1330
+ ),
1331
+ example(
1332
+ 'peach map crawl --scheme myapp:// --routes /,/settings,/profile',
1333
+ 'deep link each route and capture it',
1334
+ ),
1335
+ example(
1336
+ 'peach map crawl --app ~/my-app',
1337
+ 'discover routes and scheme, then capture each',
1338
+ ),
1339
+ example('peach map publish --owner acme --repo my-app', 'publish the branch map'),
1340
+ ],
1341
+ related: ['screenshot', 'preview', 'record', 'canvas'],
1342
+ },
1343
+ {
1344
+ id: 'canvas',
1345
+ slug: 'canvas',
1346
+ navTitle: 'canvas',
1347
+ title: 'peach canvas',
1348
+ description: 'lay out live apps and maps of an app on one canvas',
1349
+ summary:
1350
+ 'Runs many apps live on one canvas, each on its own device, with pinch and scroll to move around it. A click selects an item and a double click enters it: the view fits it and its app takes the pointer and the scroll wheel until you click outside it or press Escape. Dragging an item moves it, and the next command that changes the canvas saves where it was dropped. `peach canvas open` opens a canvas sim that fills its window. `peach canvas place` puts a built-in app, or a Metro bundle with `--bundle`, on the canvas, right of the last item unless `--at` names its corner. Every change rewrites the working file, peach-canvas.json, and posts the whole canvas to the canvas sim; `peach canvas push` posts it again after the sim reloads. `peach canvas freeze` holds an item on its last frame with its app state until `peach canvas live` resumes it. `peach canvas map` puts a map made with `peach map` on the canvas beside whatever is already there: every mapped route is a live app launched by its deep link, linked by the taps between screens and laid out as the published map is. A route shows its capture until you zoom in far enough for its app to start, and running the command again replaces that map where it sat. `peach canvas arrange` lays every item out in a grid, ordered with `--by`, or lays each map out along its links with `--flow`. An item drawn at a quarter of its size or smaller holds its last frame until you zoom in.',
1351
+ order: 103,
1352
+ usage: [
1353
+ 'peach canvas open',
1354
+ 'peach canvas place <app> [--device <model>] [--at x,y] [--id <id>] [--radius <pt>]',
1355
+ 'peach canvas place --bundle <url|file> [--app-fonts-dir <dir>] [--url <link>] [--device <model>] [--at x,y] [--id <id>]',
1356
+ 'peach canvas map --bundle <url|file> [--app-fonts-dir <dir>] [--map <file>] [--scheme <myapp://>] [--device <model>] [--at x,y] [--id <name>]',
1357
+ 'peach canvas move <id> --at x,y',
1358
+ 'peach canvas resize <id> --size width,height',
1359
+ 'peach canvas arrange [--by title|device|app] [--columns <n>] [--gap <pt>]',
1360
+ 'peach canvas arrange --flow',
1361
+ 'peach canvas focus [id]',
1362
+ 'peach canvas freeze <id>',
1363
+ 'peach canvas live <id>',
1364
+ 'peach canvas camera --at x,y --scale <n>',
1365
+ 'peach canvas camera --path <file>',
1366
+ 'peach canvas remove <id | map name>',
1367
+ 'peach canvas list',
1368
+ 'peach canvas push',
1369
+ 'peach canvas view fit | <id> | --center x,y [--scale <n>]',
1370
+ ],
1371
+ options: [
1372
+ option('--device <model>', "the item's device, defaults to iphone-17-pro"),
1373
+ option('--at x,y', "the item's top left corner in canvas points"),
1374
+ option(
1375
+ '--id <id>',
1376
+ 'item id, defaults to the app id; for map, its name, defaults to the scheme',
1377
+ ),
1378
+ option(
1379
+ '--bundle <url>',
1380
+ 'a Metro bundle url or a built bundle file the item, or every route of a map, runs',
1381
+ ),
1382
+ option(
1383
+ '--app-fonts-dir <dir>',
1384
+ "the project holding the fonts a built bundle's app links natively",
1385
+ ),
1386
+ option('--map <file>', 'map: the map working file, defaults to peach-map.json'),
1387
+ option(
1388
+ '--scheme <url>',
1389
+ 'map: deep link scheme, defaults to the one the map was crawled with',
1390
+ ),
1391
+ option('--url <link>', 'the deep link the item launches with'),
1392
+ option('--radius <pt>', "corner radius, defaults to the device's display"),
1393
+ option('--size width,height', 'custom item size in points'),
1394
+ option(
1395
+ '--by <key>',
1396
+ "arrange: order items by title, device or app, defaults to the canvas's order",
1397
+ ),
1398
+ option('--columns <n>', 'arrange: items per row, defaults to a square grid'),
1399
+ option('--gap <pt>', 'arrange: space between items in points'),
1400
+ option(
1401
+ '--flow',
1402
+ 'arrange: lay each map out along its links and leave other items in place',
1403
+ ),
1404
+ option('--center x,y', 'view: the canvas point to center'),
1405
+ option('--scale <n>', 'zoom for view --center or camera'),
1406
+ option(
1407
+ '--path <file>',
1408
+ 'camera keyframes as a JSON array of {ms,x,y,scale}, starting at 0 ms',
1409
+ ),
1410
+ option('--file <path>', 'working file, defaults to peach-canvas.json'),
1411
+ ],
1412
+ examples: [
1413
+ example('peach canvas open', 'open a canvas sim'),
1414
+ example('peach canvas place photos', 'run Photos live on the canvas'),
1415
+ example('peach canvas place notes --device iphone-se', 'Notes on an iPhone SE'),
1416
+ example(
1417
+ 'peach canvas place --bundle "http://localhost:8081/index.bundle?platform=ios"',
1418
+ 'run your app beside them',
1419
+ ),
1420
+ example(
1421
+ 'peach canvas map --bundle "http://localhost:8081/index.bundle?platform=ios"',
1422
+ 'put a map on the canvas, every route live',
1423
+ ),
1424
+ example('peach canvas resize notes --size 320,640', 'resize Notes in place'),
1425
+ example('peach canvas freeze notes', 'hold Notes on its last frame'),
1426
+ example(
1427
+ 'peach canvas arrange --by device --columns 4',
1428
+ 'sort the canvas into rows of four',
1429
+ ),
1430
+ example('peach canvas view fit', 'fit every item in view'),
1431
+ ],
1432
+ related: ['open', 'map'],
1433
+ },
1434
+ {
1435
+ id: 'box',
1436
+ slug: 'box',
1437
+ navTitle: 'box',
1438
+ title: 'peach box',
1439
+ hidden: true,
1440
+ description: 'start a local Box or create a cloud Box',
1441
+ summary:
1442
+ 'A Box is an environment holding the project filesystem, a shell, peach tools, a bundler, an app server, and a simulator. Bare `peach box` is intentionally local: it mounts the current checkout at /project and enters a shell with ls, cat, find, rg, sed, pipes and redirects, plus peach itself registered as a shell command. Writes go straight to the checkout, and the local Box never creates a second copy of the project. `peach box create` imports the Git-tracked checkout through the configured cloud Box service, prints the Box identity and available live URL, then enters its shell. Add `--json` to return the created identity without opening a shell. `peach box create --env-file <file>` hands the Box credentials such as an app login: every Box shell, the agent’s included, starts with them as variables, and output shows `$NAME` in place of each value. `peach box create --bundle <file>` creates a Box from an app that is already built instead: the bundle is the whole project, the Box records that it holds one, and its page boots that bundle rather than building anything, so the simulator paints without waiting for a build. `peach box connect <id-or-name>` attaches to a Box that already exists, from any machine: your account resolves the name and hands back the Box’s own reference, so the CLI never stores a Box token. `peach box open <id-or-name>` opens that Box in your browser, so you can watch its terminal and its simulator while an agent works in it. `peach box use <id-or-name>` targets a Box from every box command: connect, open, stop and delete act on it whenever you name none, and `peach box use` with no name prints the Box they target. `peach box ls` lists the cloud Boxes running on your account, and never starts one. `peach box stop <id-or-name>` ends a Box and its billing while keeping its files; `peach box delete <id-or-name>` also wipes them. `peach box send` sends the app running in your local dev server to a Box and prints the URL to watch it on.',
1443
+ order: 97,
1444
+ usage: [
1445
+ 'peach box',
1446
+ 'peach box create [--name <name>] [--bundle <file>] [--env-file <file>] [--template <name>] [--endpoint <url>] [--json]',
1447
+ 'peach box use [<id-or-name>]',
1448
+ 'peach box connect [<id-or-name>] [--json]',
1449
+ 'peach box open [<id-or-name>] [--print] [--json]',
1450
+ 'peach box ls',
1451
+ 'peach box stop [<id-or-name>]',
1452
+ 'peach box delete [<id-or-name>]',
1453
+ 'peach box send [--name <name>] [--no-auth] [--json]',
1454
+ ],
1455
+ options: [
1456
+ option(
1457
+ '--name <name>',
1458
+ 'name the cloud Box to create, or the one a verb acts on; create defaults to the project directory name',
1459
+ ),
1460
+ option(
1461
+ '--bundle <file>',
1462
+ 'create the Box from an already-built bundle rather than a checkout; the Box records that it holds one and its page boots it without building',
1463
+ ),
1464
+ option(
1465
+ '--env-file <file>',
1466
+ 'give every shell in the cloud Box the variables in this .env file, such as an app login; they never enter the project, and shell output shows $NAME in place of each value',
1467
+ ),
1468
+ option(
1469
+ '--template <name>',
1470
+ 'resolve a registered Box template; defaults to terminal',
1471
+ ),
1472
+ option(
1473
+ '--endpoint <url>',
1474
+ 'use this cloud Box service instead of PEACH_BOX_ENDPOINT or the default Peach Cloud service',
1475
+ ),
1476
+ option('--json', 'return the Box description without entering its shell'),
1477
+ option(
1478
+ '--no-auth',
1479
+ 'send to a Box without carrying your signed-in session into it',
1480
+ ),
1481
+ option(
1482
+ '--print',
1483
+ 'print the viewing URL `peach box open` would open, instead of opening it',
1484
+ ),
1485
+ ],
1486
+ examples: [
1487
+ example('peach box', 'start a local box over the current checkout'),
1488
+ example('peach box create --name=my-sim', 'create a named cloud box'),
1489
+ example(
1490
+ 'peach box create --name=my-sim --json',
1491
+ 'create a cloud Box without entering its shell',
1492
+ ),
1493
+ example(
1494
+ 'peach box create --bundle ./dist/main.js',
1495
+ 'create a Box from an app that is already built, so its page boots without building',
1496
+ ),
1497
+ example('peach box use my-sim', 'target this Box from every box command'),
1498
+ example('peach box use', 'print the Box those commands target'),
1499
+ example('peach box connect my-sim', 'open the shell of a Box that already exists'),
1500
+ example('peach box connect', 'open the shell of the Box `peach box use` targeted'),
1501
+ example(
1502
+ 'peach box connect my-sim --json',
1503
+ 'print an existing Box’s identity, without its token and without its shell',
1504
+ ),
1505
+ example('peach box open my-sim', 'watch a Box in your browser'),
1506
+ example(
1507
+ 'peach box open my-sim --print',
1508
+ 'print the viewing URL instead of opening a browser',
1509
+ ),
1510
+ example('peach box ls', 'list the cloud Boxes running on this account'),
1511
+ example('peach box stop my-sim', 'stop a Box and its billing, keeping its files'),
1512
+ example('peach box delete my-sim', 'stop a Box and wipe its files'),
1513
+ example('peach box send', 'send the app running locally to a Box'),
1514
+ ],
1515
+ related: ['ios', 'android', 'open', 'shell'],
1516
+ },
1517
+ {
1518
+ id: 'package',
1519
+ slug: 'package',
1520
+ navTitle: 'package',
1521
+ title: 'peach package',
1522
+ description: 'package one app as a standalone macOS app',
1523
+ summary:
1524
+ 'Bundle an installed native host, runtime, app resources and registry-derived settings into a movable Mac app. Development port targets reconnect to their server. Each app keeps its own settings across updates.',
1525
+ order: 101,
1526
+ usage: ['peach package <target> --name <name> [--output <path.app>]'],
1527
+ options: [
1528
+ option('--name <name>', 'application name'),
1529
+ option('--output <path.app>', 'new app bundle to create'),
1530
+ option(
1531
+ '--identifier <bundle-id>',
1532
+ 'stable app identity and settings directory across updates',
1533
+ ),
1534
+ option('--icon <image>', 'override the discovered app icon'),
1535
+ option('--splash <image>', 'override the discovered splash image'),
1536
+ option(
1537
+ '--setting <key=value>',
1538
+ 'default from the shared settings registry; repeat for multiple settings',
1539
+ ),
1540
+ option('--host-app <path.app>', 'native Peach host to package'),
1541
+ option('--cli <binary>', 'standalone Peach CLI to embed when running from source'),
1542
+ option(
1543
+ '--project-root <directory>',
1544
+ 'app configuration and native sources for a prebuilt release',
1545
+ ),
1546
+ option(
1547
+ '--package-versions <json>',
1548
+ 'native package versions for a prebuilt release bundle',
1549
+ ),
1550
+ option('--stream', 'stream this local simulator to your team until Ctrl+C'),
1551
+ option('--target <name>', 'native application target'),
1552
+ option('--scheme <name>', 'Xcode application scheme'),
1553
+ option('--activity <name>', 'Android application activity'),
1554
+ ],
1555
+ examples: [
1556
+ example(
1557
+ 'peach package 4280 --name "My App" --setting showFrame=true',
1558
+ 'create an app connected to a development server',
1559
+ ),
1560
+ ],
1561
+ related: ['open', 'desktop', 'config'],
1562
+ },
1563
+ {
1564
+ id: 'stream',
1565
+ slug: 'stream',
1566
+ navTitle: 'stream',
1567
+ title: 'peach stream',
1568
+ description: 'stream an open simulator to your team',
1569
+ summary:
1570
+ 'The simulator runs on this Mac. Teammates watch its display in the web workspace. Start stays in the foreground; Ctrl+C stops the stream.',
1571
+ order: 99,
1572
+ usage: ['peach stream start|stop|status [--sim <id>]'],
1573
+ options: [option('--sim <id>', 'select an open simulator')],
1574
+ examples: [
1575
+ example('peach stream start'),
1576
+ example('peach stream stop'),
1577
+ example('peach stream status'),
1578
+ ],
1579
+ related: ['open', 'ios'],
1580
+ },
1581
+ {
1582
+ id: 'open',
1583
+ slug: 'open',
1584
+ navTitle: 'open',
1585
+ title: 'peach open',
1586
+ description: 'run a React Native, Swift or Android app in the simulator',
1587
+ summary:
1588
+ "Resolve a port, dev-server URL, bundle URL, built bundle file, full shell URL, or app deep link. It also runs native apps: an Xcode project or workspace, a SwiftPM package or a Swift file compiles on this machine against the Swift toolchain and SDK Peach pins and installs on first use (beta), and an Android app module compiles its Kotlin and Compose sources with the pinned Kotlin toolchain, which needs a Java runtime (beta). A native open stays in the foreground, recompiles on each source edit and closes its preview on Ctrl+C; when an app imports modules Peach does not provide, it lists each one with the files importing it. A bundle file loads with no dev server running: the bridge serves a copy, and the build's own `__DEV__` prelude picks production or development React. The first browser sim uses an isolated Playwright Chrome for Testing profile. Later opens reuse the saved sim and navigate it in place. Custom-scheme URLs and leading-slash routes dispatch through the current app’s React Native Linking pipeline. Named profiles force a fresh desktop or Playwright sim because storage isolation is fixed at window/context construction time. A peach preview/build link (e.g. `https://peachsim.com/preview/<id>`) is a full player page, not a driveable sim; `open` recognizes it and launches it in your browser for viewing instead of mis-loading the HTML as a bundle.",
1589
+ order: 100,
1590
+ usage: [
1591
+ 'peach open <port|target|bundle-url|bundle-file|swift-file|native-project|peach-url|deeplink> [--new]',
1592
+ ],
1593
+ options: [
1594
+ option('--target <name>', 'select the native Xcode application target'),
1595
+ option('--scheme <name>', 'select the native Xcode application scheme'),
1596
+ option('--activity <name>', 'select the Android application activity'),
1597
+ option(
1598
+ '--upload-source',
1599
+ 'compile a Swift app on Peach Cloud instead: consent to uploading the selected package and its watched edits; requires peach login or PEACH_API_KEY',
1600
+ ),
1601
+ option(
1602
+ '--swift-sdks-path <directory>',
1603
+ 'install and look up the pinned wasm SDK in this directory instead of PEACH_HOME/swift/sdks; also configurable with PEACH_SWIFT_SDKS_PATH',
1604
+ ),
1605
+ option(
1606
+ '--host-port <port>',
1607
+ 'pin the loopback port of a native app host; otherwise an available port is selected',
1608
+ ),
1609
+ option('--no-open', 'keep a native app host running without opening a preview'),
1610
+ option(
1611
+ '--new',
1612
+ 'open a genuinely concurrent sim instead of reusing the current one. each new sim creates another isolated browser tree',
1613
+ ),
1614
+ option('--profile <id>', 'open with an isolated persistent storage profile'),
1615
+ option(
1616
+ '--id <name>',
1617
+ "name this agent. the sim's agent indicator shows it while you drive the sim, and every later peach command from this session keeps using it. PEACH_AGENT_ID sets the same name from the environment, and --id wins",
1618
+ ),
1619
+ option(
1620
+ '--ephemeral',
1621
+ 'open with a temporary isolated storage profile. combined with `--new --driver playwright` this is the guaranteed-clean boot: a throwaway browser profile with no service worker registration and no preview-share IndexedDB, so nothing a previous sim left behind can steer this one',
1622
+ ),
1623
+ option(
1624
+ '--driver <id>',
1625
+ 'launch a fresh sim through playwright (default browser surface), desktop (native app), or electron (Windows)',
1626
+ ),
1627
+ option(
1628
+ '--headless',
1629
+ 'pass headless=true to the launch driver (useful with `--driver playwright` for CI runs); needs a signed-in account',
1630
+ ),
1631
+ option(
1632
+ '--headed',
1633
+ 'launch the driver with a visible window instead of headless; the default on a desktop outside agent sessions',
1634
+ ),
1635
+ option(
1636
+ '--chromium',
1637
+ 'render this open in plain Chromium without acquiring or attaching a native host (playwright only). Linux headless defaults to native; PEACH_DESKTOP_VERSION pins the native build',
1638
+ ),
1639
+ option(
1640
+ '--cdp-port <number>',
1641
+ 'expose Chrome remote debugging on this port so the sim can be cpu-profiled while still driveable over the bridge (playwright driver only)',
1642
+ ),
1643
+ option(
1644
+ '--device <model>',
1645
+ 'device profile for the opened sim (e.g. iphone-16, iphone-16-pro-max, pixel-8). stamped on the engine URL so every open path honors it; playwright sims also size their viewport to the device instead of a desktop-shaped default',
1646
+ ),
1647
+ option(
1648
+ '-t, --theme <light|dark|auto>',
1649
+ 'appearance scheme for the opened sim, stamped on the engine URL so it wins over the persisted scheme at boot',
1650
+ ),
1651
+ option(
1652
+ '--posture <closed|book|open|laptop|tent>',
1653
+ 'fold rest for the opened sim, stamped on the engine URL next to --device so it round-trips across reloads. the foldable iPhone Duo boots at that rest, so the app sees its hinge from the first frame; anything else boots closed',
1654
+ ),
1655
+ option(
1656
+ '--render-resolution <high|medium|low>',
1657
+ "raster quality for the opened sim, stamped on the engine URL. the default is medium (density 2); high renders at the device's native scale (3 on current iPhones), which native-parity captures need",
1658
+ ),
1659
+ option(
1660
+ '--predictive-text <on|off>',
1661
+ "the keyboard's QuickType suggestion lane for the opened sim, stamped on the engine URL over the persisted setting. native oracles captured by a test driver run with it off, so a keyboard capture compared against one passes off",
1662
+ ),
1663
+ option(
1664
+ '--orientation <portrait|landscape>',
1665
+ "interface orientation the sim boots in, stamped on the engine URL like --posture. defaults to the device's own: portrait, or landscape for an open iPhone Duo",
1666
+ ),
1667
+ option(
1668
+ '--viewport <WxH>',
1669
+ 'explicit page size for a driver-launched sim (e.g. 1920x1080 to frame the 3d stage in landscape for film capture). takes precedence over the device-derived window size (playwright driver only)',
1670
+ ),
1671
+ option(
1672
+ '--arg <value>',
1673
+ 'one launch argument, as a `simctl launch` argument is. a Swift app reads each in order, verbatim, as ProcessInfo.arguments[1...] after the executable path (e.g. --arg --showcaseScene --arg thread). repeatable',
1674
+ ),
1675
+ option('--base-url <url>', 'base shell URL to wrap around bundle targets'),
1676
+ option(
1677
+ '--bundle-origin <url>',
1678
+ 'manifest and asset origin supplied by a recorder proxy',
1679
+ ),
1680
+ option(
1681
+ '--project-root <directory>',
1682
+ 'local app checkout supplying native configuration when its packager runs on another machine; a missing project is an error',
1683
+ ),
1684
+ option(
1685
+ '--replace <module>=<file>',
1686
+ 'replace a Metro module with a local file for this run; useful for swapping in a deterministic fixture component during demos. repeatable',
1687
+ ),
1688
+ option(
1689
+ '--remap <host:port>=<host:port>',
1690
+ 'rewrite guest-app fetch/websocket traffic from one host:port to another for this run (e.g. a third-party e2e suite that hardcodes a port already taken on the host). repeatable',
1691
+ ),
1692
+ option(
1693
+ '--load-env',
1694
+ "read the project's env file the way react-native-config's iOS build compiles it into the app (`ENVFILE` if set, else `.env`) and hand it to the app's `Config`. without it `Config` is empty, as in a build that found no env file, and the app's first read warns in the console. the values travel in the sim's page URL; edit the file and open again to pick up changes",
1695
+ ),
1696
+ option(
1697
+ '--no-describe',
1698
+ "skip the automatic `describe` snapshot that prints right after open finishes (useful when scripting and you only want open's own output)",
1699
+ ),
1700
+ option(
1701
+ '--hot',
1702
+ "force metro HMR on (sets `hot=true` on the bundle URL). default for interactive opens; edits hot-apply through peach's HmrClient",
1703
+ ),
1704
+ option(
1705
+ '--no-hmr',
1706
+ 'force metro HMR off (sets `hot=false` on the bundle URL). default under `--driver playwright` so agent/CI runs stay deterministic with no in-bundle refresh wiring',
1707
+ ),
1708
+ option(
1709
+ '--port <number>',
1710
+ 'the WS BRIDGE port peach talks to (defaults to {{bridgePort}}). NOT the app port: the dev-server port is the positional argument, so it is `peach open 4260`, never `peach open --port 4260`',
1711
+ ),
1712
+ ],
1713
+ examples: [
1714
+ example('peach open 8081'),
1715
+ example('peach open ./MyApp.xcodeproj', "run the Xcode project's app target"),
1716
+ example(
1717
+ 'peach open ./MyApp.xcworkspace --target MyApp',
1718
+ 'run one app target of a multi-project workspace',
1719
+ ),
1720
+ example('peach open ./MyPackage', 'watch and preview a SwiftPM package'),
1721
+ example('peach open ./app', 'run an Android app module from its launcher activity'),
1722
+ example('peach open --new 8085'),
1723
+ example('peach open 8081 --profile qa'),
1724
+ example('peach open 8081 --profile qa --driver playwright'),
1725
+ example('peach open http://localhost:8082'),
1726
+ example(
1727
+ 'peach open ./dist/ios.js',
1728
+ 'load a built production bundle with no dev server',
1729
+ ),
1730
+ example('peach open /settings', 'dispatch a route deep link to the current app'),
1731
+ example('peach open myapp://settings/profile'),
1732
+ example(
1733
+ 'peach open 8081 --driver playwright --headless',
1734
+ 'headless CI / scripted runs',
1735
+ ),
1736
+ example(
1737
+ 'peach open 8081 --new --driver playwright --device iphone-16',
1738
+ 'pinned device profile (comparisons need the same device)',
1739
+ ),
1740
+ example(
1741
+ 'peach open 8081 --new --driver playwright --device iphone-duo --posture open',
1742
+ 'foldable duo booted open',
1743
+ ),
1744
+ example(
1745
+ 'peach open 8089 --new --driver playwright --cdp-port 9222',
1746
+ 'open a sim that is both driveable and cpu-profilable (then `peach perf cpu --cdp-port 9222`)',
1747
+ ),
1748
+ example(
1749
+ 'peach open 8081 --new --ephemeral --driver playwright',
1750
+ 'boot against a guaranteed-clean browser profile: no service worker, no preview-share IndexedDB, no carried-over storage. the first thing to reach for when a sim is wedged or you cannot tell whether a failure belongs to the app or to leftover state',
1751
+ ),
1752
+ example('peach open 8081 --no-describe', 'silent open for scripts'),
1753
+ example(
1754
+ 'peach open 8081 --no-hmr',
1755
+ 'open with metro HMR off (e.g. when reproducing a non-HMR boot path)',
1756
+ ),
1757
+ example(
1758
+ 'peach open 8081 --driver playwright --hot',
1759
+ 'driver playwright but keep HMR on (e.g. recording an edit-driven demo)',
1760
+ ),
1761
+ example(
1762
+ 'peach open https://peachsim.com/preview/<id>',
1763
+ 'opens a preview/build link in the browser for viewing (not a driveable sim)',
1764
+ ),
1765
+ ],
1766
+ related: ['list', 'use', 'close', 'desktop'],
1767
+ },
1768
+ {
1769
+ id: 'list',
1770
+ slug: 'list',
1771
+ navTitle: 'list',
1772
+ title: 'peach list',
1773
+ description: 'list connected sims or available launch drivers',
1774
+ summary:
1775
+ 'Show every connected sim, or (with `--drivers`) enumerate the native desktop, Windows Electron and Playwright launch drivers along with their availability on the current machine. By default hides idle host shells (open tabs with no app bundle loaded) so the output stays focused on the demos that actually have an app running; pass `--all` to see everything.',
1776
+ order: 110,
1777
+ usage: [
1778
+ 'peach list [--all] [--bundle <substr>] [--app-port <port>] [--primary] [--sim <sim>] [--json]',
1779
+ 'peach list --drivers',
1780
+ ],
1781
+ options: [
1782
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1783
+ option('--sim <sim>', 'highlight a specific sim in the output'),
1784
+ option(
1785
+ '--all',
1786
+ 'show every connected sim, including idle host shells with no app loaded',
1787
+ ),
1788
+ option(
1789
+ '--bundle <substring>',
1790
+ 'only sims whose loaded url contains this substring',
1791
+ ),
1792
+ option(
1793
+ '--app-port <port>',
1794
+ "shorthand for `--bundle '/rn/<port>'`: filter to sims for the app on a specific metro/vite port. NOT `--port` (that's reserved for the bridge port)",
1795
+ ),
1796
+ option('--primary', 'only the primary sim'),
1797
+ option('--drivers, -D', 'list available launch drivers instead of connected sims'),
1798
+ option('--json', 'emit array of sim objects for scripts'),
1799
+ ],
1800
+ examples: [
1801
+ example('peach list'),
1802
+ example('peach list --all', 'include idle host shells'),
1803
+ example('peach list --app-port 8082', 'only sims running the app on port 8082'),
1804
+ example('peach list --bundle bluesky', 'sims whose bundle url mentions bluesky'),
1805
+ example('peach list --primary'),
1806
+ example('peach list --sim a6'),
1807
+ example('peach list --drivers', 'show every installable launch driver'),
1808
+ example('peach list --json | jq ".[] | select(.active)"'),
1809
+ ],
1810
+ related: ['open', 'use', 'close'],
1811
+ },
1812
+ {
1813
+ id: 'use',
1814
+ slug: 'use',
1815
+ navTitle: 'use',
1816
+ title: 'peach use',
1817
+ description: 'select a connected sim',
1818
+ summary:
1819
+ 'Make one connected sim current by focusing it and saving it as the default target for later bridge-backed commands.',
1820
+ order: 120,
1821
+ usage: ['peach use [sim]'],
1822
+ options: [
1823
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1824
+ option('--sim <sim>', 'target a specific connected sim'),
1825
+ ],
1826
+ examples: [example('peach use'), example('peach use a6')],
1827
+ related: ['list', 'open', 'close'],
1828
+ },
1829
+ {
1830
+ id: 'claim',
1831
+ slug: 'claim',
1832
+ navTitle: 'claim',
1833
+ title: 'peach claim',
1834
+ description: 'take an exclusive lease on a sim',
1835
+ summary:
1836
+ "Reserve a connected sim so other agents cannot change its state. Leases auto-expire after 10 minutes of inactivity and refresh on state-changing commands from the owner. Read-only inspection and `close` bypass the lease. Prefer `peach open --new` over `claim --force` when another agent is active, since the latter steals the lease mid-flight and breaks the other agent's in-progress flow.",
1837
+ order: 125,
1838
+ usage: ['peach claim [sim] [--force]'],
1839
+ options: [
1840
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1841
+ option('--sim <sim>', 'target a specific connected sim'),
1842
+ option(
1843
+ '--force',
1844
+ 'steal the lease from whoever currently holds it. only safe when you know the other holder is dead or abandoned; prefer `peach open --new` to get a fresh sim instead',
1845
+ ),
1846
+ ],
1847
+ examples: [
1848
+ example('peach claim'),
1849
+ example('peach claim a6'),
1850
+ example(
1851
+ 'peach claim a6 --force',
1852
+ 'last-resort lease steal; see `peach open --new` for the safer alternative',
1853
+ ),
1854
+ ],
1855
+ related: ['list', 'use', 'open', 'close'],
1856
+ },
1857
+ {
1858
+ id: 'close',
1859
+ slug: 'close',
1860
+ navTitle: 'close',
1861
+ title: 'peach close',
1862
+ description: 'close a connected sim',
1863
+ summary:
1864
+ 'Request that a sim close itself over the bridge and wait for it to disappear from the sim registry.',
1865
+ order: 130,
1866
+ usage: ['peach close [sim]', 'peach close --all', 'peach close --others'],
1867
+ options: [
1868
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
1869
+ option('--sim <sim>', 'target a specific connected sim'),
1870
+ option('--all', 'close every connected sim'),
1871
+ option('--others', 'close every connected sim except the current/target one'),
1872
+ ],
1873
+ examples: [
1874
+ example('peach close'),
1875
+ example('peach close a6'),
1876
+ example('peach close --all'),
1877
+ example('peach close --others'),
1878
+ ],
1879
+ related: ['list', 'use'],
1880
+ },
1881
+ {
1882
+ id: 'setup',
1883
+ slug: 'setup',
1884
+ navTitle: 'setup',
1885
+ title: 'peach setup',
1886
+ description: 'configure optional local conveniences',
1887
+ summary:
1888
+ 'peach works without project setup. This guided flow saves an API key it finds in PEACH_API_KEY or ~/Downloads/peach-api-key.txt (the welcome dialog on peachsim.com downloads it), or asks for one when a person is at the terminal, so tests and recordings work. It explains and offers the strongly recommended background service, which keeps the bridge and runtime ready so agent inspection, interaction, and test commands start much faster. It also installs the native desktop app where it ships (Windows chooses Browser or its Desktop app), offers to enable bounded diagnostics and crash reports, and can optionally add an exact peachsim dependency plus a peach script when the current directory is inside a Git repository. Declining the service is reversible with `peach daemon install`.',
1889
+ order: 140,
1890
+ usage: ['peach setup [options]'],
1891
+ options: [
1892
+ option('--app <dir>', 'project directory to inspect (default: current directory)'),
1893
+ option('-y, --yes', 'accept recommended machine defaults without prompting'),
1894
+ option('--dry-run', 'show what setup would offer without changing files'),
1895
+ option('--ci', 'never prompt or install a background service'),
1896
+ option('--json', 'emit runtime and cache metadata as JSON'),
1897
+ option('--service | --no-service', 'enable or decline the background service'),
1898
+ option('--desktop | --browser', 'choose the simulator window'),
1899
+ option(
1900
+ '--analytics on|off',
1901
+ 'turn bounded diagnostics and crash reports on or off',
1902
+ ),
1903
+ option('--repo | --no-repo', 'add or skip the optional repository install'),
1904
+ ],
1905
+ examples: [
1906
+ example('peach setup'),
1907
+ example('peach setup --app ./apps/mobile'),
1908
+ example('peach setup --dry-run'),
1909
+ example('peach setup --yes'),
1910
+ example('peach setup --ci --yes --json', 'run without prompts and print JSON'),
1911
+ ],
1912
+ related: ['doctor', 'open', 'daemon', 'serve', 'skill'],
1913
+ },
1914
+ {
1915
+ id: 'doctor',
1916
+ slug: 'doctor',
1917
+ navTitle: 'doctor',
1918
+ title: 'peach doctor',
1919
+ description:
1920
+ 'check the Peach install: CLI, runtime, desktop app, service, bridge and account',
1921
+ summary:
1922
+ 'Check the install when something does not start: the CLI version, the active runtime (installed on first use, as `peach open` does), the desktop app, the background service, whether a bridge answers on the bridge port, and which account the CLI uses. To check what of an app Peach runs, use `peach compat`.',
1923
+ order: 150,
1924
+ usage: ['peach doctor [--json]'],
1925
+ options: [option('--json', 'emit machine-readable JSON')],
1926
+ examples: [example('peach doctor'), example('peach doctor --json')],
1927
+ related: ['compat', 'setup', 'login', 'support'],
1928
+ },
1929
+ {
1930
+ id: 'compat',
1931
+ slug: 'compat',
1932
+ navTitle: 'compat',
1933
+ title: 'peach compat',
1934
+ description:
1935
+ 'check what of an app Peach runs: packages, API reach and verified proof',
1936
+ summary:
1937
+ "Check an app before you open it. For a React Native app: the React and React Native it declares against what the runtime runs (every app runs on the runtime's React), each React Native package with its implementation percent and what is missing, packages installed at a version outside the supported ranges, native code Peach does not know with the `peach.config.ts` stubs that answer it, and the installed `peach-stub-<package>` packages that answer for one, marked third-party. Then it scans the app's source for the APIs it calls, resolving package versions from installed manifests or lockfiles, and reports which reach a mapped feature, which are unknown, and the releases Verified proof covers. For a Swift package or Xcode project it reports the Swift source reach. Source imports show possible reach, never native fidelity. `--report` sends the package findings to us without a login; it carries package names, versions, findings, and CLI and runtime versions, never source, paths, the app name, environment, or app data, and each network may send 10 a day.",
1938
+ order: 151,
1939
+ usage: [
1940
+ 'peach compat [package-name] [--app <dir>] [--source <path>] [--json]',
1941
+ 'peach compat --target <name> # an Xcode app target or SwiftPM executable',
1942
+ 'peach compat --report',
1943
+ ],
1944
+ options: [
1945
+ option('--app <dir>', 'check this app or workspace instead of cwd'),
1946
+ option(
1947
+ '--source <path>',
1948
+ 'scan a source file or directory inside the app; repeat for several roots',
1949
+ ),
1950
+ option(
1951
+ '--target <name>',
1952
+ 'choose the Xcode application target or SwiftPM executable target when several exist',
1953
+ ),
1954
+ option('--report', 'send the package findings to us; no login needed'),
1955
+ option('--verbose', "print each package's registry note"),
1956
+ option('--json', 'emit packages, source references, versions and features as JSON'),
1957
+ ],
1958
+ examples: [
1959
+ example('peach compat'),
1960
+ example('peach compat react-native-reanimated'),
1961
+ example('peach compat --app apps/mobile --json'),
1962
+ example('peach compat --app ./MyApp.xcodeproj'),
1963
+ example('peach compat --report', 'send the findings without signing in'),
1964
+ ],
1965
+ related: ['doctor', 'open', 'project-report'],
1966
+ },
1967
+ {
1968
+ id: 'project-report',
1969
+ slug: 'project-report',
1970
+ navTitle: 'project-report',
1971
+ title: 'peach project-report',
1972
+ description: 'print local project and toolchain metadata',
1973
+ summary:
1974
+ 'Discover React Native, Expo, native iOS, Android and Swift projects across a repository and print dependency and toolchain versions. The scan is read-only, bounded, and stays local.',
1975
+ order: 154,
1976
+ usage: ['peach project-report [--app <dir>] [--json]'],
1977
+ options: [
1978
+ option(
1979
+ '--app <dir>',
1980
+ 'scan only this directory and its descendants instead of the detected workspace root',
1981
+ ),
1982
+ option('--json', 'print a machine-readable report'),
1983
+ ],
1984
+ examples: [
1985
+ example('peach project-report'),
1986
+ example('peach project-report --json'),
1987
+ example('peach project-report --app apps/mobile'),
1988
+ ],
1989
+ related: ['support', 'doctor'],
1990
+ },
1991
+ {
1992
+ id: 'support',
1993
+ slug: 'support',
1994
+ navTitle: 'support',
1995
+ title: 'peach support',
1996
+ description: 'ask for help, report a problem, and read our replies',
1997
+ summary:
1998
+ 'Ask a question the docs do not answer and get an answer back in the terminal, report a problem, and check the status of both. Every ask and report belongs to the account your `peach login` names, so `peach support status` lists them with our replies, the commit that fixed each report, and the runtime release that shipped it. An ask sends the question, CLI and runtime versions, and the dependency compatibility scan. A report requires sign-in so you can read its replies, attaches the project report printed by `peach project-report`, and requires confirmation before sending. Neither attaches source, environment variables, terminal output, logs, screenshots, or app data. The first 5 asks of an account are answered right away and later ones once we approve the account; `peach support fund` adds funds for onboarding support.',
1999
+ order: 155,
2000
+ usage: [
2001
+ 'peach support ask "<question>" [--no-wait] [--wait <minutes>] [--json]',
2002
+ 'peach support report [--app <dir>] [--dry-run] [--yes] "<description>"',
2003
+ 'peach support status [--id <id>] [--new] [--json]',
2004
+ 'peach support fund [--amount <usd>]',
2005
+ ],
2006
+ options: [
2007
+ option('--wait <minutes>', 'how long `ask` waits for the answer (default 15)'),
2008
+ option('--no-wait', 'return the ask id at once; the answer shows in `status`'),
2009
+ option(
2010
+ '--app <dir>',
2011
+ 'scan only this app directory instead of the detected workspace',
2012
+ ),
2013
+ option('--dry-run', 'preview a report without sending it'),
2014
+ option(
2015
+ '-y, --yes',
2016
+ 'send a report after the user has explicitly approved the preview; required in non-interactive sessions',
2017
+ ),
2018
+ option('--id <id>', 'read one ask or report from your account'),
2019
+ option('--new', 'list only what changed since the last `status`'),
2020
+ option(
2021
+ '--amount <usd>',
2022
+ 'how much `fund` adds to the prepaid balance (default $10)',
2023
+ ),
2024
+ option('--json', 'print machine-readable output'),
2025
+ ],
2026
+ examples: [
2027
+ example(
2028
+ 'peach support ask "how do I give the simulator a custom URL scheme?"',
2029
+ 'wait for the answer and print it',
2030
+ ),
2031
+ example(
2032
+ 'peach support report "react-native-example renders its sheet behind the tab bar"',
2033
+ 'preview the report and ask for interactive confirmation',
2034
+ ),
2035
+ example(
2036
+ 'peach support report --yes "react-native-example crashes when opening its picker"',
2037
+ 'submit only after the user explicitly asks you to send it',
2038
+ ),
2039
+ example('peach support status --new', 'replies and fixes since the last check'),
2040
+ example('peach support fund', 'add funds for onboarding support'),
2041
+ ],
2042
+ related: ['project-report', 'doctor', 'setup'],
2043
+ },
2044
+ {
2045
+ id: 'desktop',
2046
+ slug: 'desktop',
2047
+ navTitle: 'desktop',
2048
+ title: 'peach desktop',
2049
+ description: 'launch or install the desktop companion',
2050
+ summary:
2051
+ 'Launch or install the native app on macOS arm64 and Linux x64, or Electron on Windows. Profiles keep cookies and app storage isolated.',
2052
+ order: 160,
2053
+ usage: [
2054
+ 'peach desktop [--port <number>] [--profile <id>]',
2055
+ 'peach desktop install [options]',
2056
+ 'peach desktop uninstall',
2057
+ ],
2058
+ options: [
2059
+ option(
2060
+ '--port <number>',
2061
+ 'open a local app server through the peach shell, for example Metro on 8081',
2062
+ ),
2063
+ option('--profile <id>', 'launch with an isolated persistent storage profile'),
2064
+ option('--ephemeral', 'launch with a temporary isolated storage profile'),
2065
+ option('-y, --yes', 'for install: skip confirmation and install immediately'),
2066
+ option('--force', 'for install: reinstall even if the companion is present'),
2067
+ option(
2068
+ '--electron',
2069
+ 'launch or install Electron on Windows; use the native app on Mac and Linux',
2070
+ ),
2071
+ option(
2072
+ '--native',
2073
+ 'launch or install the native desktop host (default app on macOS arm64; on Linux x64 installs the headless host that headless `peach open` draws through, see [Tests in CI](/docs/peach/testing/ci))',
2074
+ ),
2075
+ option('--channel <name>', 'for install --native: production (default) or staging'),
2076
+ ],
2077
+ examples: [
2078
+ example('peach desktop'),
2079
+ example('peach desktop --port 8081'),
2080
+ example('peach desktop --profile qa'),
2081
+ example('peach desktop install --yes'),
2082
+ example(
2083
+ 'peach desktop install --native --yes',
2084
+ 'faster headless runs on a Linux CI runner',
2085
+ ),
2086
+ ],
2087
+ related: ['open', 'list', 'debug'],
2088
+ },
2089
+ {
2090
+ id: 'daemon',
2091
+ slug: 'daemon',
2092
+ navTitle: 'daemon',
2093
+ title: 'peach daemon',
2094
+ description: 'manage the recommended background bridge service',
2095
+ summary:
2096
+ 'Install or manage the persistent background bridge. It registers a launchd agent on macOS or systemd user service on Linux and keeps the bridge and runtime ready between commands. This is strongly recommended for local agent work because inspect, interaction, and test commands start much faster. It is optional and not needed in CI. If you declined during onboarding, enable it with `peach daemon install`. `peach daemon uninstall` stops and removes the agent, its launcher, and its logs, and keeps everything under ~/.peach; add `--purge` to delete that directory (installed runtimes, device profiles and their app storage, dev-bridge state, config) as well. On macOS the install is refused when the CLI executable is on an external volume, because the background service stalls loading it; install the CLI on the startup disk.',
2097
+ order: 173,
2098
+ usage: [
2099
+ 'peach daemon install [--force]',
2100
+ 'peach daemon uninstall [--purge]',
2101
+ 'peach daemon status',
2102
+ 'peach daemon restart',
2103
+ 'peach daemon start',
2104
+ 'peach daemon stop',
2105
+ 'peach daemon logs [-n <lines>] [-f]',
2106
+ ],
2107
+ options: [
2108
+ option('--force', 'replace an existing daemon registration'),
2109
+ option(
2110
+ '--purge',
2111
+ 'with `uninstall`, also delete ~/.peach: installed runtimes, device profiles and their app storage, dev-bridge state, and config',
2112
+ ),
2113
+ option('-n, --lines <n>', 'number of log lines to show (default 200)'),
2114
+ option('-f, --follow', 'stream new log lines as they arrive'),
2115
+ ],
2116
+ examples: [
2117
+ example('peach daemon install', 'install and start the background bridge'),
2118
+ example('peach daemon status', 'is the bridge daemon registered + alive?'),
2119
+ example('peach daemon restart', 'restart a daemon that stopped responding'),
2120
+ example('peach daemon logs -n 100', 'tail the last 100 daemon log lines'),
2121
+ example(
2122
+ 'peach daemon uninstall',
2123
+ 'remove the launchd/systemd agent and keep your runtimes and profiles',
2124
+ ),
2125
+ example(
2126
+ 'peach daemon uninstall --purge',
2127
+ 'remove the agent and delete ~/.peach, including device profiles',
2128
+ ),
2129
+ ],
2130
+ related: ['setup', 'serve', 'open'],
2131
+ },
2132
+ {
2133
+ id: 'serve',
2134
+ slug: 'serve',
2135
+ navTitle: 'serve',
2136
+ title: 'peach serve',
2137
+ description: 'run the peach bridge in the foreground',
2138
+ summary:
2139
+ 'Host the WS bridge in the foreground. This is mainly for development or diagnosis. `peach open` starts a local bridge when needed; `peach daemon install` enables the faster persistent service for local work. The listener defaults to `127.0.0.1`. In a container, use `--host 0.0.0.0` so the fronting reverse proxy can reach it. Bundle proxy targets remain restricted to loopback inside the container.',
2140
+ order: 175,
2141
+ usage: ['peach serve [options]'],
2142
+ options: [
2143
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
2144
+ option('--host <address>', 'listener address (defaults to 127.0.0.1)'),
2145
+ option('-q, --quiet', 'suppress per-connection logging'),
2146
+ option(
2147
+ '--exit-when-unused',
2148
+ 'the starting process holds stdin; once it closes, exit after no simulator or request has used the bridge for 10 s, or 180 s when nothing has yet',
2149
+ ),
2150
+ ],
2151
+ examples: [
2152
+ example('peach serve'),
2153
+ example('peach serve --quiet'),
2154
+ example('peach serve --port 7668'),
2155
+ example(
2156
+ 'peach serve --host 0.0.0.0',
2157
+ 'expose the bridge to a container reverse proxy',
2158
+ ),
2159
+ ],
2160
+ related: ['setup', 'daemon', 'open'],
2161
+ },
2162
+ {
2163
+ id: 'runtime',
2164
+ slug: 'runtime',
2165
+ navTitle: 'runtime',
2166
+ title: 'peach runtime',
2167
+ description: 'manage engine runtimes under ~/.peach/runtimes/',
2168
+ summary:
2169
+ "Install, list, switch, and remove versioned Peach engine runtimes. The CLI downloads a tarball from the configured CDN, verifies its sha256, and extracts it. The daemon serves the default runtime and updates it hourly in the background. To keep one app on a fixed engine, set `runtimeVersion` in that repo's optional `peach.config.ts`; this does not change other apps. `peach runtime notes` prints release notes for the repo-selected engine, or the machine default when the repo has no selection.",
2170
+ order: 176,
2171
+ usage: [
2172
+ 'peach runtime install [version]',
2173
+ 'peach runtime list',
2174
+ 'peach runtime use <version>',
2175
+ 'peach runtime remove <version>',
2176
+ 'peach runtime which',
2177
+ 'peach runtime notes',
2178
+ ],
2179
+ options: [
2180
+ option('--channel <name>', "channel for 'latest' (default: stable)"),
2181
+ option('--force', 'reinstall even if already on disk'),
2182
+ option(
2183
+ '--no-set-active',
2184
+ "don't switch active runtime after install (also accepts --set-active=false)",
2185
+ ),
2186
+ ],
2187
+ examples: [
2188
+ example('peach runtime install'),
2189
+ example('peach runtime install 1.2.3'),
2190
+ example(
2191
+ 'peach runtime install --channel beta',
2192
+ 'install the latest from a non-stable channel',
2193
+ ),
2194
+ example('peach runtime use 1.2.3'),
2195
+ example('peach runtime list', 'show installed + available versions'),
2196
+ example('peach runtime which', 'print the currently active runtime version'),
2197
+ example('peach runtime notes', 'print release notes for this repo runtime'),
2198
+ example('peach runtime remove 1.2.2'),
2199
+ ],
2200
+ related: ['setup', 'serve', 'daemon', 'version'],
2201
+ },
2202
+ {
2203
+ id: 'upgrade',
2204
+ slug: 'upgrade',
2205
+ navTitle: 'upgrade',
2206
+ title: 'peach upgrade',
2207
+ description: 'update the peach CLI and engine runtime to the latest',
2208
+ summary:
2209
+ "Update both independently versioned parts of peach. The command installs the latest engine runtime, or the repo's configured `runtimeVersion`, then checks the standalone CLI release channel and downloads a newer verified executable when available. It prints the previous and installed runtime versions, the CLI version result, and the engine release notes in the terminal. When the CLI changed and the background daemon is running, the upgraded CLI restarts the daemon onto itself. A new runtime needs no restart: the next new sim opens on it, and sims already open keep the runtime they booted with. The background daemon checks for a new default runtime on startup and hourly; successful interactive human CLI runs refresh the cached CLI release version without blocking the command.",
2210
+ order: 174,
2211
+ usage: ['peach upgrade [--channel <name>] [--to <cli version>]'],
2212
+ options: [
2213
+ option('--channel <name>', "runtime channel for 'latest' (default: stable)"),
2214
+ option(
2215
+ '--to <version>',
2216
+ 'install exactly this CLI release, newer or older; pin the engine runtime with `runtimeVersion` in the project config',
2217
+ ),
2218
+ ],
2219
+ examples: [
2220
+ example('peach upgrade'),
2221
+ example(
2222
+ 'peach upgrade --channel beta',
2223
+ 'install the latest engine runtime from the beta channel',
2224
+ ),
2225
+ example('peach upgrade --to 0.1.669', 'install a specific CLI release to check it'),
2226
+ ],
2227
+ related: ['runtime', 'setup', 'version'],
2228
+ },
2229
+ {
2230
+ id: 'version',
2231
+ slug: 'version',
2232
+ navTitle: 'version',
2233
+ title: 'peach version',
2234
+ description: 'show the CLI + engine runtime versions you are running',
2235
+ summary:
2236
+ 'Show both independently versioned parts: the standalone `peach` CLI executable and the engine runtime rendered by the browser or desktop shell. The command also shows a repo-configured `runtimeVersion`, whether it is installed, the active channel, available CLI or runtime updates, and the official changelog URL. The terse `peach --version` flag keeps the two-line script-friendly output and performs no update check.',
2237
+ order: 173,
2238
+ usage: ['peach version'],
2239
+ options: [],
2240
+ examples: [
2241
+ example('peach version'),
2242
+ example('peach --version', 'terse, script-parseable'),
2243
+ ],
2244
+ related: ['upgrade', 'runtime'],
2245
+ },
2246
+ {
2247
+ id: 'test',
2248
+ slug: 'test',
2249
+ navTitle: 'test',
2250
+ title: 'peach test',
2251
+ description:
2252
+ 'run Maestro flows or Detox suites, author flows, and run them in the cloud',
2253
+ summary:
2254
+ 'One test command for both runners. A YAML flow, a flow directory or a YAML workspace config runs with the Maestro interpreter; a Jest config, a test file or a directory of them runs your existing Detox suite unchanged, since Jest maps `detox` to the Peach driver. With no target it runs `.maestro/` or `maestro/` when present and otherwise lets Detox find its config and suites. Check `--list-compat` before running an existing Maestro suite. `generate` writes a flow from a plain-language goal, and `start`, `keep` and `end` author one from live CLI actions. `compare` runs the same flows on your iOS simulator and on Peach and writes an HTML diff. Add --cloud to submit a prebuilt bundle and the test files to the hosted executor. Running tests needs a signed-in account: `peach login` on a desktop or PEACH_API_KEY elsewhere; authoring a flow live and `init` need none.',
2255
+ order: 39,
2256
+ usage: [
2257
+ 'peach test [flow-or-suite] [--app <bundle|port|url>] [options]',
2258
+ 'peach test <flow-or-suite> --app <bundle> --cloud',
2259
+ 'peach test --cancel <job-id>',
2260
+ 'peach test generate "<goal>"',
2261
+ 'peach test start|keep|end',
2262
+ 'peach test validate <flow>',
2263
+ 'peach test compare <flow-or-dir> [--udid <id>]',
2264
+ 'peach test init [--detox]',
2265
+ 'peach test --list-compat',
2266
+ ],
2267
+ options: [
2268
+ option('--app <bundle>', 'bundle, dev-server target, or shell URL to run'),
2269
+ option(
2270
+ '--env KEY=VALUE',
2271
+ 'set Maestro flow variables for ${KEY} interpolation (repeatable)',
2272
+ ),
2273
+ option('--include-tags <tags>', 'run only Maestro flows with these tags'),
2274
+ option('--exclude-tags <tags>', 'skip Maestro flows with these tags'),
2275
+ option('--format <fmt>', 'junit writes an XML report of Maestro flows'),
2276
+ option(
2277
+ '--output <path>',
2278
+ 'JUnit report path for flows, or the flow path on `test end`',
2279
+ ),
2280
+ option('--record', 'record a webm while each flow runs'),
2281
+ option('--profile', 'capture performance stats while a flow runs'),
2282
+ option('--out <dir>', 'write recordings and screenshots to this directory'),
2283
+ option(
2284
+ '--test-output-dir <dir>',
2285
+ 'save flow artifacts and result JSON here; result JSON defaults to --out or /tmp/peach-recordings',
2286
+ ),
2287
+ option('--preview', 'upload a Recording of events and video and print its link'),
2288
+ option('--preview-open', 'open the uploaded Recording after a successful run'),
2289
+ option('--slow <ms>', 'delay between flow steps for natural pacing'),
2290
+ option('--new', 'force a fresh sim for this run'),
2291
+ option('--headed', 'watch the run in a fresh visible window'),
2292
+ option('--validate', 're-run a live-authored flow before clearing its draft'),
2293
+ option('--config <path>', 'a Maestro workspace config (YAML) or a Jest config'),
2294
+ option(
2295
+ '-t <pattern>',
2296
+ 'run Detox tests whose names match, as Jest --testNamePattern',
2297
+ ),
2298
+ option('--watch', 'Jest watch mode for a Detox suite'),
2299
+ option('--no-launch', 'skip the running-shell check for a Detox suite'),
2300
+ option(
2301
+ '--detox',
2302
+ 'with init, scaffold a Detox config and sample test instead of a flow',
2303
+ ),
2304
+ option('--list-compat', 'print supported and unsupported Maestro verbs'),
2305
+ option('--cloud', 'run the bundle and suite in the cloud and create a Recording'),
2306
+ option('--origin <url>', 'use a specific Peach API origin'),
2307
+ option('--poll-interval <ms>', 'set the hosted result polling interval'),
2308
+ option(
2309
+ '--timeout <ms>',
2310
+ 'bound the hosted result wait; a prebuilt-bundle job keeps running after it',
2311
+ ),
2312
+ option('--cancel <job-id>', 'cancel a hosted job; a queued job is never billed'),
2313
+ ],
2314
+ examples: [
2315
+ example('peach test .maestro/login.yaml --app http://localhost:8081'),
2316
+ example('peach test .maestro/ --env USERNAME=alice'),
2317
+ example('peach test e2e/ --app 8081', 'run a Detox suite'),
2318
+ example('peach test e2e/login.test.ts --app http://localhost:8081 -t "login"'),
2319
+ example('peach test generate "log in and verify the welcome screen"'),
2320
+ example('peach test start', 'begin a live-authored flow'),
2321
+ example('peach test end --output .maestro/login.yaml --validate'),
2322
+ example('peach test compare .maestro/ --udid <simulator-udid>'),
2323
+ example('peach test init', 'scaffold .maestro/login.yaml'),
2324
+ example('peach test .maestro/login.yaml --app ./dist/main.js --cloud'),
2325
+ ],
2326
+ related: ['record', 'login', 'auth'],
2327
+ },
2328
+ {
2329
+ id: 'device',
2330
+ slug: 'device',
2331
+ navTitle: 'device',
2332
+ title: 'peach device',
2333
+ description: 'inspect or change the live device preset for a sim',
2334
+ summary:
2335
+ 'Read the current device preset, switch it on the fly, or list the available models. Switching a preset reshapes the running sim (screen size, density, and chrome) without restarting the bundle. On the foldable iPhone Duo, `posture` reads or drives the fold to any of its rests (closed, book, open, and the two that stand the body on its edge, laptop and tent) through the same typed command as the pose buttons, and returns once the hinge rests there, so the app sees the same fold and reserved regions as from the rail.',
2336
+ order: 78,
2337
+ usage: [
2338
+ 'peach device',
2339
+ 'peach device get',
2340
+ 'peach device set <model> [--sim <id>]',
2341
+ 'peach device list',
2342
+ 'peach device posture [closed|book|open|laptop|tent|toggle] [--sim <id>]',
2343
+ ],
2344
+ options: [
2345
+ option('--sim <sim>', 'target a specific connected sim when setting'),
2346
+ option('--port <number>', 'bridge port (defaults to {{bridgePort}})'),
2347
+ ],
2348
+ examples: [
2349
+ example('peach device', 'show the active device preset'),
2350
+ example('peach device list', 'list every available model id'),
2351
+ example('peach device set iphone-16'),
2352
+ example('peach device set iphone-16-pro-max --sim a7'),
2353
+ example('peach device posture open', 'fold the iphone duo open'),
2354
+ example(
2355
+ 'peach device posture laptop',
2356
+ 'stand the iphone duo half open on its edge',
2357
+ ),
2358
+ ],
2359
+ related: ['mode', 'screenshot', 'open', 'list'],
2360
+ },
2361
+ {
2362
+ id: 'skill',
2363
+ slug: 'skill',
2364
+ navTitle: 'skill',
2365
+ title: 'peach skill',
2366
+ description: 'install and inspect bundled peach agent skills',
2367
+ summary:
2368
+ 'Install bundled peach agent skills into agent-compatible skill directories, or print the bundled skill markdown. `install` defaults to all supported local agent homes; pass `codex` or `claude` to target one.',
2369
+ order: 122,
2370
+ usage: [
2371
+ 'peach skill install [all|codex|claude] [skill-name...]',
2372
+ 'peach skill install --target <dir> [skill-name...]',
2373
+ 'peach skill show [skill-name]',
2374
+ ],
2375
+ options: [
2376
+ option('install', 'install skills; no target means all supported local agents'),
2377
+ option('show', 'list bundled skills, or print one skill markdown'),
2378
+ option('--target <dir>', 'install into an explicit skill directory'),
2379
+ ],
2380
+ examples: [
2381
+ example('peach skill install'),
2382
+ example('peach skill install codex'),
2383
+ example('peach skill install codex peach-debug'),
2384
+ example('peach skill show'),
2385
+ example('peach skill show peach-debug'),
2386
+ ],
2387
+ related: ['debug'],
2388
+ },
2389
+ {
2390
+ id: 'agent',
2391
+ slug: 'agent',
2392
+ navTitle: 'agent',
2393
+ title: 'peach agent',
2394
+ description: 'inspect messages, attached projects, and local agent sessions',
2395
+ summary:
2396
+ 'Receive inspect messages from the active Peach simulator with any coding agent. `listen` drains one pending message or waits for the next one, saves full describe, inspect JSON, and screenshot evidence under the OS temporary directory, then exits. `info` prints the complete saved bundle. The remaining commands manage Peach-hosted Codex and Claude sessions.',
2397
+ order: 125,
2398
+ usage: [
2399
+ 'peach agent attach <dir> [--name <label>] [--provider codex|claude]',
2400
+ 'peach agent projects',
2401
+ 'peach agent project show <id>',
2402
+ 'peach agent project remove <id>',
2403
+ 'peach agent sessions [--project <id>] [--all]',
2404
+ 'peach agent start <projectId> [--provider codex|claude]',
2405
+ 'peach agent prompt <sessionId> "<text>"',
2406
+ 'peach agent watch <sessionId>',
2407
+ 'peach agent listen [--sim <id>]',
2408
+ 'peach agent info <message-id>',
2409
+ 'peach agent transcript <sessionId>',
2410
+ 'peach agent end <sessionId>',
2411
+ 'peach agent paths',
2412
+ ],
2413
+ options: [
2414
+ option('--name <label>', 'human-readable label when attaching a project'),
2415
+ option(
2416
+ '--provider <id>',
2417
+ 'agent backend: codex (default) or claude; used by attach + start',
2418
+ ),
2419
+ option('--project <id>', 'filter sessions to a specific attached project'),
2420
+ option('--all', 'include ended sessions (sessions defaults to active only)'),
2421
+ option('--sim <id>', 'listen for inspect messages from a specific sim'),
2422
+ ],
2423
+ examples: [
2424
+ example('peach agent attach ~/projects/three-punch --name 3pc'),
2425
+ example('peach agent projects', 'list every attached project'),
2426
+ example('peach agent project show 3pc'),
2427
+ example(
2428
+ 'peach agent start 3pc --provider claude',
2429
+ 'spawn a wrapper session (detached) inside the attached project',
2430
+ ),
2431
+ example(
2432
+ 'peach agent prompt <sessionId> "fix the failing scroll test"',
2433
+ 'enqueue a prompt; the daemon delivers it to the wrapper',
2434
+ ),
2435
+ example('peach agent watch <sessionId>', 'tail events.out pretty-printed'),
2436
+ example(
2437
+ 'peach agent listen',
2438
+ 'receive one pending inspect message or wait for the next one',
2439
+ ),
2440
+ example(
2441
+ 'peach agent info <message-id>',
2442
+ 'print the complete saved evidence bundle',
2443
+ ),
2444
+ example('peach agent sessions --all', 'include ended sessions in the list'),
2445
+ example('peach agent transcript <sessionId>'),
2446
+ example('peach agent end <sessionId>'),
2447
+ example('peach agent paths', 'print userData + state file locations'),
2448
+ ],
2449
+ related: ['skill', 'auth', 'login'],
2450
+ },
2451
+ {
2452
+ id: 'auth',
2453
+ slug: 'auth',
2454
+ navTitle: 'auth',
2455
+ title: 'peach auth',
2456
+ description: 'inspect active CLI auth',
2457
+ summary:
2458
+ 'Print the auth source the CLI will use, and for a desktop session the account that remote simulators bill to. An API key comes from PEACH_API_KEY or the one `peach setup` saved. Use `peach login` and `peach logout` for the browser-backed desktop session.',
2459
+ order: 190,
2460
+ usage: ['peach auth', 'peach auth key create [--label <name>]'],
2461
+ options: [
2462
+ option(
2463
+ 'key create',
2464
+ 'create an API key for the signed-in account, free on every plan, and print it once; needs `peach login` first',
2465
+ ),
2466
+ option('PEACH_API_KEY', 'env var for API-key auth; it wins over a saved key'),
2467
+ ],
2468
+ examples: [example('peach auth', 'show the active auth source')],
2469
+ related: ['login', 'logout', 'record', 'test'],
2470
+ },
2471
+ {
2472
+ id: 'login',
2473
+ slug: 'login',
2474
+ navTitle: 'login',
2475
+ title: 'peach login',
2476
+ description: 'sign in to publish Builds and Recordings',
2477
+ summary:
2478
+ 'Sign in with the browser-backed desktop session so uploads and App Store screenshot capture can attach to your account. Local development origins use the dev-login fast path; CI should pass PEACH_API_KEY instead.',
2479
+ order: 191,
2480
+ usage: ['peach login [--origin <url>] [--account <name-or-id>]'],
2481
+ options: [
2482
+ option(
2483
+ '--origin <url>',
2484
+ 'auth host (default: https://peachsim.com; override with PEACH_AUTH_ORIGIN or PEACH_UPLOAD_ORIGIN)',
2485
+ ),
2486
+ option(
2487
+ '--account <name-or-id>',
2488
+ 'the account remote simulators bill to. With one account it is chosen for you; with several, an interactive login asks and a non-interactive one needs this flag',
2489
+ ),
2490
+ ],
2491
+ examples: [
2492
+ example('peach login'),
2493
+ example(
2494
+ 'peach login --account "Example Org"',
2495
+ 'sign in and bill cloud work to a team',
2496
+ ),
2497
+ example('peach login --origin https://localhost:3000'),
2498
+ ],
2499
+ related: ['auth', 'logout', 'record', 'test'],
2500
+ },
2501
+ {
2502
+ id: 'logout',
2503
+ slug: 'logout',
2504
+ navTitle: 'logout',
2505
+ title: 'peach logout',
2506
+ description: 'clear the local desktop auth session',
2507
+ summary:
2508
+ 'Clear the browser-backed desktop session written by `peach login` and the API key `peach setup` saved. PEACH_API_KEY and GitHub runner auth are environment-provided and are not affected.',
2509
+ order: 192,
2510
+ usage: ['peach logout'],
2511
+ examples: [example('peach logout')],
2512
+ related: ['auth', 'login'],
2513
+ },
2514
+ {
2515
+ id: 'config',
2516
+ slug: 'config',
2517
+ navTitle: 'config',
2518
+ title: 'peach config',
2519
+ description: 'manage local CLI preferences',
2520
+ summary:
2521
+ 'Manage local preferences that affect the CLI and desktop companion. Telemetry is persisted in ~/.peach/config.json. Set PEACH_HINTS=off to suppress CLI hints. Set PEACH_UPDATE_CHECK=off to disable automatic CLI checks, runtime updates, and their notices.',
2522
+ order: 195,
2523
+ usage: ['peach config telemetry [on|off|status]'],
2524
+ examples: [
2525
+ example('peach config telemetry', 'show the current opt-out state and config path'),
2526
+ example(
2527
+ 'peach config telemetry off',
2528
+ 'disable bounded CLI diagnostics and crash reports on this installation',
2529
+ ),
2530
+ example('PEACH_HINTS=off peach describe', 'suppress hints for a single run'),
2531
+ example(
2532
+ 'PEACH_UPDATE_CHECK=off peach describe',
2533
+ 'disable the background CLI update check and notice for a run',
2534
+ ),
2535
+ ],
2536
+ related: ['auth'],
2537
+ },
2538
+ ]
2539
+
2540
+ export const cliCommandMetaById = new Map(cliCommandMetas.map((meta) => [meta.id, meta]))
2541
+
2542
+ const cliCommandMetaByName = new Map<string, CliCommandMeta>()
2543
+ for (const meta of cliCommandMetas) {
2544
+ cliCommandMetaByName.set(meta.id, meta)
2545
+ for (const alias of meta.aliases || []) {
2546
+ cliCommandMetaByName.set(alias, meta)
2547
+ }
2548
+ }
2549
+
2550
+ export function getCliCommandMeta(name: string) {
2551
+ return cliCommandMetaByName.get(name)
2552
+ }
2553
+
2554
+ // per-verb help entries. shown when a grouping-verb --help falls through
2555
+ // to a specific inner verb, e.g. `peach do tap --help` resolves to the
2556
+ // `tap` entry below instead of the generic `do` page. bin.ts handles the
2557
+ // lookup; this simle just supplies the content.
2558
+ interface VerbExtras {
2559
+ group?: string
2560
+ subgroup?: string
2561
+ shortDescription?: string
2562
+ seeAlso?: string[]
2563
+ options?: CliOptionMeta[]
2564
+ order?: number
2565
+ }
2566
+
2567
+ function verb(
2568
+ v: string,
2569
+ description: string,
2570
+ usage: string[],
2571
+ examples?: CliExampleMeta[],
2572
+ notes?: string,
2573
+ extras?: VerbExtras,
2574
+ ): CliInspectVerbMeta {
2575
+ return { verb: v, description, usage, examples, notes, ...extras }
2576
+ }
2577
+
2578
+ export const cliInspectVerbMetas: CliInspectVerbMeta[] = [
2579
+ verb(
2580
+ 'describe',
2581
+ 'show visible UI elements with type, text, position, size, and style. formats the pruned visible semantic tree.',
2582
+ [
2583
+ 'peach describe [filter] [--verbose] [--watch] [--json] [--compact] [--no-xy] [--only <glob>] [--subtree <id>] [--testid-like <pat>]',
2584
+ ],
2585
+ [
2586
+ example('peach describe'),
2587
+ example('peach describe button'),
2588
+ example('peach describe --verbose'),
2589
+ example('peach describe --json'),
2590
+ example('peach describe --watch'),
2591
+ example('peach describe --compact --no-xy', 'tighter tree without coords'),
2592
+ example(
2593
+ 'peach describe --subtree feedListRoot',
2594
+ 'limit the dump to a subtree rooted at testID feedListRoot',
2595
+ ),
2596
+ example('peach describe --only "*Header*"', 'glob-match across text/role/testID'),
2597
+ example(
2598
+ 'peach describe --testid-like login',
2599
+ 'fuzzy-match nodes whose testID contains "login"',
2600
+ ),
2601
+ ],
2602
+ 'buttons show [button], tappable views show [tap], inputs show [input]. structural noise (icon wrappers, layout containers, duplicate text inside buttons) is pruned by the semantic inspection tree.',
2603
+ {
2604
+ shortDescription: 'curated human-readable UI summary (default inspection tool)',
2605
+ options: [
2606
+ option('--verbose', 'include ids, labels, and extra style info'),
2607
+ option('--watch', 'redraw as the UI changes (ctrl-c to stop)'),
2608
+ option('--json', 'emit structured JSON'),
2609
+ option('--compact', 'render the tree in a tighter format'),
2610
+ option('--no-xy', 'hide x,y coordinates from each row'),
2611
+ option(
2612
+ '--only <glob>',
2613
+ 'glob filter across text/role/testID; preferred when the bare positional would be ambiguous',
2614
+ ),
2615
+ option(
2616
+ '--subtree <id>',
2617
+ 'limit the dump to a subtree rooted at the given testID',
2618
+ ),
2619
+ option(
2620
+ '--testid-like <pattern>',
2621
+ 'fuzzy-match nodes whose testID contains the pattern (substring + case-insensitive)',
2622
+ ),
2623
+ ],
2624
+ seeAlso: ['tree', 'a11y', 'find'],
2625
+ },
2626
+ ),
2627
+ verb(
2628
+ 'find',
2629
+ 'unified finder (text, testid, role, type, pressable, visible, interactive-targets)',
2630
+ [
2631
+ 'peach find <text>',
2632
+ 'peach find --text <text>',
2633
+ 'peach find --testid <id>',
2634
+ 'peach find --role <role>',
2635
+ 'peach find --type <component-type>',
2636
+ 'peach find --pressable',
2637
+ 'peach find --visible',
2638
+ 'peach find --interactive-targets',
2639
+ ],
2640
+ [
2641
+ example('peach find "Sign in"'),
2642
+ example('peach find --testid loginButton'),
2643
+ example('peach find --role button'),
2644
+ example('peach find --pressable'),
2645
+ example('peach find --visible --json'),
2646
+ example('peach find --testid loginButton --verbose'),
2647
+ example(
2648
+ 'peach find --interactive-targets',
2649
+ 'ranked list of visible+pressable nodes with copy-paste tap commands',
2650
+ ),
2651
+ example('peach find --actions', 'alias for --interactive-targets'),
2652
+ ],
2653
+ "bare text matches findByText. flag-based forms replace the old `find-id` and `query <predicate>` subcommands. use --verbose to dump the full node JSON for each result instead of the one-liner summary. `--interactive-targets` (alias `--actions`) ranks visible+pressable nodes and emits a `peach do tap-...` command per row so the agent's next tap is one copy away.",
2654
+ {
2655
+ shortDescription: 'locate nodes by text / testID / role / type / predicate',
2656
+ options: [
2657
+ option('--text <text>', 'match node text content (same as bare positional)'),
2658
+ option('--testid <id>', 'match node testID or id exactly'),
2659
+ option('--role <role>', 'match accessibilityRole'),
2660
+ option(
2661
+ '--type <type>',
2662
+ 'match engine node type (view, text, ...), not a React component name',
2663
+ ),
2664
+ option(
2665
+ '--pressable',
2666
+ 'list all tappable nodes. an empty result is not proof a screen has no affordance: it lists registered touch responders, and a styled() view whose onPress comes from the call site is tappable without appearing here',
2667
+ ),
2668
+ option('--visible', 'list all visible (non-zero) nodes'),
2669
+ option(
2670
+ '--interactive-targets, --actions',
2671
+ 'ranked tappable nodes with per-row tap command (best demo "next tap" picker)',
2672
+ ),
2673
+ option(
2674
+ '--verbose, --dump',
2675
+ 'emit full node JSON for each result, not a one-liner',
2676
+ ),
2677
+ option('--json', 'emit structured JSON'),
2678
+ ],
2679
+ seeAlso: ['describe', 'node', 'selector'],
2680
+ },
2681
+ ),
2682
+ verb(
2683
+ 'count',
2684
+ 'show total node count',
2685
+ ['peach get count [--json]'],
2686
+ [example('peach get count'), example('peach get count --json')],
2687
+ undefined,
2688
+ {
2689
+ group: 'get',
2690
+ subgroup: 'tree',
2691
+ shortDescription: 'total node count',
2692
+ options: [option('--json', 'emit { nodes: n } for scripts')],
2693
+ },
2694
+ ),
2695
+ verb(
2696
+ 'layout',
2697
+ 'measure layout: bare for every visible element on the screen (box + radius/padding/fontSize), or with an id for one node',
2698
+ ['peach get layout [id] [--json]'],
2699
+ [
2700
+ example(
2701
+ 'peach get layout',
2702
+ 'every visible element: on-screen box (x/y/w/h) + borderRadius, per-side padding, fontSize',
2703
+ ),
2704
+ example('peach get layout --json', 'machine-readable { count, elements }'),
2705
+ example(
2706
+ 'peach get layout loginButton',
2707
+ 'single node {x, y, width, height} by id/testID',
2708
+ ),
2709
+ ],
2710
+ 'bare `get layout` is the screen-wide measurement designers reach for to check spacing/sizing/radius/type-scale parity: more detailed than describe, which gives the element tree but not these numbers. it runs the same shared extractor as the agent app_get_layout tool, so CLI and agent output match. pass an id for the single-node layout lookup.',
2711
+ {
2712
+ group: 'get',
2713
+ subgroup: 'tree',
2714
+ shortDescription: 'screen-wide box + radius/padding/fontSize (or one node by id)',
2715
+ options: [option('--json', 'emit { count, elements } for scripts')],
2716
+ seeAlso: ['describe', 'find', 'node'],
2717
+ },
2718
+ ),
2719
+ verb(
2720
+ 'tree',
2721
+ 'dump the node tree',
2722
+ ['peach get tree [depth] [--json] [--boxes]'],
2723
+ [
2724
+ example('peach get tree'),
2725
+ example('peach get tree 3'),
2726
+ example('peach get tree --json'),
2727
+ example('peach get tree --boxes --json', 'structured rects for the whole tree'),
2728
+ ],
2729
+ 'raw, depth-limited tree dump. good for machine consumption and debugging when describe has filtered something out. for day-to-day inspection prefer describe. --boxes swaps the text dump for a structured nested tree with absolute device-local rects and colors ({ type, testID?, text?, x, y, w, h, bg?, fg?, br?, children? }), the geometry source for layout tooling; its default depth is 50.',
2730
+ {
2731
+ group: 'get',
2732
+ subgroup: 'tree',
2733
+ shortDescription: 'raw node tree dump (default depth 5)',
2734
+ options: [
2735
+ option('--json', 'emit { depth, tree } for scripts'),
2736
+ option('--boxes', 'structured nested rects instead of the text dump'),
2737
+ ],
2738
+ seeAlso: ['describe', 'a11y', 'node'],
2739
+ },
2740
+ ),
2741
+ verb(
2742
+ 'a11y',
2743
+ 'dump the accessibility tree with roles and labels',
2744
+ ['peach get a11y [depth]'],
2745
+ [example('peach get a11y')],
2746
+ 'only accessibility-relevant fields (role, label, hint). for native rendered text contrast use get layout --styling; for general inspection use describe; for raw tree use get tree.',
2747
+ {
2748
+ group: 'get',
2749
+ subgroup: 'tree',
2750
+ shortDescription: 'accessibility tree (roles, labels, hints)',
2751
+ seeAlso: ['describe', 'tree', 'layout'],
2752
+ },
2753
+ ),
2754
+ verb(
2755
+ 'node',
2756
+ 'resolve testID/id/text to a full node JSON',
2757
+ ['peach get node <matcher>'],
2758
+ [example('peach get node loginButton'), example('peach get node "Sign in"')],
2759
+ undefined,
2760
+ {
2761
+ group: 'get',
2762
+ subgroup: 'tree',
2763
+ shortDescription: 'resolve testID → id → text, full node JSON',
2764
+ seeAlso: ['find', 'layout'],
2765
+ },
2766
+ ),
2767
+ verb(
2768
+ 'tap',
2769
+ 'tap a testID, absolute coordinates, or a node resolved from --testid / --text',
2770
+ [
2771
+ 'peach do tap <testid>',
2772
+ 'peach do tap <x> <y>',
2773
+ 'peach do tap --testid <id>',
2774
+ 'peach do tap --text <text>',
2775
+ ],
2776
+ [
2777
+ example('peach do tap loginButton'),
2778
+ example('peach do tap 196 400'),
2779
+ example('peach do tap --testid loginButton'),
2780
+ example('peach do tap --text "Sign in"'),
2781
+ ],
2782
+ 'the default way to tap by id. a bare non-numeric argument is a testID, so `do tap loginButton`, `do tap --testid loginButton` and `do tap-id loginButton` are the same command (double-tap and long-press take it too). uses the internal interaction bridge (fireTap), not real PointerEvent dispatch. for gesture-handler debugging, use drag/swipe which dispatch real pointer events.',
2783
+ {
2784
+ group: 'do',
2785
+ subgroup: 'targeting',
2786
+ shortDescription: 'tap a testID, absolute coords, or --testid / --text',
2787
+ seeAlso: ['tap-id', 'tap-text', 'double-tap', 'long-press'],
2788
+ order: 10,
2789
+ },
2790
+ ),
2791
+ verb(
2792
+ 'double-tap',
2793
+ 'tap the same spot twice with a short gap',
2794
+ [
2795
+ 'peach do double-tap <testid> [gapMs]',
2796
+ 'peach do double-tap <x> <y> [gapMs]',
2797
+ 'peach do double-tap --testid <id> [gapMs]',
2798
+ ],
2799
+ [
2800
+ example('peach do double-tap myButton'),
2801
+ example('peach do double-tap 196 400'),
2802
+ example('peach do double-tap --testid myButton 80'),
2803
+ ],
2804
+ 'uses the shared interact bridge so text selection and other double-tap gestures run through the same path as live taps.',
2805
+ {
2806
+ group: 'do',
2807
+ subgroup: 'targeting',
2808
+ shortDescription: 'tap the same coordinates twice quickly',
2809
+ seeAlso: ['tap'],
2810
+ order: 20,
2811
+ },
2812
+ ),
2813
+ verb(
2814
+ 'tap-text',
2815
+ 'find a node by text content and tap its center',
2816
+ [
2817
+ 'peach do tap-text <text> [--nth <n>] [--within <testID>]',
2818
+ ' [--min-y <px>] [--max-y <px>] [--min-x <px>] [--max-x <px>]',
2819
+ ' [--near <x> <y>] [--exact] [--role <role>] [--first]',
2820
+ ],
2821
+ [
2822
+ example('peach do tap-text "Sign in"'),
2823
+ example('peach do tap-text Swap --within sheet-container'),
2824
+ example('peach do tap-text Swap --min-y 700'),
2825
+ example('peach do tap-text Cancel --nth 2'),
2826
+ example('peach do tap-text OK --near 283 784'),
2827
+ ],
2828
+ 'matches visible text or accessibility labels and resolves the selected node to its tap target. default selection prefers controls and their captions over static prose, then a label equal to the query over one that only contains it ("Allow" over "Don\'t Allow"). multiple matching controls remain ambiguous. --nth, --first and --near select from all filtered matches. do tap --text uses the same selection and flags.',
2829
+ {
2830
+ group: 'do',
2831
+ subgroup: 'targeting',
2832
+ shortDescription: 'tap a text or accessibility label with disambiguation flags',
2833
+ options: [
2834
+ option('--nth <n>', 'pick the nth visible match (supports -1)'),
2835
+ option('--within <testID>', 'descendants of a testID ancestor only'),
2836
+ option('--min-y <px>', 'absolute y-position floor'),
2837
+ option('--max-y <px>', 'absolute y-position ceiling'),
2838
+ option('--min-x <px>', 'absolute x-position floor'),
2839
+ option('--max-x <px>', 'absolute x-position ceiling'),
2840
+ option('--near <x> <y>', 'pick the closest match to a coordinate'),
2841
+ option('--exact', 'exact text match (default: substring)'),
2842
+ option('--role <role>', 'narrow to accessibilityRole'),
2843
+ option('--first', 'keep legacy pick-first-silently behavior'),
2844
+ ],
2845
+ seeAlso: ['tap', 'tap-id', 'find'],
2846
+ order: 30,
2847
+ },
2848
+ ),
2849
+ verb(
2850
+ 'tap-id',
2851
+ 'alias of `tap <testid>` that always reads its argument as a testID, numeric ids included',
2852
+ ['peach do tap-id <id>'],
2853
+ [example('peach do tap-id loginButton')],
2854
+ undefined,
2855
+ {
2856
+ group: 'do',
2857
+ subgroup: 'targeting',
2858
+ shortDescription: 'alias of tap <testid>',
2859
+ seeAlso: ['tap', 'tap-text', 'tap-best'],
2860
+ order: 40,
2861
+ },
2862
+ ),
2863
+ verb(
2864
+ 'tap-best',
2865
+ 'tap by query: try testID first, then visible text. one command, two strategies',
2866
+ ['peach do tap-best <query>'],
2867
+ [
2868
+ example(
2869
+ 'peach do tap-best "Create expense"',
2870
+ 'agent doesn\'t need to know whether "Create expense" is a testID or text',
2871
+ ),
2872
+ example('peach do tap-best floating-action-button'),
2873
+ ],
2874
+ 'tries testID first, then the same default text selection as tap-text. prints which strategy matched. multiple matching controls fail immediately; use tap-text with --nth, --within or --near to choose one.',
2875
+ {
2876
+ group: 'do',
2877
+ subgroup: 'targeting',
2878
+ shortDescription: 'testID-first, text-fallback robust tap',
2879
+ seeAlso: ['tap-id', 'tap-text', 'find'],
2880
+ order: 41,
2881
+ },
2882
+ ),
2883
+ verb(
2884
+ 'scan',
2885
+ 'inject a synthetic barcode scan into the active expo-camera scan session',
2886
+ ['peach do scan <text> [--format <web-format>]'],
2887
+ [
2888
+ example('peach do scan "https://example.com/pair/abc123"'),
2889
+ example(
2890
+ 'peach do scan "myapp://connect?token=abc" --format qr_code',
2891
+ 'drive a connect-by-QR flow',
2892
+ ),
2893
+ ],
2894
+ 'fails when no guest CameraView is actively scanning. the event flows through the same host → worker → native seam path as a real BarcodeDetector hit.',
2895
+ {
2896
+ group: 'do',
2897
+ subgroup: 'native device',
2898
+ shortDescription: 'inject a barcode scan into active camera scanning',
2899
+ options: [
2900
+ option('--format <f>', 'BarcodeDetector format string (default: qr_code)'),
2901
+ ],
2902
+ seeAlso: ['tap', 'wait'],
2903
+ order: 10,
2904
+ },
2905
+ ),
2906
+ verb(
2907
+ 'type',
2908
+ 'type text through the iOS keyboard (requires a focused input)',
2909
+ ['peach do type <text>'],
2910
+ [example('peach do type "hello world"')],
2911
+ 'a text input must be focused first via tap-id or tap-text. if no input is focused, this silently does nothing.',
2912
+ {
2913
+ group: 'do',
2914
+ subgroup: 'text input',
2915
+ shortDescription: 'type through the iOS visual keyboard',
2916
+ seeAlso: ['type-into', 'key', 'dismiss'],
2917
+ order: 10,
2918
+ },
2919
+ ),
2920
+ verb(
2921
+ 'type-into',
2922
+ 'find an input by testID, tap to focus, then type text',
2923
+ ['peach do type-into <id> <text>'],
2924
+ [example('peach do type-into kav-input "hello world"')],
2925
+ 'combines tap-id + type in one command. warns if the target is not a text input or if the keyboard did not open.',
2926
+ {
2927
+ group: 'do',
2928
+ subgroup: 'text input',
2929
+ shortDescription: 'focus input by testID then type',
2930
+ seeAlso: ['type', 'tap-id'],
2931
+ order: 20,
2932
+ },
2933
+ ),
2934
+ verb(
2935
+ 'key',
2936
+ 'press a special keyboard key',
2937
+ ['peach do key <name>'],
2938
+ [example('peach do key return'), example('peach do key delete')],
2939
+ 'valid keys: return, delete, space, shift, 123, ABC, #+=, num-back',
2940
+ {
2941
+ group: 'do',
2942
+ subgroup: 'text input',
2943
+ shortDescription: 'special key (return, delete, space, shift, ...)',
2944
+ seeAlso: ['key-sequence', 'keycode'],
2945
+ order: 30,
2946
+ },
2947
+ ),
2948
+ verb(
2949
+ 'key-sequence',
2950
+ 'press multiple visual keyboard keys in order',
2951
+ ['peach do key-sequence <key> [<key> ...]'],
2952
+ [example('peach do key-sequence shift h i')],
2953
+ undefined,
2954
+ {
2955
+ group: 'do',
2956
+ subgroup: 'text input',
2957
+ shortDescription: 'press multiple visual keyboard keys',
2958
+ seeAlso: ['key', 'keycode'],
2959
+ order: 40,
2960
+ },
2961
+ ),
2962
+ verb(
2963
+ 'keycode',
2964
+ 'press DOM-style key codes through the visual keyboard',
2965
+ ['peach do keycode <code> [<code> ...]'],
2966
+ [example('peach do keycode ShiftLeft KeyH KeyI')],
2967
+ undefined,
2968
+ {
2969
+ group: 'do',
2970
+ subgroup: 'text input',
2971
+ shortDescription: 'press DOM-style key codes via visual keyboard',
2972
+ seeAlso: ['key', 'key-sequence'],
2973
+ order: 50,
2974
+ },
2975
+ ),
2976
+ verb('dismiss', 'dismiss the keyboard', ['peach do dismiss'], undefined, undefined, {
2977
+ group: 'do',
2978
+ subgroup: 'text input',
2979
+ shortDescription: 'dismiss the iOS keyboard',
2980
+ order: 60,
2981
+ }),
2982
+ verb(
2983
+ 'scroll',
2984
+ 'scroll a scrollview by testID',
2985
+ ['peach do scroll <id> <x> <y>', 'peach do scroll --testid <id> <x> <y>'],
2986
+ [
2987
+ example('peach do scroll feed-list 0 500'),
2988
+ example('peach do scroll --testid feed-list 0 500'),
2989
+ ],
2990
+ undefined,
2991
+ {
2992
+ group: 'do',
2993
+ subgroup: 'gestures',
2994
+ shortDescription: 'scroll a ScrollView by testID',
2995
+ seeAlso: ['gesture', 'swipe'],
2996
+ order: 10,
2997
+ },
2998
+ ),
2999
+ verb(
3000
+ 'drag',
3001
+ 'drag from one point to another using real PointerEvent dispatch',
3002
+ ['peach do drag <x1> <y1> <x2> <y2> [steps] [stepMs]'],
3003
+ [example('peach do drag 200 400 200 200 20 16')],
3004
+ 'dispatches real PointerEvents to the canvas, unlike tap which uses the internal bridge. use this for gesture-handler and responder chain debugging.',
3005
+ {
3006
+ group: 'do',
3007
+ subgroup: 'gestures',
3008
+ shortDescription: 'drag via real PointerEvents',
3009
+ seeAlso: ['swipe', 'touch', 'pinch'],
3010
+ order: 20,
3011
+ },
3012
+ ),
3013
+ verb(
3014
+ 'swipe',
3015
+ 'swipe gesture (drag with fewer steps)',
3016
+ ['peach do swipe <x1> <y1> <x2> <y2> [steps] [stepMs]'],
3017
+ [example('peach do swipe 350 400 50 400 10 16')],
3018
+ undefined,
3019
+ {
3020
+ group: 'do',
3021
+ subgroup: 'gestures',
3022
+ shortDescription: 'drag with faster defaults',
3023
+ seeAlso: ['drag', 'gesture'],
3024
+ order: 30,
3025
+ },
3026
+ ),
3027
+ verb(
3028
+ 'long-press',
3029
+ 'hold a press on a testID or at coordinates',
3030
+ [
3031
+ 'peach do long-press <testid> [durationMs]',
3032
+ 'peach do long-press <x> <y> [durationMs]',
3033
+ 'peach do long-press --testid <id> [durationMs]',
3034
+ ],
3035
+ [
3036
+ example('peach do long-press myButton 600'),
3037
+ example('peach do long-press 196 400 600'),
3038
+ example('peach do long-press --testid myButton 600'),
3039
+ ],
3040
+ undefined,
3041
+ {
3042
+ group: 'do',
3043
+ subgroup: 'gestures',
3044
+ shortDescription: 'hold a press on a testID or at coordinates',
3045
+ seeAlso: ['tap', 'gesture'],
3046
+ order: 40,
3047
+ },
3048
+ ),
3049
+ verb(
3050
+ 'touch',
3051
+ 'low-level touch primitives; a pointer lives within one batch, so chain its phases with --then',
3052
+ ['peach do touch <down|move|up|cancel> <x> <y> [pointerId] --then touch ...'],
3053
+ [
3054
+ example(
3055
+ 'peach do touch down 200 720 --then sleep 0.3 --then touch move 200 400 --then touch up 200 400',
3056
+ ),
3057
+ ],
3058
+ undefined,
3059
+ {
3060
+ group: 'do',
3061
+ subgroup: 'gestures',
3062
+ shortDescription: 'low-level touch primitives',
3063
+ seeAlso: ['drag', 'pinch'],
3064
+ order: 50,
3065
+ },
3066
+ ),
3067
+ verb(
3068
+ 'gesture',
3069
+ 'preset gestures such as scrolls and edge swipes',
3070
+ ['peach do gesture <preset> [durationMs]'],
3071
+ [
3072
+ example(
3073
+ 'peach do gesture scroll-up|scroll-down|scroll-left|scroll-right|swipe-from-left-edge|swipe-from-right-edge|swipe-from-top-edge|swipe-from-bottom-edge',
3074
+ 'every preset',
3075
+ ),
3076
+ example('peach do gesture swipe-from-left-edge'),
3077
+ example('peach do gesture swipe-from-bottom-edge'),
3078
+ example('peach do gesture scroll-up 250'),
3079
+ ],
3080
+ undefined,
3081
+ {
3082
+ group: 'do',
3083
+ subgroup: 'gestures',
3084
+ shortDescription: 'preset gestures (scroll / edge swipes)',
3085
+ seeAlso: ['swipe', 'scroll'],
3086
+ order: 60,
3087
+ },
3088
+ ),
3089
+ verb(
3090
+ 'pinch',
3091
+ 'two-pointer pinch helper',
3092
+ ["peach do pinch <x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]"],
3093
+ [example('peach do pinch 120 320 280 320 90 320 310 320')],
3094
+ undefined,
3095
+ {
3096
+ group: 'do',
3097
+ subgroup: 'gestures',
3098
+ shortDescription: 'two-pointer pinch helper',
3099
+ seeAlso: ['touch', 'gesture'],
3100
+ order: 70,
3101
+ },
3102
+ ),
3103
+ verb(
3104
+ 'state',
3105
+ 'dump raw runtime state (shell, worker, keyboard, node, scroll, hit, gesture, ownership)',
3106
+ [
3107
+ 'peach debug state <kind> [args]',
3108
+ 'peach debug state shell',
3109
+ 'peach debug state keyboard',
3110
+ 'peach debug state node <id>',
3111
+ 'peach debug state hit <x> <y>',
3112
+ 'peach debug state gesture <x> <y>',
3113
+ 'peach debug state ownership',
3114
+ 'peach debug state worklets',
3115
+ ],
3116
+ [
3117
+ example('peach debug state shell'),
3118
+ example('peach debug state keyboard'),
3119
+ example('peach debug state node photos'),
3120
+ example('peach debug state hit 200 720'),
3121
+ example(
3122
+ 'peach debug state ownership',
3123
+ 'authoritative surface-ownership + pointer-delivery snapshot to diagnose "which surface owns this region"',
3124
+ ),
3125
+ example(
3126
+ 'peach debug state worklets',
3127
+ 'tenant + shell worklet-runtime counts. shell-sourced events (keyboard, scroll) only reach handlers the SHELL runtime holds, so compare eventHandlerNames across both sides when a reanimated handler never fires',
3128
+ ),
3129
+ ],
3130
+ undefined,
3131
+ {
3132
+ group: 'debug',
3133
+ subgroup: 'state',
3134
+ shortDescription:
3135
+ 'runtime dumps (shell, worker, keyboard, hit, gesture, ownership, ...)',
3136
+ seeAlso: ['js'],
3137
+ },
3138
+ ),
3139
+ // `shell` is a top-level command; its help comes from the CliCommandMeta
3140
+ // entry above, not a verb meta. see renderCliCommandHelp dispatch.
3141
+ verb(
3142
+ 'js',
3143
+ 'evaluate javascript in the browser context',
3144
+ ['peach debug js <expression> [--tenant]'],
3145
+ [
3146
+ example('peach debug js document.title'),
3147
+ example('peach debug js window.location.href'),
3148
+ example('peach debug js document.activeElement?.tagName'),
3149
+ example('peach debug js --tenant "typeof globalThis.fetch"'),
3150
+ ],
3151
+ 'evaluate JavaScript in the browser page. use --tenant for the app worker realm, including guest globals, bundle modules and compatibility stubs.',
3152
+ {
3153
+ group: 'debug',
3154
+ subgroup: 'js',
3155
+ shortDescription: 'evaluate JavaScript in the engine realm',
3156
+ seeAlso: ['state'],
3157
+ },
3158
+ ),
3159
+ verb(
3160
+ 'errors',
3161
+ 'show recent console errors',
3162
+ ['peach get errors [n|clear] [--json]'],
3163
+ [
3164
+ example('peach get errors 5'),
3165
+ example('peach get errors clear'),
3166
+ example('peach get errors --json | jq length'),
3167
+ ],
3168
+ undefined,
3169
+ {
3170
+ group: 'get',
3171
+ subgroup: 'diagnostics',
3172
+ shortDescription: 'console errors (default 20)',
3173
+ options: [option('--json', 'emit array of { timestamp, args, stack } for scripts')],
3174
+ seeAlso: ['warnings', 'requests', 'logs'],
3175
+ },
3176
+ ),
3177
+ verb(
3178
+ 'warnings',
3179
+ 'show recent console warnings',
3180
+ ['peach get warnings [n] [--json]'],
3181
+ [example('peach get warnings 5'), example('peach get warnings --json')],
3182
+ undefined,
3183
+ {
3184
+ group: 'get',
3185
+ subgroup: 'diagnostics',
3186
+ shortDescription: 'console warnings (default 20)',
3187
+ options: [option('--json', 'emit array of { timestamp, args } for scripts')],
3188
+ seeAlso: ['errors', 'logs'],
3189
+ },
3190
+ ),
3191
+ verb(
3192
+ 'requests',
3193
+ 'show recent failed network requests',
3194
+ ['peach get requests [n|all n|clear] [--json]'],
3195
+ [
3196
+ example('peach get requests 5'),
3197
+ example('peach get requests all 10'),
3198
+ example('peach get requests --json'),
3199
+ ],
3200
+ undefined,
3201
+ {
3202
+ group: 'get',
3203
+ subgroup: 'diagnostics',
3204
+ shortDescription: 'failed / all / clear request buffer',
3205
+ options: [option('--json', 'emit array of request entries for scripts')],
3206
+ seeAlso: ['errors', 'network'],
3207
+ },
3208
+ ),
3209
+ verb(
3210
+ 'diagnosis',
3211
+ 'composed "what just went wrong?" report',
3212
+ ['peach get diagnosis [--since <duration>] [--include <csv>] [--json]'],
3213
+ [
3214
+ example('peach get diagnosis', 'last 90s, all dimensions'),
3215
+ example('peach get diagnosis --since 30s --include network,react'),
3216
+ example(
3217
+ 'peach get diagnosis --json > /tmp/diagnosis.json',
3218
+ 'structured snapshot for agent / CI consumption',
3219
+ ),
3220
+ ],
3221
+ 'runs timeline + network (failed/slow) + react summary + console errors in parallel against the same sim and returns a grouped report.',
3222
+ {
3223
+ group: 'get',
3224
+ subgroup: 'diagnostics',
3225
+ shortDescription: 'timeline + network + react + console summary',
3226
+ options: [
3227
+ option('--since <duration>', 'absolute window, e.g. 90s or 2m (default 90s)'),
3228
+ option('--include <csv>', 'timeline, network, react, console, screen'),
3229
+ option('--slow-threshold <n>', 'network slow-request threshold in ms'),
3230
+ option('--limit <n>', 'rows to print per react table'),
3231
+ option('--json', 'emit one structured JSON document'),
3232
+ ],
3233
+ seeAlso: ['errors', 'warnings', 'requests', 'network'],
3234
+ },
3235
+ ),
3236
+ verb(
3237
+ 'animations',
3238
+ 'list every active animation with id, kind, progress, and current value',
3239
+ ['peach get animations', 'peach get animations --json'],
3240
+ [
3241
+ example('peach get animations', 'one line per running animation'),
3242
+ example('peach get animations --json | jq', 'structured for scripts'),
3243
+ ],
3244
+ 'answers "what is moving right now?" without resorting to screenshots or debug js. covers both realms: `shell` rows are native UI, home, and app transitions, `tenant` rows belong to the app itself. a row tagged `graph` or `remote-driven` is sampled by the compositor on its own clock, and a row with no from/to is a native-driver registration whose curve is not declared. pair with `peach get animation <id>` for full spec, `peach do stop-animation <id>` to halt one, or `peach debug trace anim on <id>` for per-tick values (tracing applies to app Animated values only).',
3245
+ {
3246
+ group: 'get',
3247
+ subgroup: 'animations',
3248
+ shortDescription: 'list active animations',
3249
+ seeAlso: ['animation', 'stop-animation', 'state'],
3250
+ },
3251
+ ),
3252
+ verb(
3253
+ 'animation',
3254
+ 'full detail for a single active animation by id',
3255
+ ['peach get animation <id>'],
3256
+ [example('peach get animation 3', 'JSON spec + current value + progress')],
3257
+ 'ids come from `peach get animations`. poll this to watch a single animation settle without enabling a trace.',
3258
+ {
3259
+ group: 'get',
3260
+ subgroup: 'animations',
3261
+ shortDescription: 'single animation detail',
3262
+ seeAlso: ['animations', 'stop-animation'],
3263
+ },
3264
+ ),
3265
+ verb(
3266
+ 'state',
3267
+ 'runtime dashboard: url, active animation counts, diagnostics, shell scene',
3268
+ ['peach get state'],
3269
+ [example('peach get state', 'what is this sim doing right now')],
3270
+ 'one-shot JSON snapshot answering "what is happening in this sim right now", intended as the first call of a debugging pass. separate from `peach debug state <kind>`, which dumps raw runtime state for one subsystem.',
3271
+ {
3272
+ group: 'get',
3273
+ subgroup: 'diagnostics',
3274
+ shortDescription: 'runtime dashboard snapshot',
3275
+ seeAlso: ['animations', 'errors', 'keyboard'],
3276
+ },
3277
+ ),
3278
+ verb(
3279
+ 'memory',
3280
+ 'per-worker live object counts (nodes, paragraphs, yoga nodes, pictures, raster images) + image cache + JS heaps; --watch samples over time and reports per-counter slopes',
3281
+ [
3282
+ 'peach debug memory',
3283
+ 'peach get memory',
3284
+ 'peach debug memory --watch [seconds] [--interval seconds]',
3285
+ ],
3286
+ [
3287
+ example('peach get memory', 'one-shot tenant + shell + host snapshot'),
3288
+ example(
3289
+ 'peach debug memory --watch 120',
3290
+ 'sample every 5s for 2 min, then print which counters are climbing',
3291
+ ),
3292
+ example(
3293
+ 'peach debug memory --watch 60 --interval 2 --json | jq .perSecond',
3294
+ 'machine-readable slopes for scripting',
3295
+ ),
3296
+ ],
3297
+ 'the memory-leak RCA instrument. counters are maintained at engine create/delete sites, so resources retained by discarded (unmounted) subtrees still show up: a climbing nodesRegistered/paragraphs while the on-screen tree is stable means unmounted nodes are being retained. tenant and shell workers report independently (the shell paints the app:* mirror trees). heaps are chrome-only (webkit omits performance.memory).',
3298
+ {
3299
+ group: 'debug',
3300
+ subgroup: 'profiling',
3301
+ shortDescription: 'live object counts + heap sampler',
3302
+ options: [
3303
+ option('--watch [seconds]', 'sample repeatedly for N seconds (default 60)'),
3304
+ option('--interval <seconds>', 'seconds between samples (default 5)'),
3305
+ option('--json', 'one-shot report, or { samples, perSecond } under --watch'),
3306
+ ],
3307
+ seeAlso: ['state', 'perf'],
3308
+ },
3309
+ ),
3310
+ verb(
3311
+ 'stop-animation',
3312
+ 'stop a running animation by id, or stop all active animations',
3313
+ ['peach do stop-animation <id|all>'],
3314
+ [
3315
+ example('peach do stop-animation 3'),
3316
+ example('peach do stop-animation all', 'freeze everything for inspection'),
3317
+ ],
3318
+ "the id comes from `peach get animations`. stopping fires the animation's finished callback with finished=false, matching react-native Animated.stop() semantics.",
3319
+ {
3320
+ group: 'do',
3321
+ subgroup: 'animations',
3322
+ shortDescription: 'stop a running animation',
3323
+ seeAlso: ['animations', 'animation'],
3324
+ },
3325
+ ),
3326
+ verb(
3327
+ 'trace',
3328
+ 'opt-in trace recorders: shell animation frames or per-tick animation values',
3329
+ [
3330
+ 'peach debug trace shell [on [limit]|off|status|clear|<recentLimit>]',
3331
+ 'peach debug trace anim <on <id|all> [limit]|off [id|all]|status|clear|<id> [limit]>',
3332
+ ],
3333
+ [
3334
+ example('peach debug trace shell on 240', 'arm the shell frame recorder'),
3335
+ example('peach debug trace shell 120', 'dump the last 120 shell samples'),
3336
+ example('peach debug trace anim on 3 240', 'record up to 240 ticks for anim #3'),
3337
+ example('peach debug trace anim 3 60', 'read last 60 ticks for anim #3'),
3338
+ example('peach debug trace anim on all', 'record every active animation'),
3339
+ ],
3340
+ 'for a focused perf trace: `get animations` to find the id, `trace anim on <id>` to arm, reproduce the issue, then `trace anim <id>` to pull per-tick value + velocity samples. `trace anim off` disables when done.',
3341
+ {
3342
+ group: 'debug',
3343
+ subgroup: 'profiling',
3344
+ shortDescription: 'per-tick animation + shell frame trace',
3345
+ seeAlso: ['animations', 'animation', 'stop-animation'],
3346
+ },
3347
+ ),
3348
+ verb(
3349
+ 'image-audit',
3350
+ 'for every image the compositor actually drew, how many source pixels it landed on each device pixel',
3351
+ ['peach debug image-audit [--min <ratio>] [--all] [--json]'],
3352
+ [
3353
+ example('peach debug image-audit', 'list only the images that came up short'),
3354
+ example('peach debug image-audit --all', 'every drawn image, shortfall or not'),
3355
+ example(
3356
+ 'peach debug image-audit --min 0.9',
3357
+ 'accept down to 0.9 source pixels per device pixel',
3358
+ ),
3359
+ example('peach debug image-audit --json | jq .rows', 'machine-readable rows'),
3360
+ ],
3361
+ 'a row whose shortfall is well under 1.0 is an image the pipeline under-resolved, and 0.5 is half resolution. exits 1 when any image is under the ratio. exits 2 when the audit observed no image draws at all, which is not a pass: the frame it forced painted without re-running an image draw, so either nothing on screen is an image or every image replayed from a cached paint boundary. scroll or navigate the sim and run it again.',
3362
+ {
3363
+ group: 'debug',
3364
+ subgroup: 'profiling',
3365
+ shortDescription: 'source pixels per device pixel, per drawn image',
3366
+ options: [
3367
+ option(
3368
+ '--min <ratio>',
3369
+ 'shortfall below which a row counts as under-resolved (default 0.98)',
3370
+ ),
3371
+ option('--all', 'show every drawn image, not just the ones under the ratio'),
3372
+ option('--json', 'the full report plus the resolved minimum and under count'),
3373
+ ],
3374
+ seeAlso: ['screenshot', 'memory'],
3375
+ },
3376
+ ),
3377
+ verb(
3378
+ 'snapshot',
3379
+ 'capture a tree snapshot (layout + transform + opacity) for later diffing',
3380
+ ['peach debug snapshot [label]'],
3381
+ [
3382
+ example('peach debug snapshot before', 'capture state before an interaction'),
3383
+ example('peach debug snapshot after', 'capture state after an interaction'),
3384
+ example('peach debug snapshot', 'unlabeled: auto-named based on current time'),
3385
+ ],
3386
+ 'snapshots live in-memory in the engine for the life of the page. use `snapshots` to list labels and `diff <a> <b>` to compare two. clear with `clear-snapshots [label]`.',
3387
+ {
3388
+ group: 'debug',
3389
+ subgroup: 'snapshot',
3390
+ shortDescription: 'capture tree snapshot for later diff',
3391
+ seeAlso: ['snapshots', 'diff', 'state'],
3392
+ },
3393
+ ),
3394
+ verb(
3395
+ 'snapshots',
3396
+ 'list the labels of every captured tree snapshot',
3397
+ ['peach debug snapshots'],
3398
+ [example('peach debug snapshots', 'list every label, with capture time')],
3399
+ undefined,
3400
+ {
3401
+ group: 'debug',
3402
+ subgroup: 'snapshot',
3403
+ shortDescription: 'list captured snapshot labels',
3404
+ seeAlso: ['snapshot', 'diff'],
3405
+ },
3406
+ ),
3407
+ verb(
3408
+ 'diff',
3409
+ 'compare two captured snapshots: added / removed / changed nodes',
3410
+ ['peach debug diff <labelA> <labelB>'],
3411
+ [
3412
+ example(
3413
+ 'peach debug diff before after',
3414
+ 'diff a paired snapshot: added/removed/changed counts + per-node detail',
3415
+ ),
3416
+ ],
3417
+ 'project both snapshots with `snapshot <label>` first, then diff. emits counts plus added / removed / changed arrays; pipe through jq for filtering.',
3418
+ {
3419
+ group: 'debug',
3420
+ subgroup: 'snapshot',
3421
+ shortDescription: 'compare two snapshots',
3422
+ seeAlso: ['snapshot', 'snapshots', 'clear-snapshots'],
3423
+ },
3424
+ ),
3425
+ verb(
3426
+ 'clear-snapshots',
3427
+ 'drop a labeled snapshot (or all snapshots if no label is given)',
3428
+ ['peach debug clear-snapshots [label]'],
3429
+ [
3430
+ example('peach debug clear-snapshots before', 'drop just the `before` snapshot'),
3431
+ example('peach debug clear-snapshots', 'drop every captured snapshot'),
3432
+ ],
3433
+ undefined,
3434
+ {
3435
+ group: 'debug',
3436
+ subgroup: 'snapshot',
3437
+ shortDescription: 'discard captured snapshots',
3438
+ seeAlso: ['snapshot', 'snapshots', 'diff'],
3439
+ },
3440
+ ),
3441
+ verb(
3442
+ 'find',
3443
+ 'dump engine-internal nodes by category (e.g. all Sheet.Frame portals)',
3444
+ ['peach debug find sheets', 'peach debug find portals'],
3445
+ [
3446
+ example('peach debug find sheets', 'every Sheet.Frame-shaped node in the tree'),
3447
+ example(
3448
+ 'peach debug find portals',
3449
+ 'every portal-host / portal-view pair the engine is currently mounting',
3450
+ ),
3451
+ example(
3452
+ "peach debug find sheets | jq '.[] | select(.translateY != null)'",
3453
+ 'narrow to sheets mid-animation',
3454
+ ),
3455
+ ],
3456
+ 'category-specific inspectors for runtime structures that `describe` collapses. emits a JSON array of node-shaped records; pipe through jq for filtering.',
3457
+ {
3458
+ group: 'debug',
3459
+ subgroup: 'inspectors',
3460
+ shortDescription: 'list engine-internal nodes by category',
3461
+ seeAlso: ['state', 'describe'],
3462
+ },
3463
+ ),
3464
+ verb(
3465
+ 'record',
3466
+ 'toggle the debug event ring buffer (off / on)',
3467
+ ['peach debug record [on|off]'],
3468
+ [
3469
+ example('peach debug record on', 'arm the ring buffer'),
3470
+ example('peach debug record off', 'stop recording'),
3471
+ example('peach debug record', 'query current state without flipping it'),
3472
+ ],
3473
+ 'the ring buffer feeds `debug recent <channel> [n]`. enable a channel via `debug enable <channel>` first so the corresponding events actually fire.',
3474
+ {
3475
+ group: 'debug',
3476
+ subgroup: 'events',
3477
+ shortDescription: 'toggle the debug event ring buffer',
3478
+ seeAlso: ['recent', 'clear-events'],
3479
+ },
3480
+ ),
3481
+ verb(
3482
+ 'recent',
3483
+ 'tail the last N events from the debug ring buffer (optionally filtered by channel)',
3484
+ [
3485
+ 'peach debug recent',
3486
+ 'peach debug recent <channel>',
3487
+ 'peach debug recent <channel> <n>',
3488
+ ],
3489
+ [
3490
+ example('peach debug recent', 'last 50 events across every channel'),
3491
+ example('peach debug recent portals 20', 'last 20 portal events'),
3492
+ example('peach debug recent layout 200', 'larger window for layout debugging'),
3493
+ example(
3494
+ 'peach debug recent txn 40 --shell',
3495
+ 'core scene transactions in the shell mirrors',
3496
+ ),
3497
+ ],
3498
+ 'reads the tenant buffer; `--host` reads the page, `--shell` the shell worker and `--compositor` the compositor. javascript channels need `debug record on`; native channels such as `txn` record from their own ring whenever enabled. default limit is 50.',
3499
+ {
3500
+ group: 'debug',
3501
+ subgroup: 'events',
3502
+ shortDescription: 'last N debug events',
3503
+ seeAlso: ['record', 'clear-events'],
3504
+ },
3505
+ ),
3506
+ verb(
3507
+ 'clear-events',
3508
+ 'drop everything currently in the debug event ring buffer',
3509
+ ['peach debug clear-events'],
3510
+ [example('peach debug clear-events', 'reset the buffer before a clean repro')],
3511
+ undefined,
3512
+ {
3513
+ group: 'debug',
3514
+ subgroup: 'events',
3515
+ shortDescription: 'reset the debug event ring buffer',
3516
+ seeAlso: ['record', 'recent'],
3517
+ },
3518
+ ),
3519
+ verb(
3520
+ 'sample-color',
3521
+ 'average the canvas color over a pixel or rect; returns hex + rgba',
3522
+ [
3523
+ 'peach debug sample-color <x> <y> [w] [h]',
3524
+ 'peach debug sample-color --area x,y,w,h',
3525
+ 'peach debug sample-color --id <testID>',
3526
+ 'peach debug sample-color --text <text>',
3527
+ ],
3528
+ [
3529
+ example('peach debug sample-color 196 400'),
3530
+ example('peach debug sample-color 100 200 50 80'),
3531
+ example('peach debug sample-color --id loginButton'),
3532
+ example('peach debug sample-color --text "Sign in" --json'),
3533
+ ],
3534
+ 'coords are logical peach units. pixels are averaged across the rect. --json emits { r, g, b, a, hex, samples, rect } for scripts.',
3535
+ {
3536
+ group: 'debug',
3537
+ subgroup: 'profiling',
3538
+ shortDescription: 'average canvas color over a rect',
3539
+ options: [
3540
+ option('--area x,y,w,h', 'rect to sample (coords are logical peach units)'),
3541
+ option('--id <testID>', "sample over a node's layout rect"),
3542
+ option('--text <text>', 'sample over the node matching text'),
3543
+ option('--json', 'emit { r, g, b, a, hex, samples, rect }'),
3544
+ ],
3545
+ seeAlso: ['screenshot'],
3546
+ },
3547
+ ),
3548
+ verb(
3549
+ 'screenshot',
3550
+ 'capture the canvas (full or a cropped area) as PNG',
3551
+ [
3552
+ 'peach screenshot [--output <path>]',
3553
+ 'peach screenshot --area x,y,w,h [--output <path>]',
3554
+ 'peach screenshot --id <testID> [--output <path>]',
3555
+ 'peach screenshot --text <text> [--output <path>]',
3556
+ ],
3557
+ [
3558
+ example('peach screenshot'),
3559
+ example('peach screenshot --output /tmp/app.png'),
3560
+ example('peach screenshot --area 0,200,393,400'),
3561
+ example('peach screenshot --id loginButton --output button.png'),
3562
+ ],
3563
+ 'area args use logical peach coords; default output is /tmp/peach-inspect.png.',
3564
+ {
3565
+ options: [
3566
+ option('--output <path>', 'write PNG here (default /tmp/peach-inspect.png)'),
3567
+ option('--area x,y,w,h', 'crop to rect (logical peach coords)'),
3568
+ option('--id <testID>', "crop to a node's layout rect"),
3569
+ option('--text <text>', 'crop to the node matching text'),
3570
+ ],
3571
+ seeAlso: ['sample-color', 'record'],
3572
+ },
3573
+ ),
3574
+ verb(
3575
+ 'url',
3576
+ 'show the current page URL',
3577
+ ['peach get url [--json]'],
3578
+ [example('peach get url'), example('peach get url --json')],
3579
+ undefined,
3580
+ {
3581
+ group: 'get',
3582
+ subgroup: 'info',
3583
+ shortDescription: 'current page URL',
3584
+ options: [option('--json', 'emit { url } for scripts')],
3585
+ },
3586
+ ),
3587
+ verb(
3588
+ 'reload',
3589
+ 'reload the page and wait for reconnection',
3590
+ ['peach do reload'],
3591
+ undefined,
3592
+ undefined,
3593
+ {
3594
+ group: 'do',
3595
+ subgroup: 'lifecycle',
3596
+ shortDescription: 'reload the page + wait for reconnect',
3597
+ seeAlso: ['wait', 'ready'],
3598
+ order: 10,
3599
+ },
3600
+ ),
3601
+ verb(
3602
+ 'globals',
3603
+ 'list all __sootsim* globals available in the browser',
3604
+ ['peach get globals'],
3605
+ undefined,
3606
+ undefined,
3607
+ {
3608
+ group: 'get',
3609
+ subgroup: 'info',
3610
+ shortDescription: 'list available __sootsim* globals',
3611
+ },
3612
+ ),
3613
+ verb(
3614
+ 'sleep',
3615
+ 'simple local pause between commands',
3616
+ ['peach do sleep [seconds]'],
3617
+ [example('peach do sleep 0.5')],
3618
+ undefined,
3619
+ {
3620
+ group: 'do',
3621
+ subgroup: 'lifecycle',
3622
+ shortDescription: 'local pause between commands',
3623
+ seeAlso: ['settle', 'idle'],
3624
+ order: 40,
3625
+ },
3626
+ ),
3627
+ verb(
3628
+ 'wait',
3629
+ 'wait for the current sim to reconnect',
3630
+ ['peach do wait [seconds]'],
3631
+ [example('peach do wait 30')],
3632
+ undefined,
3633
+ {
3634
+ group: 'do',
3635
+ subgroup: 'lifecycle',
3636
+ shortDescription: 'wait for sim reconnect',
3637
+ seeAlso: ['ready', 'idle', 'settle'],
3638
+ order: 20,
3639
+ },
3640
+ ),
3641
+ verb(
3642
+ 'settle',
3643
+ 'wait until the visible layout is stable (default max 3s)',
3644
+ ['peach do settle [seconds] [--strict]'],
3645
+ [example('peach do settle 3'), example('peach do settle 2 --strict')],
3646
+ 'default requires layout hash to be stable for 3 consecutive polls; this is the right signal for slide transitions, spring-driven position changes, and scroll momentum. --strict additionally requires the worker animation flags (hasActiveAnims, hasActiveNativeAnimations, hasPendingAnimationFrames) to all be false. use --strict only when the target app has no perpetual background animation, otherwise it will time out. exits non-zero on timeout.',
3647
+ {
3648
+ group: 'do',
3649
+ subgroup: 'lifecycle',
3650
+ shortDescription: 'wait for animations to settle',
3651
+ options: [
3652
+ option(
3653
+ '--strict',
3654
+ 'also require all worker animation flags to be false (use only when no perpetual bg animation)',
3655
+ ),
3656
+ ],
3657
+ seeAlso: ['idle', 'ready', 'selector'],
3658
+ order: 30,
3659
+ },
3660
+ ),
3661
+ verb(
3662
+ 'ready',
3663
+ 'block until the guest app bundle is loaded and painted',
3664
+ ['peach wait ready [--max-ms <ms>] [--painted]'],
3665
+ [
3666
+ example('peach wait ready'),
3667
+ example(
3668
+ 'peach wait ready --max-ms 30000',
3669
+ 'hard deadline, even if Metro is still building',
3670
+ ),
3671
+ example('peach wait ready --max-ms 5000'),
3672
+ ],
3673
+ 'uses the runtime readiness signal, which is cleared on reload. without --max-ms, the wait continues while the bundle or guest reports progress and fails when progress stalls for 60s or the 10-minute cap passes, naming the stalled phase. --max-ms/--timeout is a hard deadline. prefer this over `do wait`, which relies on a node-count heuristic that can mistake the connection screen for a loaded app. calling it after the app is ready returns immediately. exits non-zero on timeout.',
3674
+ {
3675
+ group: 'wait',
3676
+ shortDescription: 'block until the guest app bundle is loaded and painted',
3677
+ options: [
3678
+ option('--max-ms <ms>', 'hard deadline; omit to wait on bundle progress'),
3679
+ option(
3680
+ '--painted',
3681
+ 'return once the app has painted, without waiting for animations to settle',
3682
+ ),
3683
+ ],
3684
+ seeAlso: ['idle', 'selector', 'settle'],
3685
+ order: 10,
3686
+ },
3687
+ ),
3688
+ verb(
3689
+ 'idle',
3690
+ 'block until animations, rAF queue, and layout are all settled',
3691
+ ['peach wait idle [--max-ms <ms>] [--strict]'],
3692
+ [example('peach wait idle'), example('peach wait idle --max-ms 2000 --strict')],
3693
+ 'same signal as `do settle` but under the discoverable `wait` verb. exits non-zero on timeout.',
3694
+ {
3695
+ group: 'wait',
3696
+ shortDescription: 'block until animations + rAF + layout are settled',
3697
+ options: [
3698
+ option('--max-ms <ms>', 'override the idle deadline'),
3699
+ option('--strict', 'also require worker animation flags to all be false'),
3700
+ ],
3701
+ seeAlso: ['ready', 'selector', 'settle'],
3702
+ order: 20,
3703
+ },
3704
+ ),
3705
+ verb(
3706
+ 'selector',
3707
+ 'block until a node with <testid> or --text is visible with non-zero layout (or absent with --gone)',
3708
+ [
3709
+ 'peach wait selector <testid-or-text> [--max-ms <ms>] [--gone] [--structural]',
3710
+ 'peach wait selector --text <text> [--max-ms <ms>] [--gone]',
3711
+ ],
3712
+ [
3713
+ example('peach wait selector loginButton'),
3714
+ example(
3715
+ 'peach wait selector --text "Welcome back"',
3716
+ 'wait on visible text when the node has no testID',
3717
+ ),
3718
+ example('peach wait selector feedList --max-ms 3000'),
3719
+ example(
3720
+ 'peach wait selector loginButton --gone --max-ms 90000',
3721
+ 'after a gate action, wait for the gate to leave instead of re-tapping',
3722
+ ),
3723
+ example(
3724
+ 'peach wait selector build-marker --structural',
3725
+ 'a marker the app renders as proof is 1x1 under the whole app, so only the structural wait can match it',
3726
+ ),
3727
+ ],
3728
+ 'playwright-style. when `find --testid <id>` returns no result, the CLI now prints this command as a hint. the default wait requires the node to survive the occlusion pass, so a node behind a sheet or painted under the app does not count; `--structural` drops that test and waits only for the node to exist and be laid out. `--gone` inverts the wait: it resolves when the node is confirmed absent (the positive "gate/screen left" signal), and never resolves on an indeterminate bridge. exits non-zero on timeout.',
3729
+ {
3730
+ group: 'wait',
3731
+ shortDescription:
3732
+ 'block until a testID or text appears (or, with --gone, disappears)',
3733
+ options: [
3734
+ option(
3735
+ '--text <text>',
3736
+ 'match visible text instead of a testID, as find --text does',
3737
+ ),
3738
+ option('--max-ms <ms>', 'override the deadline'),
3739
+ option('--gone', 'resolve when the node is absent instead of present'),
3740
+ option(
3741
+ '--structural',
3742
+ 'match a node that exists but is not visible, such as a 1x1 marker painted under the app',
3743
+ ),
3744
+ ],
3745
+ seeAlso: ['ready', 'idle', 'find'],
3746
+ order: 30,
3747
+ },
3748
+ ),
3749
+ verb(
3750
+ 'event',
3751
+ 'block until a semantic timeline event of <kind> appears',
3752
+ [
3753
+ 'peach wait event <kind> [--max-ms <ms>]',
3754
+ 'peach wait event <kind> --filter <substring>',
3755
+ 'peach wait event <kind> --equals <exact>',
3756
+ ],
3757
+ [
3758
+ example(
3759
+ 'peach wait event fetch --filter BeginSignIn',
3760
+ 'wait for the next BeginSignIn fetch after a tap',
3761
+ ),
3762
+ example(
3763
+ 'peach wait event screen --equals Inbox',
3764
+ 'wait until a screen named Inbox appears',
3765
+ ),
3766
+ example('peach wait event alert', 'wait for the next iOS alert/sheet'),
3767
+ example(
3768
+ 'peach wait event react-commit --max-ms 2000',
3769
+ 'block until the next React commit fires (or 2s)',
3770
+ ),
3771
+ ],
3772
+ 'timeline-backed companion to wait selector and wait idle. polls the semantic event timeline at 200ms; matches against url, message, name, path, title, and phase fields. defaults: --max-ms 5000, --since now (only counts events that arrive after this command starts; pass --since cursor to include prior events). exits non-zero on timeout.',
3773
+ {
3774
+ group: 'wait',
3775
+ shortDescription: 'block until the next timeline event of a given kind',
3776
+ options: [
3777
+ option('--max-ms <ms>', 'wait deadline in milliseconds (default 5000)'),
3778
+ option(
3779
+ '--filter <substring>',
3780
+ 'substring match against url/message/name/path/title (case-insensitive)',
3781
+ ),
3782
+ option('--equals <exact>', 'exact match against any of the same fields'),
3783
+ option(
3784
+ '--since <mode>',
3785
+ '"now" (default: only events after this command starts) or "cursor"',
3786
+ ),
3787
+ option('--json', 'emit { found, elapsedMs, event } JSON'),
3788
+ ],
3789
+ seeAlso: ['ready', 'idle', 'selector'],
3790
+ order: 40,
3791
+ },
3792
+ ),
3793
+ verb(
3794
+ 'dispatch',
3795
+ 'dispatch a raw keyboard key (bypasses visual shift state)',
3796
+ ['peach do dispatch <char>'],
3797
+ [example('peach do dispatch A')],
3798
+ undefined,
3799
+ {
3800
+ group: 'do',
3801
+ subgroup: 'text input',
3802
+ shortDescription: 'raw key (bypasses visual shift state)',
3803
+ seeAlso: ['key', 'type'],
3804
+ order: 70,
3805
+ },
3806
+ ),
3807
+ verb(
3808
+ 'keyboard',
3809
+ 'on-screen keyboard state (type, returnKey, autoCap, mode, shift, accessory)',
3810
+ ['peach get keyboard [--json]'],
3811
+ [example('peach get keyboard'), example('peach get keyboard --json')],
3812
+ undefined,
3813
+ {
3814
+ group: 'get',
3815
+ subgroup: 'info',
3816
+ shortDescription: 'on-screen keyboard state',
3817
+ options: [option('--json', 'emit structured JSON')],
3818
+ seeAlso: ['type', 'dismiss', 'state'],
3819
+ },
3820
+ ),
3821
+ verb(
3822
+ 'screens',
3823
+ 'list the current tenant route, navigation stack, active app, modal stack, and keyboard',
3824
+ ['peach get screens [--json]'],
3825
+ [example('peach get screens'), example('peach get screens --json')],
3826
+ 'pulls the canonical tenant route path from the router, plus shell state (active app, switcher phase), the navigation bridge (route stack for react-navigation / one-router if present), and the top presented modal. JSON exposes the exact path as route.currentPath. use this when a route, screen id, or nav-state is the fastest orientation signal, e.g. "am I on the onboarding landing, or did the login sheet open over it?". Exits quietly when no navigation bridge is available.',
3827
+ {
3828
+ group: 'get',
3829
+ subgroup: 'info',
3830
+ shortDescription: 'current route + screen + modal + route stack',
3831
+ options: [option('--json', 'emit structured JSON')],
3832
+ seeAlso: ['describe', 'state', 'keyboard'],
3833
+ },
3834
+ ),
3835
+ ]
3836
+
3837
+ function inspectVerbPathKey(group: string | null | undefined, verb: string): string {
3838
+ return `${group ?? ''}:${verb}`
3839
+ }
3840
+
3841
+ export const cliInspectVerbMetasByVerb = new Map<string, CliInspectVerbMeta[]>()
3842
+ export const cliInspectVerbMetaByPath = new Map<string, CliInspectVerbMeta>()
3843
+
3844
+ for (const meta of cliInspectVerbMetas) {
3845
+ const byVerb = cliInspectVerbMetasByVerb.get(meta.verb)
3846
+ if (byVerb) {
3847
+ byVerb.push(meta)
3848
+ } else {
3849
+ cliInspectVerbMetasByVerb.set(meta.verb, [meta])
3850
+ }
3851
+ cliInspectVerbMetaByPath.set(inspectVerbPathKey(meta.group, meta.verb), meta)
3852
+ }
3853
+
3854
+ export const cliInspectVerbMetaByVerb = new Map(
3855
+ Array.from(cliInspectVerbMetasByVerb, ([verb, metas]) => [
3856
+ verb,
3857
+ metas.find((meta) => !meta.group) ?? metas[0],
3858
+ ]),
3859
+ )
3860
+
3861
+ export function getCliInspectVerbMetasByVerb(verb: string): CliInspectVerbMeta[] {
3862
+ return cliInspectVerbMetasByVerb.get(verb)?.slice() ?? []
3863
+ }
3864
+
3865
+ export function getCliInspectVerbMetaByPath(
3866
+ group: string | null | undefined,
3867
+ verb: string,
3868
+ ): CliInspectVerbMeta | undefined {
3869
+ return cliInspectVerbMetaByPath.get(inspectVerbPathKey(group, verb))
3870
+ }
3871
+
3872
+ export function getCliInspectVerbMeta(
3873
+ verb: string,
3874
+ group?: string | null,
3875
+ ): CliInspectVerbMeta | undefined {
3876
+ if (group !== undefined) {
3877
+ return getCliInspectVerbMetaByPath(group, verb)
3878
+ }
3879
+ const metas = cliInspectVerbMetasByVerb.get(verb)
3880
+ return metas?.find((meta) => !meta.group) ?? metas?.[0]
3881
+ }