---
title: "pageNumber.insert: Page Number — Doc kit command — Kition"
description: "Inserts a page number field at the top or bottom of the page or at the caret, aligned left, centre or right (at the caret: the caret's paragraph, when align is given), optionally as Page x of y."
canonical: "https://developer.kition.ai/docs/kits/doc/commands/pageNumber.insert"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/doc/commands/pageNumber.insert](https://developer.kition.ai/docs/kits/doc/commands/pageNumber.insert)

# pageNumber.insert

**Page Number.** Inserts a page number field at the top or bottom of the page or at the caret, aligned left, centre or right (at the caret: the caret's paragraph, when align is given), optionally as Page x of y.

- Kit: Doc 0.1.0 (.docx); reference: [Doc kit commands](https://developer.kition.ai/docs/kits/doc.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `"left" \| "center" \| "right"` | no |  |
| `format` | `string` | no | like x of y |
| `position` | `"top" \| "bottom" \| "current"` | no |  |

## Call through doc_run

```text
doc_run {
  "path": "<file>.docx",
  "steps": [{ "command": "pageNumber.insert" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `align`, `format`, `position`. doc_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": {
    "align": {
      "enum": [
        "left",
        "center",
        "right"
      ],
      "type": "string"
    },
    "format": {
      "description": "like x of y",
      "type": "string"
    },
    "position": {
      "enum": [
        "top",
        "bottom",
        "current"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/doc-darwin-arm64@0.1.0 and the kit itself (doc_commands through @kition/cli@0.1.1, built from KitionAI/kition-doc@41e14a8).
