feat(cli): add hyperframes auth login --api-key, status, logout#1081
Open
jrusso1020 wants to merge 1 commit into
Open
feat(cli): add hyperframes auth login --api-key, status, logout#1081jrusso1020 wants to merge 1 commit into
jrusso1020 wants to merge 1 commit into
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d75ab76 to
a72b6ac
Compare
Collaborator
Author
|
Self-review pass — addressed 13 of 15 findings. Force-push includes all fixes squashed into the original commit. Fixed (critical/high):
Deferred (noted, will address in a follow-up):
Tests: 54 unit tests, all green. Lint/format/typecheck/fallow clean. |
8 tasks
a72b6ac to
5c81d96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Introduces the
hyperframes authcommand group + a shared credentialstore library that hyperframes-CLI and heygen-cli will both read from.
hyperframes auth login --api-keysaves a HeyGen API key to~/.heygen/credentials.json(stdin pipe or hidden-input prompt).hyperframes auth statusresolves the active credential (env vars→ file) and verifies it against
GET /v3/users/me, printingidentity + billing.
hyperframes auth logoutremoves the credential (--keep-api-keydrops only the OAuth block).
Internals (
packages/cli/src/auth/):paths.ts—~/.heygenlayout,HEYGEN_CONFIG_DIRoverride.store.ts— read/writecredentials.json(file 0600, dir 0700)with legacy single-line plaintext fallback so existing heygen-cli
users don't lose their session.
resolver.ts— chain:HEYGEN_API_KEY→HYPERFRAMES_API_KEY→file (unexpired OAuth wins over api_key).
client.ts— hand-written typed wrapper forGET /v3/users/me(intentionally not OpenAPI codegen — single endpoint).
errors.ts— typedAuthErrorwith discriminatingcode.Why
This is the foundation for
hyperframes cloud render. Splitting itout keeps the cloud-render PR small and lets users sign in today.
The plan originally called for a library-only PR followed by a
commands PR. The
fallowdead-code gate flagged the library-onlyshape as unused exports, so I bundled them — the library and its
first consumers ship together. PR 3 (OAuth PKCE) and PR 4
(heygen-cli read-side JSON support) follow.
How
api_key+oauthblocks. Both CLIs read it; the resolver picks the freshest valid
credential.
Authorization: Bearer ..., API key →x-api-key: ....HEYGEN_API_URLlets dev testing targetapi.dev.heygen.comwithout rebuilding.
authcommand lazy-loads its subverbs (same pattern aslambda).Test plan
vitest) for paths, store, resolver,client, and errors — 45 tests, all green.
bunx tsc --noEmit -p packages/cli/tsconfig.jsonclean.bunx oxlint+bunx oxfmt --checkclean.bunx fallow audit --base origin/main --fail-on-issues—zero new findings.
HEYGEN_API_URL=https://api.dev.heygen.com hyperframes auth login --api-keythen
hyperframes auth status.