Skip to content

V2: Add service QR pairing and connection-details endpoint #35943

Closed

Description

@opencode-agent

Summary

Add a first-class V2 pairing flow for connecting OpenCode clients such as OpenMobile to an existing service:

  • opencode2 service qr renders a scannable QR code for the current service.
  • An authenticated server endpoint returns the canonical connection/pairing details so already-connected clients (including the TUI) can render the same QR or deep link.

This replaces helper scripts that discover service details and construct QR payloads outside OpenCode.

Proposed behavior

  • The CLI obtains all connection details through the service/CLI APIs rather than reading or manipulating OpenCode state files directly.
  • The QR encodes a versioned OpenMobile-compatible deep link that can add/open the server.
  • The server exposes a typed, documented response containing the canonical pairing payload and structured connection details needed by clients.
  • Connected clients can use the endpoint to show a QR without reconstructing service configuration independently.
  • Authentication secrets are returned only to an already-authenticated caller and must not appear in logs or diagnostics.
  • The schema can represent the currently reachable address (including Tailscale) and later accommodate OpenTunnel without changing client-specific parsing logic.

Deliverables

  • opencode2 service qr
  • Authenticated server endpoint and OpenAPI schema
  • Shared/versioned deep-link or pairing schema
  • Tests for CLI rendering, endpoint authorization, and payload round-tripping
  • Send the finalized schema to the OpenMobile client owner for integration

Open questions

  • Should the endpoint return only structured data/deep-link text, or also a rendered QR representation?
  • How should a service select or advertise among localhost, LAN, Tailscale, and future OpenTunnel addresses?
  • Should pairing credentials be reusable service credentials or short-lived/revocable tokens?

Source: https://slack.com/archives/C0HJ2SVJL/p1783531107717499

Activity

  1. opencode-agent commented on Jul 10, 2026

    @opencode-agent
    ContributorAuthor

    Cross-reference: #36116 defines plugin-contributed server metadata that QR/pairing and connection-details clients may consume. These should be designed together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions