hf spaces ssh opens a Dev Mode SSH session
Introduced 2026-05-28 · score 0.98
HOW TO USE IT
For debugging or inspecting a Space, run `hf spaces ssh <owner>/<space>` to connect to its Dev Mode container; if Dev Mode is off, the CLI prompts to enable it. Use `--dry-run` to print the SSH command or `-i <path>` to forward a specific identity file.
hf spaces ssh <owner>/<space>hf spaces ssh <owner>/<space> --dry-runhf spaces ssh <owner>/<space> -i <identity-file-path>WHY THIS HELPS
Debug or inspect a Space's Dev Mode container over SSH.
REQUIREMENTS AND LIMITATIONS
- Version: v1.17.0
- SPACE_ID (required): Space ID, such as `<owner>/<space>`.
- --dry-run: Print the SSH command instead of running it.
- -i, --identity-file PATH: Identity file path forwarded to `ssh -i`.
- --auto: Enable Dev Mode without prompting if it is not already enabled.
- Prerequisite: Dev Mode must be running on the Space; the CLI prompts to enable it if disabled.
- Prerequisite: Register your SSH public key in Hugging Face user settings before connecting.
- The SSH session connects to a Space's Dev Mode container.
- If Dev Mode is not enabled, the CLI prompts to enable it.
- The SSH public key must be registered in HF user settings.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.17.0
- https://huggingface.co/docs/huggingface_hub/guides/cli
- https://huggingface.co/docs/huggingface_hub/main/en/package_reference/cli
- https://huggingface.co/docs/hub/en/spaces-dev-mode
Check the installed version and the source before using it. Entry JSON