deprecated_cli.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. """Deprecated `huggingface-cli` entry point. Warns and exits."""
  2. import shutil
  3. import sys
  4. from ._output import out
  5. def main() -> None:
  6. out.warning("`huggingface-cli` is deprecated and no longer works. Use `hf` instead.\n")
  7. if shutil.which("hf"):
  8. from huggingface_hub.cli._cli_utils import check_cli_update
  9. check_cli_update("huggingface_hub")
  10. out.hint("`hf` is already installed! Use it directly.\n")
  11. else:
  12. out.hint(
  13. "Install `hf`:\n"
  14. " Standalone (recommended): curl -LsSf https://hf.co/cli/install.sh | bash\n"
  15. " Using Homebrew: brew install hf\n"
  16. " Using pip: pip install huggingface_hub\n",
  17. )
  18. out.hint(
  19. "Examples:\n"
  20. " hf auth login\n"
  21. " hf download unsloth/gemma-4-31B-it-GGUF\n"
  22. " hf upload my-cool-model . .\n"
  23. ' hf models ls --search "gemma"\n'
  24. " hf repos ls --format json\n"
  25. " hf jobs run python:3.12 python -c 'print(\"Hello!\")'\n"
  26. " hf --help\n",
  27. )
  28. sys.exit(1)