@tryghost/ghst 0.15.2 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -4
- package/dist/index.js +327 -153
- package/dist/index.js.map +1 -1
- package/package.json +27 -25
package/README.md
CHANGED
|
@@ -155,7 +155,7 @@ Interactive destructive confirmations also emit `GHST_AGENT_NOTICE:` lines on st
|
|
|
155
155
|
| --- | --- |
|
|
156
156
|
| `-v`, `--version` | Print the installed `ghst` version |
|
|
157
157
|
| `--json` | Emit JSON output for automation |
|
|
158
|
-
| `--jq <filter>` | Apply jq
|
|
158
|
+
| `--jq <filter>` | Apply a jq filter to JSON output (full jq syntax; runs against the response envelope) |
|
|
159
159
|
| `--site <alias>` | Use configured site alias |
|
|
160
160
|
| `--url <url>` + `--staff-token <token>` | Use direct credentials for this invocation |
|
|
161
161
|
| `--enable-destructive-actions` | Allow destructive operations such as deletes |
|
|
@@ -173,6 +173,12 @@ ghst post publish <post-id> --newsletter weekly --email-segment all
|
|
|
173
173
|
|
|
174
174
|
The email delivery flags (`--newsletter`, `--email-only`, `--email-segment`) belong on `post publish` (or `post schedule` / `post update`) — Ghost's email send pipeline fires on the publish transition, not on create.
|
|
175
175
|
|
|
176
|
+
Pages share the same content flags as posts, including `--slug`, `--tags`, `--from-json`, and `--markdown-file`:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
ghst page create --title "About" --slug about --tags company,legal --markdown-file ./about.md
|
|
180
|
+
```
|
|
181
|
+
|
|
176
182
|
Bulk updates:
|
|
177
183
|
|
|
178
184
|
```bash
|
|
@@ -218,7 +224,8 @@ Direct API calls:
|
|
|
218
224
|
|
|
219
225
|
```bash
|
|
220
226
|
ghst api /posts/ --paginate --include-headers
|
|
221
|
-
ghst
|
|
227
|
+
ghst api /settings/ -X PUT -f settings[0].key=title -f settings[0].value="New title"
|
|
228
|
+
ghst --enable-destructive-actions api /posts/<post-id>/ -X DELETE
|
|
222
229
|
```
|
|
223
230
|
|
|
224
231
|
Analytics reporting:
|
|
@@ -299,14 +306,20 @@ Environment variables:
|
|
|
299
306
|
|
|
300
307
|
## Output, Automation, and Exit Codes
|
|
301
308
|
|
|
302
|
-
JSON + jq
|
|
309
|
+
JSON + jq filtering:
|
|
310
|
+
|
|
311
|
+
`--jq` accepts full jq syntax (pipes, indexing, object construction, and built-ins) and runs against the full JSON response, so reach into the collection with `.posts[]` rather than `.[]`:
|
|
303
312
|
|
|
304
313
|
```bash
|
|
305
314
|
ghst post list --json
|
|
306
315
|
ghst post list --json --jq '.posts[].title'
|
|
316
|
+
ghst post list --json --jq '.posts[0] | {title, slug}'
|
|
317
|
+
ghst post list --json --jq '.posts[] | select(.status == "published") | .slug'
|
|
307
318
|
```
|
|
308
319
|
|
|
309
|
-
|
|
320
|
+
Each result is printed on its own line as compact JSON, so the output stays pipe-friendly. An invalid `--jq` filter exits with code `2` (`USAGE_ERROR`) rather than leaking interpreter errors.
|
|
321
|
+
|
|
322
|
+
Raw `ghst api` requests allow ordinary `POST`/`PUT`/`PATCH` writes by default; `DELETE` requests and overwrite/import routes (e.g. `POST /db/`) require `--enable-destructive-actions`.
|
|
310
323
|
|
|
311
324
|
Common machine-safe practices:
|
|
312
325
|
|
|
@@ -343,6 +356,7 @@ Notes:
|
|
|
343
356
|
- `--cors-origin` accepts a single exact origin only, for example `https://app.example.com`.
|
|
344
357
|
- `--tools` accepts `all` or comma-separated group names such as `posts,stats`.
|
|
345
358
|
- Exposed MCP tools include `ghst/toolGroup` and `ghst/toolGroupTitle` metadata for clients that render grouped tools.
|
|
359
|
+
- MCP tools also carry standard `readOnlyHint`/`destructiveHint` annotations so clients like Claude Desktop group them into read-only and write/delete buckets automatically.
|
|
346
360
|
- MCP tools accept an optional `site` argument to target a configured site alias per call. When omitted, `ghst` uses the normal site resolution order.
|
|
347
361
|
- Use `ghost_site_list` to list configured site aliases without exposing stored credentials.
|
|
348
362
|
|