Skip to content

feat(cli): uniqent login via browser (device authorization)#11

Merged
maxlibin merged 5 commits into
mainfrom
feat/device-login
Jun 23, 2026
Merged

feat(cli): uniqent login via browser (device authorization)#11
maxlibin merged 5 commits into
mainfrom
feat/device-login

Conversation

@maxlibin

Copy link
Copy Markdown
Collaborator

CLI half of browser-based login. Consumes the registry endpoints in RiggdAI/uniqentai#feat/device-login (/api/v1/device/{start,poll}).

What

  • packages/cli/src/device.tsrunDeviceLogin: POSTs /device/start, prints the code + opens the browser, polls /device/poll until approved (returns token) / expired / timeout. Fully dependency-injected (fetch/open/sleep).
  • uniqent login (no --token) now runs the browser flow and stores the returned token. uniqent login --token <unq_live_…> still stores directly; logout unchanged.
  • Headless-safe: the OS opener no-ops without a TTY, and login with no --token and no TTY fails fast with an actionable error (no 10-minute poll hang in CI).

Tests

55/55 Vitest, tsc clean. Covers: start→poll→approved stores token, expired, start-failure, timeout, headless-no-token error, and --token path. No real network/browser in tests (injected deps).

Notes

  • Requires the registry endpoints deployed to uniqent.ai for the live flow.
  • E2E verify (human): deploy registry → uniqent login → click Approve → token stored → uniqent publish works.

🤖 Generated with Claude Code

maxlibin and others added 5 commits June 22, 2026 19:16
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maxlibin maxlibin merged commit 80d7af0 into main Jun 23, 2026
2 checks passed
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