Skip to content

feat(serve): --qr flag for Antigravity-style remote pairing (issue #47241) - #47242

Draft
AhsanIqbal-web wants to merge 1 commit into
anomalyco:devfrom
AhsanIqbal-web:serve-qr-pairing
Draft

AhsanIqbal-web wants to merge 1 commit into
anomalyco:devfrom
AhsanIqbal-web:serve-qr-pairing

Conversation

@AhsanIqbal-web

@AhsanIqbal-web AhsanIqbal-web commented Sep 4, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #47241

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR adds a --qr flag to opencode serve so a server can emit a scannable pairing payload for the OpenCode mobile/desktop app — the missing server-side half of the QR pairing flow (complementary to the scan-side decoder in #46098). When invoked, it resolves the machine's IPv4 interfaces (loopback / tailnet / private / public ordering), ensures a password exists (generating an ephemeral one when OPENCODE_SERVER_PASSWORD is unset), and renders a terminal QR encoding the exact PairingInfo schema decoded by packages/app/src/servers/connect/pairing.ts. Without --qr, serve behavior is unchanged.

How did you verify your code works?

  • bun typecheck in packages/opencode → exit 0
  • Runtime smoke on Windows 11: resolved Ethernet 172.16.20.112, payload { urls: ["http://172.16.20.112:5555","http://127.0.0.1:5555"], username:"", password:"demo-pass" } — schema-identical to pairing.ts
  • QR render verified visually in terminal
  • No external dependencies added (pure TS unicode-block renderer; qrcode not introduced)

Screenshots / recordings

No UI change — terminal output is the deliverable.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

- resolveAddresses: enumerate non-loopback IPv4s (LAN/tailscale/localhost)
- buildPairingPayload: emit Hona pairing format (urls sorted by scope)
- renderQrPairing: terminal unicode-block QR + connect URL
- serve --qr: ephemeral password when OPENCODE_SERVER_PASSWORD unset
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

feat(serve): --qr flag to emit scannable pairing payload for remote control (Antigravity-style)

1 participant