---
title: "file.setSource: Replace HTML — HTML kit command — Kition"
description: "Replaces the whole page with `source` (an HTML document, at most 8 MiB) as one undo step; answers `changed: false` when the source is already the same. The only way to edit the page."
canonical: "https://developer.kition.ai/docs/kits/html/commands/file.setSource"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/html/commands/file.setSource](https://developer.kition.ai/docs/kits/html/commands/file.setSource)

# file.setSource

**Replace HTML.** Replaces the whole page with `source` (an HTML document, at most 8 MiB) as one undo step; answers `changed: false` when the source is already the same. The only way to edit the page.

- Kit: HTML 0.1.0 (HTML (.html or .htm)); reference: [HTML kit commands](https://developer.kition.ai/docs/kits/html.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `source` | `string` | yes |  |

## Call through html_run

```text
html_run {
  "path": "<file>.html",
  "steps": [{ "command": "file.setSource", "params": { "source": <string> } }]
}
```

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

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "source": {
      "type": "string"
    }
  },
  "required": [
    "source"
  ],
  "type": "object"
}
```

Generated from the command list of @kition/html-darwin-arm64@0.1.0 and the kit itself (html_commands through @kition/cli@0.1.1, built from KitionAI/kition-html@e0ad2d3).
