hf spaces pause, restart, and update settings from the CLI
Introduced 2026-04-30 · score 0.98
HOW TO USE IT
When maintaining a Space, pause or restart it with `hf spaces pause` or `hf spaces restart`; use `--factory-reboot` for a clean rebuild. Update idle sleep time or hardware with `hf spaces settings`; `--sleep-time` requires upgraded hardware.
hf spaces pause <owner>/<space>hf spaces restart <owner>/<space> [--factory-reboot]hf spaces settings <owner>/<space> [--sleep-time <seconds>] [--hardware <flavor>]WHY THIS HELPS
When maintaining a Space used in a coding workflow, pause it, restart it, or update its sleep time or hardware from the CLI.
REQUIREMENTS AND LIMITATIONS
- Version: v1.13.0
- SPACE_ID (required): Space ID, such as `<owner>/<space>`.
- --factory-reboot: Rebuild the Space from scratch without using the build cache.
- --sleep-time INTEGER: Idle time in seconds before the Space sleeps; `-1` means never. Only available on upgraded hardware.
- --hardware FLAVOR: Set the Space hardware flavor; run `hf spaces hardware` to list options. The release note shows it used together with `--sleep-time`.
- -y: Skip the pause or restart confirmation prompt.
- Prerequisite: `--sleep-time` is only available on upgraded hardware.
- `--sleep-time` is only available on upgraded hardware.
- Pausing or restarting tears down the Space container, so data on its ephemeral filesystem is lost. Mount a Volume or bucket with `hf spaces volumes set` to persist data across restarts.
- Docs conflict: The v1.13.0 CLI reference documents `--factory-reboot`, `--sleep-time`, and `--hardware`, but does not list `-y` under pause or restart options; the v1.13.0 release note says `-y` skips their confirmation prompt.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.13.0
- https://github.com/huggingface/huggingface_hub/pull/4155
- https://github.com/huggingface/huggingface_hub/blob/v1.13.0/docs/source/en/package_reference/cli.md
Check the installed version and the source before using it. Entry JSON