zgx

Acting

click, type, key, scroll, command, set, wait and sleep.

zgx inspect click '"Send"'
zgx inspect type '#composer' 'Write me a function'     # clicks it, then types
zgx inspect key Enter                                  # Escape, Tab, cmd+k, alt+ArrowDown, shift+Tab, F5…
zgx inspect scroll '#transcript' 400                   # points; down is positive
zgx inspect command new                                # a ui.command, as its menu item or shortcut runs it
zgx inspect set current '"c1"'                         # a named state, the value as JSON
zgx inspect wait '"Copy"' --timeout 8000               # until it shows
zgx inspect wait '#reply' --text 'words'               # until its text holds this
zgx inspect wait '#spinner' --gone
zgx inspect sleep 500                                  # let the app run

cmd is Command on macOS and Control elsewhere, as commands’ keys are. A key goes where focus is: type or click an input first. After an action the interface is laid out again before the next command reads it, so click then tree shows the result; for what takes time (a fetch, a streamed reply, an animation), wait on what it will show rather than sleeping.

Edit on GitHub