Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 3.24 KB

DESIGN.md

File metadata and controls

42 lines (26 loc) · 3.24 KB

OpenCode Tailscale settings

Product

An OpenCode plugin for reaching its background service from another tailnet device, without enabling a system VPN. The Desktop Tailscale settings page and the local TUI's /tailscale command manage the same node.

Audience and voice

OpenCode users who already know their tailnet or are connecting a phone to their Mac. Use short, literal labels. Distinguish signing in to Tailscale from authenticating to OpenCode. Initial copy is English (assumed).

Mood

Native, quiet, practical. The page should not look like a dashboard or a second application (assumed).

Brand

Design system source: OpenCode Desktop's existing settings primitives in packages/app/src/runtime/plugin/ui.tsx. Use its settings layout, section, rows, switch, buttons, typography, light and dark themes. No standalone theme.

References

  • Rex Tailscale settings — take: account and sign-in action first, separate Serve switch, concise Tags and Control Server rows, then Preferred Hostname. Avoid recreating macOS System Settings styling inside OpenCode (assumed).
  • OpenCode Desktop → Pairing — take: native settings hierarchy and visible device connection information. Avoid mixing Tailscale sign-in with OpenCode pairing or enabling OpenCode's built-in remote-access feature.

Constraints

  • No OpenCode source changes. The phone connects to the tailnet address from an existing Tailscale client.
  • Keep sign-in and serving independent. Show an address to copy when serving is active; use the node's assigned MagicDNS name, with its IP as fallback.
  • Cover disabled, waiting for browser sign-in, waiting for admin approval, signed in but not serving, serving, and recoverable errors. Never render or log OpenCode credentials or the raw sign-in link.
  • Use the Tailscale coordination server in the first version. Tags show what the tailnet assigned; no tag editor. Use OpenCode authentication and tailnet policy instead of a second identity switch.

Decisions log

  • 2026-11-23 — Register Settings → Tailscale using the public experimental GUI SDK — a first-party patch is not needed.
  • 2026-11-23 — Keep the node in the default location's server-plugin scope so closing a window or terminal does not stop access. Keep management on a user-private Unix socket rather than an OpenCode RPC endpoint reachable from the tailnet. Desktop's renderer receives neither server credentials nor the raw Tailscale sign-in link.
  • 2026-11-23 — Keep Tags and Control Server read-only, and use OpenCode authentication plus tailnet policy rather than a second identity switch.
  • 2026-11-23 — Show a copyable address and a separate single-use OpenCode pairing link after the listener is up — Tailscale sign-in and OpenCode pairing are different steps.
  • 2026-11-23 — Make the OpenCode scanner the primary pairing path. The Desktop dialog offers a QR code, expiry countdown, refresh, and a copyable fallback link for the same code. It uses only the current tailnet address and drops the code if that address disappears or changes.
  • 2026-11-23 — The TUI pairing dialog renders the same tailnet-only QR code as Desktop. Keep the link visible as a fallback, including when the terminal cannot fit an intact code.

Open questions

  • None for the first release.