hf auth login supports --force re-login
Introduced 2026-03-12 · score 0.98
HOW TO USE IT
When already logged in and you need to switch tokens, run `hf auth login --force` to start the login flow again. Without `--force`, login skips when already logged in.
hf auth login --forceWHY THIS HELPS
Switch the Hugging Face token used for repository work when already logged in.
BEFORE THIS CHANGE
Previously, `hf auth login` skipped the login flow when already logged in; the v1.7.0 release note describes `--force` as the way to explicitly go through it again.
REQUIREMENTS AND LIMITATIONS
- Version: v1.7.0
- --force: Force re-login even if already logged in; defaults to false.
- Prerequisite: Login uses a token from huggingface.co/settings/tokens.
- The force flag is for explicitly going through the full login flow again.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.7.0
- https://github.com/huggingface/huggingface_hub/blob/v1.7.0/src/huggingface_hub/cli/auth.py
Check the installed version and the source before using it. Entry JSON