Skip to content

feat(device): tap, type, swipe and press-key subcommands - #310

Merged
finalerock44 merged 1 commit into
devfrom
feat/device-typed-actions
Nov 11, 2026
Merged

finalerock44 merged 1 commit into
devfrom
feat/device-typed-actions

Conversation

@finalerock44

Copy link
Copy Markdown
Contributor

dcd device could drive a session only with run (a Maestro flow). The API's typed action route, POST /device/sessions/:id/actions, performs one tap, typed text, swipe or key press and answers once the screen has settled, so these four subcommands expose it:

dcd device tap [id] --text "Log in" | --rid login_button | --x 50 --y 80
dcd device type [id] --text "hello" [--sensitive]
dcd device swipe [id] up|down|left|right | --from 90,50 --to 10,50
dcd device press-key [id] back|home|enter|backspace|tab|volume_up|volume_down|lock|power

Same rules as the other subcommands: the session id may be left out when one session is open, --json prints the envelope, a failed action exits 2 with the result. --maestro runs the action as a Maestro flow instead.

What & why

Type of change

  • fix — bug fix
  • feat — new feature
  • perf — performance improvement
  • refactor — code change that's neither a fix nor a feature
  • docs — documentation only
  • chore / ci / build / test — tooling, no user-facing change
  • Breaking change (title has ! or PR notes a BREAKING CHANGE:)

Checklist

  • PR title follows the Conventional Commits format (see comment above)
  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • I have not bumped the version or edited CHANGELOG.md (the release workflow handles this)
  • I have signed the CLA (the bot will prompt on first contribution)
  • Docs / README.md / STYLE_GUIDE.md updated if behaviour or output changed

How to test

`dcd device` could drive a session only with `run` (a Maestro flow). The
API's typed action route, POST /device/sessions/:id/actions, performs one
tap, typed text, swipe or key press and answers once the screen has
settled, so these four subcommands expose it:

  dcd device tap [id] --text "Log in" | --rid login_button | --x 50 --y 80
  dcd device type [id] --text "hello" [--sensitive]
  dcd device swipe [id] up|down|left|right | --from 90,50 --to 10,50
  dcd device press-key [id] back|home|enter|backspace|tab|volume_up|volume_down|lock|power

Same rules as the other subcommands: the session id may be left out when
one session is open, --json prints the envelope, a failed action exits 2
with the result. --maestro runs the action as a Maestro flow instead.
@finalerock44 finalerock44 self-assigned this Nov 11, 2026
Comment thread src/commands/device.ts Resolved
@finalerock44
finalerock44 merged commit 12f4da5 into dev Nov 11, 2026
11 checks passed
@finalerock44
finalerock44 deleted the feat/device-typed-actions branch November 11, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant