Skip to content

Add Grid OAuth device-flow login (agentsea auth login) - #1

Merged
BarneyChambers merged 2 commits into
mainfrom
feat/grid-oauth-device-login
Jun 23, 2026
Merged

BarneyChambers merged 2 commits into
mainfrom
feat/grid-oauth-device-login

Conversation

@BarneyChambers

Copy link
Copy Markdown
Contributor

Summary

Adds an interactive OAuth bootstrap so users can authenticate with The Grid without manually creating and pasting a consumption key. The README/help text already reference agentsea auth login, but the implementation was missing from this repo — this ports it over (it previously existed only as uncommitted changes in a now-deprecated checkout, so it would otherwise have been lost).

  • agentsea auth login / auth status / auth logout (device flow)
  • Creates or reuses a consumption key and stores it under ~/.config/agentsea/ (API key + OAuth session)
  • Provisioning auto-attempts OAuth by default, with manual key entry as fallback; AGENTSEA_GRID_OAUTH=0 disables
  • New helpers: grid-oauth-client, grid-oauth-session, grid-exchange-client
  • Unit tests covering flow ordering, the auth command, and validation cache

Test plan

  • npm run typecheck --workspace=@agentsea/cli (passes locally)
  • npm run test:cli
  • Manual: agentsea auth login device flow → key created/saved → agentsea auth status → agentsea auth logout
  • Manual: provisioning with no key set falls back through OAuth → manual entry

Introduce an interactive OAuth bootstrap so users can authenticate with
The Grid without manually creating and pasting a consumption key:

- agentsea auth login/status/logout commands (device flow)
- creates or reuses a consumption key and stores it under
  ~/.config/agentsea/ (api key + oauth session)
- provisioning auto-attempts OAuth by default, falling back to manual
  key entry; AGENTSEA_GRID_OAUTH=0 disables
- grid-oauth-client, grid-oauth-session, and grid-exchange-client
  helpers, with unit tests for the flow ordering and validation cache

Ports work that previously lived only as uncommitted changes in a
deprecated checkout so it isn't lost.
@vercel

vercel Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agentsea-ui Skipped Skipped Jun 23, 2026 11:19am

Request Review

Expose the consumption-key management the OAuth exchange client already
supports as explicit commands so users can create and rotate keys without
the implicit login/provision path:

- agentsea auth keys [list]      list the account's consumption API keys
- agentsea auth keys create [name]  create a new key (secret printed once)
- agentsea auth keys revoke <id>    revoke a key by id

Refactor login to share a single authenticated-session helper, map
keys:manage scope failures to actionable guidance, and persist the
refreshed OAuth session after each operation. Adds command tests and
documents the commands in help and the CLI README.
@BarneyChambers
BarneyChambers merged commit 03f450b into main Jun 23, 2026
3 checks passed

This branch was previously deployed

1 inactive deployment
Preview — a8ebc1ef Deployed Jun 23, 2026 by vercel[bot]
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