Skip to content

cmd: add auth status command#44

Merged
somanshreddy merged 1 commit intomainfrom
04-03-cmd_add_auth_status
Apr 6, 2026
Merged

cmd: add auth status command#44
somanshreddy merged 1 commit intomainfrom
04-03-cmd_add_auth_status

Conversation

@somanshreddy
Copy link
Copy Markdown
Collaborator

@somanshreddy somanshreddy commented Apr 3, 2026

Description

Adds heygen auth status — verifies the stored API key is valid by calling GET /v3/user/me and outputting account info.

# Valid key
$ heygen auth status
{"data":{"email":"user@example.com","username":"demo",...}}

# Invalid key → exit 3
$ heygen auth status
{"error":{"code":"auth_error","message":"invalid API key"}}

# No key configured → exit 3
$ heygen auth status
{"error":{"code":"auth_error","message":"no API key found","hint":"Set HEYGEN_API_KEY env var or run: heygen auth login"}}

skipAuth restructured: Moved skipAuth annotation from the auth group to auth login specifically. auth status intentionally resolves auth — if no key is configured, it fails with the standard auth error (exit 3) before the API call. auth login continues to skip auth as before.

Reuses generated spec: Calls ctx.client.Execute(gen.UserMeGet, ...) — same endpoint as heygen user me get. If the API path or response shape changes, both commands update together.

Auth vs server errors: Distinguishable by exit code. Invalid key → exit 3 (auth_error). Server down → exit 1 (server_error/network_error). Retry transport handles transient failures before surfacing.

Stacked on PR #43 (SKILL.md).

Testing

3 tests: success (200 → exit 0, stdout has user email), invalid key (401 → exit 3, stderr has auth_error), no key (exit 3 with hint to set env var or run auth login).

Existing TestAuthLogin_SkipsAuth continues passing — skipAuth annotation moved to login, not removed.

All tests use httptest.Server — no real API calls.

@somanshreddy somanshreddy force-pushed the 04-03-docs_add_skill_md branch from 0362748 to 60a8b10 Compare April 3, 2026 10:47
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch from 4c6c591 to ab88544 Compare April 3, 2026 10:48
@somanshreddy somanshreddy force-pushed the 04-03-docs_add_skill_md branch from b6f2b8a to 54f2002 Compare April 3, 2026 21:15
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch 2 times, most recently from 380bfbc to f3bb215 Compare April 3, 2026 22:25
@somanshreddy somanshreddy force-pushed the 04-03-docs_add_skill_md branch from 54f2002 to f04298c Compare April 3, 2026 22:25
@somanshreddy somanshreddy changed the base branch from 04-03-docs_add_skill_md to graphite-base/44 April 3, 2026 22:34
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch from f3bb215 to 224b45f Compare April 3, 2026 22:42
@somanshreddy somanshreddy marked this pull request as ready for review April 3, 2026 23:30
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch from 224b45f to a2a10ff Compare April 3, 2026 23:37
@graphite-app graphite-app bot changed the base branch from graphite-base/44 to 04-03-docs_add_skill_md April 3, 2026 23:37
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch 2 times, most recently from e536cdb to c085697 Compare April 6, 2026 08:30
@somanshreddy somanshreddy force-pushed the 04-03-docs_add_skill_md branch from 7008292 to 6507936 Compare April 6, 2026 08:30
@somanshreddy somanshreddy changed the base branch from 04-03-docs_add_skill_md to graphite-base/44 April 6, 2026 08:35
@somanshreddy somanshreddy changed the base branch from graphite-base/44 to 04-06-cmd_increase_default_wait_timeout April 6, 2026 08:35
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch from c085697 to 0348dcb Compare April 6, 2026 08:42
@somanshreddy somanshreddy force-pushed the 04-06-cmd_increase_default_wait_timeout branch from 6507936 to 4078c6b Compare April 6, 2026 08:42
Copy link
Copy Markdown
Collaborator Author

somanshreddy commented Apr 6, 2026

Merge activity

  • Apr 6, 8:49 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 6, 9:03 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 6, 9:04 AM UTC: @somanshreddy merged this pull request with Graphite.

@somanshreddy somanshreddy changed the base branch from 04-06-cmd_increase_default_wait_timeout to graphite-base/44 April 6, 2026 09:01
@somanshreddy somanshreddy changed the base branch from graphite-base/44 to main April 6, 2026 09:02
@somanshreddy somanshreddy force-pushed the 04-03-cmd_add_auth_status branch from 0348dcb to 516c2fc Compare April 6, 2026 09:03
@somanshreddy somanshreddy merged commit 26aeadb into main Apr 6, 2026
8 checks passed
@somanshreddy somanshreddy deleted the 04-03-cmd_add_auth_status branch April 6, 2026 09:04
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