sincecutoff.com
← all changes

hf auth whoami supports JSON format

Introduced 2026-03-20 · score 0.95

HOW TO USE IT

When a script needs the authenticated Hugging Face identity as JSON, run `hf auth whoami --format json`.

hf auth whoami --format json

WHY THIS HELPS

Check the authenticated identity in a script that consumes JSON output.

BEFORE THIS CHANGE

The command printed the username and organizations in its default human-readable output.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.7.2
  • --format json: Selects JSON output; the command’s default format is table.
  • Prerequisite: A locally available Hugging Face token is needed to retrieve the authenticated identity; if no token is found, the command reports “Not logged in” and exits.
  • Prerequisite: Install the CLI, for example with `pip install -U huggingface_hub`.
  • Docs conflict: The v1.7.2 CLI guide says `hf auth whoami` has no options, but the same-version CLI reference and source define `--format`; the source shows the JSON option is implemented.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card