@clickminded/coauthor-cli 0.0.45 → 0.0.46
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/dist/commands.js
CHANGED
|
@@ -711,6 +711,19 @@ function describeMarketCoverage(data) {
|
|
|
711
711
|
}
|
|
712
712
|
return undefined;
|
|
713
713
|
}
|
|
714
|
+
// SEO mode (7.3): a one-line summary of the checklist that comes with post details.
|
|
715
|
+
function postSeoMessage(data) {
|
|
716
|
+
const seo = getResponseValue(data, 'seo');
|
|
717
|
+
if (!seo || typeof seo.keyword !== 'string')
|
|
718
|
+
return undefined;
|
|
719
|
+
const count = (key) => (typeof seo.counts?.[key] === 'number' ? seo.counts[key] : 0);
|
|
720
|
+
const parts = [`${count('pass')} passed`];
|
|
721
|
+
if (count('warn'))
|
|
722
|
+
parts.push(`${count('warn')} worth a look`);
|
|
723
|
+
if (count('fail'))
|
|
724
|
+
parts.push(`${count('fail')} missing`);
|
|
725
|
+
return `Targeting "${seo.keyword}": SEO checklist ${parts.join(', ')}. Details in data.seo.checks.`;
|
|
726
|
+
}
|
|
714
727
|
async function runPostDetailsCommand(action, input, client) {
|
|
715
728
|
const projectId = requireProjectId(input);
|
|
716
729
|
const path = `projects/${encodeURIComponent(projectId)}/post-details`;
|
|
@@ -719,7 +732,7 @@ async function runPostDetailsCommand(action, input, client) {
|
|
|
719
732
|
const details = getResponseValue(data, 'post_details');
|
|
720
733
|
return details === null
|
|
721
734
|
? { ok: true, message: 'This post has no post details. They are generated for drafts created after the feature launched.', data }
|
|
722
|
-
: { ok: true, data };
|
|
735
|
+
: { ok: true, message: postSeoMessage(data), data };
|
|
723
736
|
}
|
|
724
737
|
if (action === 'set') {
|
|
725
738
|
const body = parseJsonOption(input.values);
|
|
@@ -2940,6 +2953,7 @@ function commandHelp(command) {
|
|
|
2940
2953
|
'Post details are the SEO title, meta description, slug and excerpt CoAuthor writes after a draft. Exports use them as defaults.',
|
|
2941
2954
|
'set changes only the fields you pass; an empty value clears a field. Edited fields are kept when the draft is regenerated.',
|
|
2942
2955
|
'Posts drafted before post details launched have none (show returns post_details: null; set returns post_details_unavailable).',
|
|
2956
|
+
'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).',
|
|
2943
2957
|
].join('\n'),
|
|
2944
2958
|
share: [
|
|
2945
2959
|
'Usage: coauthor share <project-id> [--json]',
|
package/package.json
CHANGED
|
@@ -26,6 +26,8 @@ coauthor post-details set <id> --seo-title "..." --description "..." --slug "...
|
|
|
26
26
|
|
|
27
27
|
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
28
|
|
|
29
|
+
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 or intro is worth fixing before publishing: edit the title with `project rename`, or the first paragraph with `draft revise`. `seo` is `null` for other posts.
|
|
30
|
+
|
|
29
31
|
## Share link (public)
|
|
30
32
|
|
|
31
33
|
`coauthor share <id> --json` returns `data.share_url`, a public read-only page anyone with the link can open. Create one only when the user asks for a link. Calling it again returns the same link.
|
|
@@ -406,6 +406,8 @@ coauthor post-details set <id> --seo-title "..." --description "..." --slug "...
|
|
|
406
406
|
|
|
407
407
|
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.
|
|
408
408
|
|
|
409
|
+
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 or intro is worth fixing before publishing: edit the title with `project rename`, or the first paragraph with `draft revise`. `seo` is `null` for other posts.
|
|
410
|
+
|
|
409
411
|
### Share link (public)
|
|
410
412
|
|
|
411
413
|
`coauthor share <id> --json` returns `data.share_url`, a public read-only page anyone with the link can open. Create one only when the user asks for a link. Calling it again returns the same link.
|