@clickminded/coauthor-cli 0.0.58 → 0.0.59
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
CHANGED
|
@@ -80,6 +80,7 @@ coauthor repurpose download <id> --out ./social # copy-ready files
|
|
|
80
80
|
coauthor share <id> --json # public read-only link
|
|
81
81
|
coauthor post-details show <id> --json # SEO title, meta description, slug, excerpt
|
|
82
82
|
coauthor post-details set <id> --seo-title "..." --json # exports use these as defaults
|
|
83
|
+
coauthor post-details set <id> --live-url https://example.com/post/ # where the post is live (--clear-live-url removes it)
|
|
83
84
|
coauthor draft get <id> --format markdown --frontmatter --json # markdown with YAML frontmatter
|
|
84
85
|
coauthor export wordpress <id> --yes --json # creates a WordPress draft post (--slug to override)
|
|
85
86
|
coauthor credits <id> --json
|
package/dist/commands.js
CHANGED
|
@@ -754,8 +754,22 @@ async function runPostDetailsCommand(action, input, client) {
|
|
|
754
754
|
if (value !== undefined)
|
|
755
755
|
body[field] = value.trim() ? value : null;
|
|
756
756
|
}
|
|
757
|
+
// The live URL is not an SEO field: the server stores it outside user_edited_fields and keeps it
|
|
758
|
+
// across regeneration and exports. --clear-live-url removes it (auto-detection then leaves the post alone).
|
|
759
|
+
const liveUrl = getString(input.values, 'live-url')?.trim();
|
|
760
|
+
const clearLiveUrl = getBoolean(input.values, 'clear-live-url');
|
|
761
|
+
if (clearLiveUrl && liveUrl)
|
|
762
|
+
throw new Error('Pass either --live-url <url> or --clear-live-url, not both.');
|
|
763
|
+
if (liveUrl) {
|
|
764
|
+
if (!/^https?:\/\/\S+$/i.test(liveUrl))
|
|
765
|
+
throw new Error('--live-url needs a full address starting with http:// or https://.');
|
|
766
|
+
body.published_url = liveUrl;
|
|
767
|
+
}
|
|
768
|
+
else if (clearLiveUrl) {
|
|
769
|
+
body.published_url = null;
|
|
770
|
+
}
|
|
757
771
|
if (Object.keys(body).length === 0) {
|
|
758
|
-
throw new Error('Usage: coauthor post-details set <projectId> [--seo-title "..."] [--description "..."] [--slug "..."] [--excerpt "..."]');
|
|
772
|
+
throw new Error('Usage: coauthor post-details set <projectId> [--seo-title "..."] [--description "..."] [--slug "..."] [--excerpt "..."] [--live-url <url> | --clear-live-url]');
|
|
759
773
|
}
|
|
760
774
|
return { ok: true, data: await client.request({ method: 'PATCH', path, body }) };
|
|
761
775
|
}
|
|
@@ -3558,10 +3572,11 @@ function commandHelp(command) {
|
|
|
3558
3572
|
].join('\n'),
|
|
3559
3573
|
'post-details': [
|
|
3560
3574
|
'Usage: coauthor post-details show <project-id> [--json]',
|
|
3561
|
-
' coauthor post-details set <project-id> [--seo-title "..."] [--description "..."] [--slug "..."] [--excerpt "..."] [--json]',
|
|
3575
|
+
' coauthor post-details set <project-id> [--seo-title "..."] [--description "..."] [--slug "..."] [--excerpt "..."] [--live-url <url> | --clear-live-url] [--json]',
|
|
3562
3576
|
'',
|
|
3563
3577
|
'Post details are the SEO title, meta description, slug and excerpt CoAuthor writes after a draft. Exports use them as defaults.',
|
|
3564
3578
|
'set changes only the fields you pass; an empty value clears a field. Edited fields are kept when the draft is regenerated.',
|
|
3579
|
+
'The live URL is where the post is published. show returns published_url and published_url_source (export, manual, auto_detect or cleared). --live-url sets it by hand (an http or https address) and wins over later exports; --clear-live-url removes it, and CoAuthor then does not look for it again.',
|
|
3565
3580
|
'Posts drafted before post details launched have none (show returns post_details: null; set returns post_details_unavailable).',
|
|
3566
3581
|
'SEO posts also return seo: the target keyword, market, SEO research credits and a checklist computed from the current draft (pass, warn, fail or skip per check).',
|
|
3567
3582
|
].join('\n'),
|
package/dist/parser.js
CHANGED
|
@@ -54,6 +54,8 @@ const OPTIONS = {
|
|
|
54
54
|
'connection-id': { type: 'string' },
|
|
55
55
|
excerpt: { type: 'string' },
|
|
56
56
|
'seo-title': { type: 'string' },
|
|
57
|
+
'live-url': { type: 'string' },
|
|
58
|
+
'clear-live-url': { type: 'boolean', default: false },
|
|
57
59
|
keyword: { type: 'string' },
|
|
58
60
|
seo: { type: 'string' },
|
|
59
61
|
'confirm-reset': { type: 'boolean', default: false },
|
package/package.json
CHANGED
|
@@ -20,10 +20,14 @@ After a draft, CoAuthor writes the post's SEO title, meta description, slug, and
|
|
|
20
20
|
```sh
|
|
21
21
|
coauthor post-details show <id> --json # data.post_details (null for drafts made before post details launched)
|
|
22
22
|
coauthor post-details set <id> --seo-title "..." --description "..." --slug "..." --excerpt "..." --json
|
|
23
|
+
coauthor post-details set <id> --live-url https://example.com/my-post/ --json # where the post is live
|
|
24
|
+
coauthor post-details set <id> --clear-live-url --json
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
`set` changes only the fields you pass; an empty value clears one. Fields the user or you edited are kept when the draft is regenerated. Keep the SEO title near 60 characters and the description near 155. `post_details_unavailable` means the draft predates post details.
|
|
26
28
|
|
|
29
|
+
The live URL is where the post is published. `post_details.published_url` holds it (null until it is known) and `published_url_source` says where it came from: `export` (an export reported the post live, or a WordPress post the user published afterwards), `manual` (set with `--live-url` or in the app), `auto_detect` (CoAuthor found the page on the user's site) or `cleared` (removed on purpose). Set it when the user tells you where a post went live. A URL set by hand wins over later exports, and `--clear-live-url` removes it so CoAuthor does not look for it again. It must be an `http` or `https` address, and it is not one of the four SEO fields, so it never counts as an edited field.
|
|
30
|
+
|
|
27
31
|
For SEO posts on a profile with a website, `post_details.incoming_link_suggestions` lists existing pages on the user's site that could link to the new post: `{status, suggestions: [{url, title, anchor, sentence}]}`. `status` is `ready`, `none`, or `index_not_ready` (the site was still being indexed when the draft was written; links appear on the next post). It is read-only. After the post is published, offer the user the sentences to add on those pages, linking the anchor text to the new post's URL. It is `null` for other posts.
|
|
28
32
|
|
|
29
33
|
For SEO posts, `post-details show` also returns `seo`: the target `keyword`, its `market`, `seo_research_credits`, and a `checks` list computed from the current draft and title. Each check has an `id`, a `status` (`pass`, `warn`, `fail`, or `skip` when there is nothing to measure) and a plain `detail`. The ids are `keyword_in_title`, `keyword_in_intro` (first 100 words), `secondary_in_h2`, `table_stakes`, `angle_section`, `questions_answered`, `internal_link`, `outbound_sources` and `length`. A `fail` on the title is worth fixing before publishing: edit it with `project rename`. A `warn` on `keyword_in_intro` is fine when the keyword wouldn't read naturally in the opening, so don't force it in. `secondary_in_h2` and `questions_answered` are optional: they report `pass` or `skip`, never `warn`. `seo` is `null` for other posts.
|
|
@@ -50,7 +50,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
|
|
|
50
50
|
| `invalid_seo_mode` | `--seo` or `set-mode` got something other than `optimize`, `my-way` or `off`, or `--seo off` was combined with `--keyword`. | Pass one of the three modes; drop `--keyword` with `off`. |
|
|
51
51
|
| `no_search_target` | `search-brief set-mode optimize` or `my-way` on a project with no target keyword. | Set one with `search-brief set-keyword`, or let the outline pick one. |
|
|
52
52
|
| `post_details_unavailable` | The draft was made before post details launched, so it has none to edit. | Pass the slug and description to the export directly. |
|
|
53
|
-
| `invalid_post_details` | `post-details set` got something other than text for a field. | Pass plain text with `--seo-title`, `--description`, `--slug`, or `--excerpt`. |
|
|
53
|
+
| `invalid_post_details` | `post-details set` got something other than text for a field, or a live URL that is not an `http` or `https` address. | Pass plain text with `--seo-title`, `--description`, `--slug`, or `--excerpt`, and a full address with `--live-url`. |
|
|
54
54
|
| `structured_brief` | `image generate --prompt` on a comparison or technical-diagram image, which is built from structured fields. | Generate without `--prompt`, then `image edit --edit-prompt "..."`. |
|
|
55
55
|
| `uploaded_image` | `image generate` on an image the user replaced with their own file. | Use `image edit --edit-prompt "..."`, or `image replace` again. |
|
|
56
56
|
| `not_a_panel` | `image replace` on an article image. | Only slideshow and video panels can be replaced from the CLI. |
|
|
@@ -458,10 +458,14 @@ After a draft, CoAuthor writes the post's SEO title, meta description, slug, and
|
|
|
458
458
|
```sh
|
|
459
459
|
coauthor post-details show <id> --json # data.post_details (null for drafts made before post details launched)
|
|
460
460
|
coauthor post-details set <id> --seo-title "..." --description "..." --slug "..." --excerpt "..." --json
|
|
461
|
+
coauthor post-details set <id> --live-url https://example.com/my-post/ --json # where the post is live
|
|
462
|
+
coauthor post-details set <id> --clear-live-url --json
|
|
461
463
|
```
|
|
462
464
|
|
|
463
465
|
`set` changes only the fields you pass; an empty value clears one. Fields the user or you edited are kept when the draft is regenerated. Keep the SEO title near 60 characters and the description near 155. `post_details_unavailable` means the draft predates post details.
|
|
464
466
|
|
|
467
|
+
The live URL is where the post is published. `post_details.published_url` holds it (null until it is known) and `published_url_source` says where it came from: `export` (an export reported the post live, or a WordPress post the user published afterwards), `manual` (set with `--live-url` or in the app), `auto_detect` (CoAuthor found the page on the user's site) or `cleared` (removed on purpose). Set it when the user tells you where a post went live. A URL set by hand wins over later exports, and `--clear-live-url` removes it so CoAuthor does not look for it again. It must be an `http` or `https` address, and it is not one of the four SEO fields, so it never counts as an edited field.
|
|
468
|
+
|
|
465
469
|
For SEO posts on a profile with a website, `post_details.incoming_link_suggestions` lists existing pages on the user's site that could link to the new post: `{status, suggestions: [{url, title, anchor, sentence}]}`. `status` is `ready`, `none`, or `index_not_ready` (the site was still being indexed when the draft was written; links appear on the next post). It is read-only. After the post is published, offer the user the sentences to add on those pages, linking the anchor text to the new post's URL. It is `null` for other posts.
|
|
466
470
|
|
|
467
471
|
For SEO posts, `post-details show` also returns `seo`: the target `keyword`, its `market`, `seo_research_credits`, and a `checks` list computed from the current draft and title. Each check has an `id`, a `status` (`pass`, `warn`, `fail`, or `skip` when there is nothing to measure) and a plain `detail`. The ids are `keyword_in_title`, `keyword_in_intro` (first 100 words), `secondary_in_h2`, `table_stakes`, `angle_section`, `questions_answered`, `internal_link`, `outbound_sources` and `length`. A `fail` on the title is worth fixing before publishing: edit it with `project rename`. A `warn` on `keyword_in_intro` is fine when the keyword wouldn't read naturally in the opening, so don't force it in. `secondary_in_h2` and `questions_answered` are optional: they report `pass` or `skip`, never `warn`. `seo` is `null` for other posts.
|
|
@@ -712,7 +716,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
|
|
|
712
716
|
| `invalid_seo_mode` | `--seo` or `set-mode` got something other than `optimize`, `my-way` or `off`, or `--seo off` was combined with `--keyword`. | Pass one of the three modes; drop `--keyword` with `off`. |
|
|
713
717
|
| `no_search_target` | `search-brief set-mode optimize` or `my-way` on a project with no target keyword. | Set one with `search-brief set-keyword`, or let the outline pick one. |
|
|
714
718
|
| `post_details_unavailable` | The draft was made before post details launched, so it has none to edit. | Pass the slug and description to the export directly. |
|
|
715
|
-
| `invalid_post_details` | `post-details set` got something other than text for a field. | Pass plain text with `--seo-title`, `--description`, `--slug`, or `--excerpt`. |
|
|
719
|
+
| `invalid_post_details` | `post-details set` got something other than text for a field, or a live URL that is not an `http` or `https` address. | Pass plain text with `--seo-title`, `--description`, `--slug`, or `--excerpt`, and a full address with `--live-url`. |
|
|
716
720
|
| `structured_brief` | `image generate --prompt` on a comparison or technical-diagram image, which is built from structured fields. | Generate without `--prompt`, then `image edit --edit-prompt "..."`. |
|
|
717
721
|
| `uploaded_image` | `image generate` on an image the user replaced with their own file. | Use `image edit --edit-prompt "..."`, or `image replace` again. |
|
|
718
722
|
| `not_a_panel` | `image replace` on an article image. | Only slideshow and video panels can be replaced from the CLI. |
|