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

# tai templates

> Manage prompt and resource templates.

Manage prompt and resource templates.

```console theme={null}
$ tai templates [OPTIONS] COMMAND [ARGS]...
```

## `tai templates clear-cache`

Clear the template render cache.

Example: `tai templates clear-cache`

```console theme={null}
$ tai templates clear-cache [OPTIONS]
```

| Option                 | Description                            |
| ---------------------- | -------------------------------------- |
| `--json` / `--no-json` | Emit raw JSON instead of human tables. |

## `tai templates delete`

Delete a template.

Example: `tai templates delete prompts/greeting.md`

```console theme={null}
$ tai templates delete [OPTIONS] PATH
```

| Argument | Description                          |
| -------- | ------------------------------------ |
| `PATH`   | Template key to delete. *(required)* |

| Option                 | Description                            |
| ---------------------- | -------------------------------------- |
| `--json` / `--no-json` | Emit raw JSON instead of human tables. |

## `tai templates get`

Fetch a template's content and its input schema.

Example: `tai templates get prompts/greeting.md`

```console theme={null}
$ tai templates get [OPTIONS] TEMPLATE_ID
```

| Argument      | Description               |
| ------------- | ------------------------- |
| `TEMPLATE_ID` | Template id. *(required)* |

| Option                 | Description                            |
| ---------------------- | -------------------------------------- |
| `--json` / `--no-json` | Emit raw JSON instead of human tables. |

## `tai templates list`

List the available templates.

Example: `tai templates list`

```console theme={null}
$ tai templates list [OPTIONS]
```

| Option                 | Description                            |
| ---------------------- | -------------------------------------- |
| `--json` / `--no-json` | Emit raw JSON instead of human tables. |

## `tai templates render`

Render a template by id or inline content with kwargs.

Example: `tai templates render --template-id prompts/greeting.md --kw name=Ada`

```console theme={null}
$ tai templates render [OPTIONS]
```

| Option                 | Description                                                  |
| ---------------------- | ------------------------------------------------------------ |
| `--template-id` `TEXT` | A stored template id to render.                              |
| `--content` `TEXT`     | Inline template content to render.                           |
| `--kwargs` `TEXT`      | Render kwargs as a JSON object.                              |
| `--kw` `TEXT`          | A key=value render kwarg (repeatable; value parsed as JSON). |
| `--json` / `--no-json` | Emit raw JSON instead of human tables.                       |

## `tai templates upload`

Upload (create or overwrite) a template from a local file.

Example: `tai templates upload prompts/greeting.md --file greeting.md`

```console theme={null}
$ tai templates upload [OPTIONS] PATH
```

| Argument | Description                         |
| -------- | ----------------------------------- |
| `PATH`   | Template key to write. *(required)* |

| Option                 | Description                            |
| ---------------------- | -------------------------------------- |
| `--file` `FILE`        | Local file whose content to upload.    |
| `--json` / `--no-json` | Emit raw JSON instead of human tables. |
