Skip to content

feat: add poly whoami for credential validation and account info #25

@HelenGreul

Description

@HelenGreul

Problem or motivation

There is currently no way to verify that a POLY_ADK_KEY is valid without running a command that requires a project (e.g. poly pull). Developers who have just set up the tool — or who are debugging an auth failure — have no quick way to check: am I authenticated? What account/workspace am I connected to?

This leads to confusing error messages when the key is wrong, expired, or scoped to a different workspace, because the failure surfaces inside a project command rather than at the credential layer.

Proposed solution

Add a poly whoami command that validates the API key and prints account info:

$ poly whoami

  Authenticated as: Jane Smith ([email protected])
  Workspace:        Acme Corp
  Region:           us-east
  Key:              poly_k_••••••••••••••••3f9a

If the key is missing or invalid, exit with a clear error:

$ poly whoami
Error: POLY_ADK_KEY is not set. Set it with:
  export POLY_ADK_KEY=<your key>
$ poly whoami
Error: API key is invalid or expired. Contact your PolyAI representative to get a new key.

Alternatives considered

Adding a --check flag to poly init. But whoami is more discoverable, is a standard pattern in developer CLIs (gh auth status, heroku auth:whoami, vercel whoami), and works independently of having a project initialized.

Scope

CLI commands

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions