Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions apps/docs/content/docs/cli/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: CLI
description: Manage your changelog posts from the terminal using the changes.page CLI.
---

The `@changespage/cli` lets you manage posts directly from your terminal — create, update, list, and delete posts without leaving the command line.

## Install

```bash
npm install -g @changespage/cli
```

## Setup

```bash
chp configure
```

You'll be prompted to enter your page secret key. Find it in your page settings under **Integrations**.

Alternatively, use the `CHANGESPAGE_SECRET_KEY` environment variable or `--secret-key` flag.

## Commands

<Cards>
<Card title="Managing Posts" href="/docs/cli/posts" />
</Cards>

## Global Options

| Flag | Description |
|---|---|
| `--secret-key <key>` | Page secret key |
| `--pretty` | Pretty-print JSON output |
68 changes: 68 additions & 0 deletions apps/docs/content/docs/cli/posts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Managing Posts
description: Create, list, update, and delete changelog posts using the CLI.
---

## List posts

```bash
chp posts list
chp posts list --status published --limit 5
```

### List options

| Flag | Description |
|---|---|
| `--status <status>` | Filter by status: `draft`, `published`, `archived` |
| `--limit <n>` | Max number of posts (default: `20`) |
| `--offset <n>` | Offset for pagination (default: `0`) |

## Get a post

```bash
chp posts get <id>
```

## Create a post

Content is read from stdin:

```bash
echo "Release notes here" | chp posts create --title "v2.0" --tags new,fix --status draft
```

Or from a file:

```bash
chp posts create --title "v2.0" --tags new,fix --status published < content.md
```

## Update a post

```bash
echo "Updated content" | chp posts update <id> --title "v2.1" --tags improvement
```

Update metadata only (no stdin pipe):

```bash
chp posts update <id> --status published
```

## Delete a post

```bash
chp posts delete <id>
```

## Create / Update options

| Flag | Description |
|---|---|
| `--title <title>` | Post title (required for create) |
| `--tags <tags>` | Comma-separated tags: `new`, `fix`, `improvement`, `announcement`, `alert` |
| `--status <status>` | `draft`, `published`, `archived` (default: `draft`) |
| `--publish-at <date>` | ISO date for scheduled publish |
| `--allow-reactions` / `--no-allow-reactions` | Enable or disable reactions |
| `--notes <notes>` | Internal notes |
1 change: 1 addition & 0 deletions apps/docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description: changelog made smarter, faster, and user-focused.

<Cards>
<Card title="Setup Widget" href="/docs/widget" />
<Card title="CLI" href="/docs/cli" />
<Card title="SDKs" href="/docs/sdk" />
<Card title="API Reference" href="/docs/api/page" />
</Cards>
Loading