diff --git a/apps/docs/content/docs/cli/index.mdx b/apps/docs/content/docs/cli/index.mdx new file mode 100644 index 0000000..01d3002 --- /dev/null +++ b/apps/docs/content/docs/cli/index.mdx @@ -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 + + + + + +## Global Options + +| Flag | Description | +|---|---| +| `--secret-key ` | Page secret key | +| `--pretty` | Pretty-print JSON output | diff --git a/apps/docs/content/docs/cli/posts.mdx b/apps/docs/content/docs/cli/posts.mdx new file mode 100644 index 0000000..2eb6e26 --- /dev/null +++ b/apps/docs/content/docs/cli/posts.mdx @@ -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 ` | Filter by status: `draft`, `published`, `archived` | +| `--limit ` | Max number of posts (default: `20`) | +| `--offset ` | Offset for pagination (default: `0`) | + +## Get a post + +```bash +chp posts get +``` + +## 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 --title "v2.1" --tags improvement +``` + +Update metadata only (no stdin pipe): + +```bash +chp posts update --status published +``` + +## Delete a post + +```bash +chp posts delete +``` + +## Create / Update options + +| Flag | Description | +|---|---| +| `--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 | diff --git a/apps/docs/content/docs/index.mdx b/apps/docs/content/docs/index.mdx index cad7ef8..e58efd9 100644 --- a/apps/docs/content/docs/index.mdx +++ b/apps/docs/content/docs/index.mdx @@ -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>