hf auth login --token $HF_TOKEN

Category: AI/ML Tooling

hf auth login --token $HF_TOKEN

Log in with a token variable

Logs in non-interactively using the token stored in the HF_TOKEN environment variable, perfect for CI machines and scripts that cannot open a browser. The variable is single-quoted-safe because the shell expands it before hf runs. Add --add-to-git-credential to also let plain git commands authenticate.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.