---
title: "template.expand: Expand a template — Note kit command — Kition"
description: "Answers `markdown` with the template variables (`{{title}}`, `{{date}}`, `{{time}}`, `{{date:FORMAT}}`) filled in, without changing the note; pass the result to `note.write` or `section.insert`."
canonical: "https://developer.kition.ai/docs/kits/note/commands/template.expand"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/note/commands/template.expand](https://developer.kition.ai/docs/kits/note/commands/template.expand)

# template.expand

**Expand a template.** Answers `markdown` with the template variables (`{{title}}`, `{{date}}`, `{{time}}`, `{{date:FORMAT}}`) filled in, without changing the note; pass the result to `note.write` or `section.insert`.

- Kit: Note 0.3.0 (Markdown (.md)); reference: [Note kit commands](https://developer.kition.ai/docs/kits/note.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | `string` | no | The date and time to use, ISO 8601 (2026-10-23 or 2026-10-23T14:05); now by default. |
| `markdown` | `string` | yes | Template text with {{title}}, {{date}}, {{time}} and {{date:FORMAT}} (YYYY, MM, DD, HH, mm, ss). |
| `title` | `string` | no | What {{title}} becomes. |

## Call through note_run

```text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "template.expand", "params": { "markdown": <string> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `date`, `title`. note_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `markdown` | `string` | yes | The template with its variables filled in. |

```json
{
  "additionalProperties": false,
  "properties": {
    "markdown": {
      "description": "The template with its variables filled in.",
      "type": "string"
    }
  },
  "required": [
    "markdown"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "date": {
      "description": "The date and time to use, ISO 8601 (2026-10-23 or 2026-10-23T14:05); now by default.",
      "type": "string"
    },
    "markdown": {
      "description": "Template text with {{title}}, {{date}}, {{time}} and {{date:FORMAT}} (YYYY, MM, DD, HH, mm, ss).",
      "type": "string"
    },
    "title": {
      "description": "What {{title}} becomes.",
      "type": "string"
    }
  },
  "required": [
    "markdown"
  ],
  "type": "object"
}
```

Generated from kition-sdk packages/script/kits/note.ts and the kit itself (kition-note@69e14d9).
