clankcli

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package clankcli provides the root cobra command for the clank binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Command returns the root cobra command for the clank binary with all subcommands.

Types

type PreviewLink struct {
	GatewayURL string
	Alts       []string
	HostKey    string
	PreviewURL string
	SessionID  string
	LocalPath  string
	Backend    string
	Name       string
	WorktreeID string
}

PreviewLink is the payload carried by the QR.

  • GatewayURL (+ Alts): where the phone reaches the daemon's bridge — the candidate set it remembers and probes on every reconnect.
  • HostKey: the laptop's identity public key. The phone pins it and verifies every probe answer against it, so a remembered address that got reassigned can't impersonate the laptop.
  • PreviewURL: the dev server to open.
  • SessionID: optional legacy field retained so older links remain readable.
  • LocalPath + Backend: when there's no SessionID, the phone creates the session itself on the first message — same call it makes for cloud worktrees, with LocalPath instead of WorktreeID.
  • WorktreeID: the preview key (folder slug) — lets the phone poll the dev server's status/logs through the gateway while Metro boots, instead of hitting a not-yet-listening port raw.
func ParsePreviewLink(s string) (PreviewLink, error)

ParsePreviewLink is the inverse of Encode. It exists mainly so a Go test can assert the round-trip the mobile parser must also satisfy.

func (PreviewLink) Encode

func (l PreviewLink) Encode() (string, error)

Encode renders the link as a clank://link URL. GatewayURL and HostKey are required — a link that names no gateway, or one the phone couldn't verify a probe against, is a programmer error, not a partial-but-usable payload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL