hf spaces logs retrieves Space run and build logs
Introduced 2026-04-16 · score 0.98
HOW TO USE IT
When debugging a Space build failure or runtime crash, run `hf spaces logs <space_id>` for available run logs; add `--build` for build logs, `-f` to follow, or `-n <count>` to limit output to the last lines.
hf spaces logs username/my-spacehf spaces logs username/my-space --buildhf spaces logs -f username/my-space
hf spaces logs -n 50 username/my-spaceWHY THIS HELPS
Debug a Space that fails to build or crashes at runtime.
BEFORE THIS CHANGE
Open the browser to retrieve Space logs.
REQUIREMENTS AND LIMITATIONS
- Version: v1.11.0
- SPACE_ID (required): Space ID, such as `username/repo-name`.
- --build: Fetch container build logs instead of run logs.
- -f, --follow: Stream log output until the server closes the stream; without it, print currently available logs.
- -n, --tail INTEGER: Number of lines to show from the end of the logs.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.11.0
- https://huggingface.co/docs/huggingface_hub/en/package_reference/cli
Check the installed version and the source before using it. Entry JSON