Skip to content

feat: add oclaw pair command for mobile QR pairing#2

Open
kaloster wants to merge 2 commits intomainfrom
feat/pair-command-and-mobile
Open

feat: add oclaw pair command for mobile QR pairing#2
kaloster wants to merge 2 commits intomainfrom
feat/pair-command-and-mobile

Conversation

@kaloster
Copy link
Contributor

Summary

  • Adds oclaw pair subcommand that displays a QR code for pairing the oclaw mobile app
  • QR encodes oclaw:// URI with LAN IP, gateway port, and auth token
  • Promotes root flags to PersistentFlags so subcommands inherit --url/--token/--agent

Details

  • LAN IP detection prefers physical interfaces (en*/eth*) over Docker/VPN/virtual adapters
  • --host flag allows manual override when auto-detection picks the wrong interface
  • Token is masked in terminal output (only first 4 chars shown)
  • URI constructed with url.URL/url.Values for correctness
  • New dependency: github.com/skip2/go-qrcode

Test plan

  • oclaw pair prints a scannable QR code
  • oclaw pair --host 10.0.0.1 overrides auto-detected IP
  • oclaw pair --url ws://remote:9999 --token mytoken respects flag overrides
  • oclaw (root command) still works with the PersistentFlags change
  • QR scans correctly with a QR reader app

Generates a QR code containing gateway connection details (LAN IP, port,
token) that the upcoming oclaw mobile app can scan to connect instantly.

- Detects LAN IP with preference for physical interfaces (en*/eth*)
- Supports --host flag to override auto-detection
- Masks token in terminal output for security
- Uses PersistentFlags so subcommands inherit --url/--token/--agent
The gateway requires Ed25519 device signing to grant operator scopes.
The pair command now reads ~/.openclaw/identity/device.json and includes
the device ID and private key seed in the QR URI so the mobile app can
authenticate with full permissions.
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