# The default text log format streams progress to stderr during the build.nullspace template build --from-python-image 3.12 --name my-template --tag stable
# POST /v1/templates/build returns a text/event-stream of structured log# entries. Use -N to disable buffering. See the API reference for the# TemplateBuildLogEntry schema.curl -N -X POST "${NULLSPACE_API_URL}/v1/templates/build" \ -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{"name": "my-template", "tags": ["stable"], "base_image": "python:3.12"}'
Reconnect to a background build by ID:
from nullspace import TemplateBuildbuild = TemplateBuild.connect("tb_...")status = build.get_status(offset=0)for entry in status.entries: print(entry.kind, entry.message)print(status.next_offset)
# GET /v1/templates/builds/{build_id}/logs replays durable entries from offset# and follows live entries with follow=true. See the API reference for the# TemplateBuildLogEntry schema.curl -N "${NULLSPACE_API_URL}/v1/templates/builds/tb_.../logs?offset=0&follow=true" \ -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \ -H "Accept: text/event-stream"
The TypeScript SDK builds synchronously and streams logs via onLogEntry; it
does not reconnect to background builds. Use the Python SDK, CLI, or HTTP API.
Save status.next_offset after each poll and pass it to the next
get_status() or wait_until_terminal() call to fetch only new entries.