> ## Documentation Index
> Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Template Commands

> List built-in templates and build your own custom sandbox images with declaw template.

`declaw template` (alias `declaw tpl`) lists and builds the base images sandboxes boot from. See [Templates](/features/templates) for the concept and the built-in set.

## list

List available templates (alias `ls`).

```bash theme={null}
declaw template list
```

## build

Build a custom template when the built-in templates don't have the dependencies you need. Provide a Dockerfile, or assemble the spec from flags.

```bash theme={null}
declaw template build --dockerfile Dockerfile
declaw template build --base-image ubuntu:22.04 --apt-package ffmpeg --run-cmd "pip install numpy"
```

| Flag            | Default | Description                                                        |
| --------------- | ------- | ------------------------------------------------------------------ |
| `--dockerfile`  |         | Path to a Dockerfile; its contents become the build spec           |
| `--base-image`  |         | Base image to build from                                           |
| `--apt-package` |         | apt package to install. Repeatable                                 |
| `--run-cmd`     |         | Command to run during the build. Repeatable                        |
| `--start-cmd`   |         | Command to run when a sandbox starts                               |
| `--disk-mb`     | `0`     | Disk size in MB (`0` = default)                                    |
| `--no-wait`     | `false` | Return immediately and build in the background instead of blocking |

The command prints the build ID, status, and resulting template ID.

## info

Show details for a template.

```bash theme={null}
declaw template info my-template
```

## delete

Delete a template.

```bash theme={null}
declaw template delete my-template
```

## Next steps

* [Templates](/features/templates) — built-in templates and the build API
* [Sandbox commands](/cli/sandbox) — create a sandbox from a template
