Hq login

From indigoai-us/hq-core · View interactive version

Hq login is an AI agent skill from the GitHub repository indigoai-us/hq-core. Sign into HQ Cognito, preferring status, refresh, then browser login.

How to use this skill

Skill file

/hq-login — HQ Cognito sign-in

Ensures ~/.hq/cognito-tokens.json holds a valid access token. Prefers the

cheapest viable path: status → refresh → browser login. Uses the owning identity commands and hq auth refresh.

Steps

  1. Status check — hq whoami --json. Inspect .authenticated, not the process exit code (signed-out also exits 0).

If true, print the identity and finish.

  1. Silent refresh — if .authenticated is false, run hq auth refresh.

On success, run hq whoami --json again and require .authenticated to be true.

  1. Browser login — if refresh fails (refresh token revoked / expired),

run hq login (opens Cognito Hosted UI in the default browser via

the loopback callback on port 8765). Wait for completion; the command

returns once the token is cached.

  1. Final report — use hq whoami --json to show the identity and read

.sessionExpiresAt for the session expiry and .sessionExpiring for the renewal hint.

If expiry is null, report that it is unavailable.

Notes

to report session status. Never print tokens.

CLI version ≥5.4 is required for hq-auth-refresh.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.