Building a Template
await sandbox.templates.build(name, dockerfile)
Builds a new template from a Dockerfile.
A unique name for the template.
The Dockerfile content to build from.
TemplateInfo
Listing Templates
await sandbox.templates.list()
Returns all templates.
Returns: list[TemplateInfo]
Getting a Template
await sandbox.templates.get(name)
Gets a template by name.
Template name.
TemplateInfo
Deleting a Template
await sandbox.templates.delete(name)
Deletes a template by name.
Template name to delete.
None
TemplateInfo
TemplateInfo is a dataclass:
| Field | Type | Description |
|---|---|---|
template_id | str | Unique template identifier |
name | str | Template name |
tag | str | Image tag |
status | str | Build status: "building", "ready", "error" |