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

# Site pages

> Create, list, update, and delete site pages from the TPC CLI.

# Site pages

Manage pages for the active product from the terminal. Every command is scoped to the active organization and product stored in local CLI config, and every JSON response includes the resolved scope.

<Note>
  Run `tpc org switch <org-slug>` and `tpc product switch <product-slug>` before any `tpc site page` command, or the CLI will refuse with guidance.
</Note>

List pages for the active product:

```bash theme={null}
tpc site page list
```

Filter the list (search, status, path prefix, pagination, sort):

```bash theme={null}
tpc site page list \
  --query pricing \
  --status published \
  --path-prefix blog/ \
  --page 2 --page-size 10 \
  --order-by createdAt --order-dir asc
```

Create a page from inline markdown:

```bash theme={null}
tpc site page create \
  --slug blog/hello-world \
  --title "Hello" \
  --content "# Hello"
```

Create a page from a local markdown file:

```bash theme={null}
tpc site page create \
  --slug docs/install \
  --title "Install" \
  --content-file ./install.md
```

Update page fields (only the flags you pass are changed):

```bash theme={null}
tpc site page update page_123 --title "Updated title"
tpc site page update page_123 --content-file ./page.md --status published
```

Pass an empty string to clear an optional field:

```bash theme={null}
tpc site page update page_123 --redirect-url ""
tpc site page update page_123 --content ""
```

Soft-delete one or more pages:

```bash theme={null}
tpc site page delete page_123
tpc site page delete page_123 page_456
```

Every command also supports `--format json` for scripting:

```bash theme={null}
tpc site page list --format json
```
