@clickminded/coauthor-cli 0.0.45 → 0.0.47
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
|
@@ -11,7 +11,7 @@ coauthor draft get <id> --format json --json # data.content, the editor do
|
|
|
11
11
|
|
|
12
12
|
The markdown and HTML have no H1: they start with the featured image (once generated) and then the first section. Add the title yourself from `coauthor project show <id> --json` (`data.project.title`) when you hand over a file. Images appear only after they have been generated, and their URLs are public, so the markdown can be pasted anywhere.
|
|
13
13
|
|
|
14
|
-
For a markdown file going into a static-site generator (Astro, Hugo, Next.js, Ghost), add `--frontmatter`: the markdown then starts with a YAML block holding the title, SEO title, meta description, slug, excerpt, and featured image from the post details. Drafts made before post details launched get no frontmatter.
|
|
14
|
+
For a markdown file going into a static-site generator (Astro, Hugo, Next.js, Ghost), add `--frontmatter`: the markdown then starts with a YAML block holding the title, SEO title, meta description, slug, excerpt, and featured image from the post details. Drafts made before post details launched get no frontmatter. SEO posts also get `keyword` and `secondary_keywords`. Every `draft get` response includes `search` in its metadata: `{keyword, secondary_keywords, market}` for SEO posts, `null` otherwise.
|
|
15
15
|
|
|
16
16
|
## Post details (SEO title, meta description, slug, excerpt)
|
|
17
17
|
|
|
@@ -26,6 +26,10 @@ 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
|
+
|
|
31
|
+
`post_details` also records where the post went: `search_keyword` (the search it was written for), `export_ref` (the last export's destination reference, for example `{destination: "wordpress", wordpress_post_id}`), and `published_url` / `published_at`, which are set only when an export reports the post is live. WordPress exports are always drafts, so they record `export_ref` only.
|
|
32
|
+
|
|
29
33
|
## Share link (public)
|
|
30
34
|
|
|
31
35
|
`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.
|
|
@@ -391,7 +391,7 @@ coauthor draft get <id> --format json --json # data.content, the editor do
|
|
|
391
391
|
|
|
392
392
|
The markdown and HTML have no H1: they start with the featured image (once generated) and then the first section. Add the title yourself from `coauthor project show <id> --json` (`data.project.title`) when you hand over a file. Images appear only after they have been generated, and their URLs are public, so the markdown can be pasted anywhere.
|
|
393
393
|
|
|
394
|
-
For a markdown file going into a static-site generator (Astro, Hugo, Next.js, Ghost), add `--frontmatter`: the markdown then starts with a YAML block holding the title, SEO title, meta description, slug, excerpt, and featured image from the post details. Drafts made before post details launched get no frontmatter.
|
|
394
|
+
For a markdown file going into a static-site generator (Astro, Hugo, Next.js, Ghost), add `--frontmatter`: the markdown then starts with a YAML block holding the title, SEO title, meta description, slug, excerpt, and featured image from the post details. Drafts made before post details launched get no frontmatter. SEO posts also get `keyword` and `secondary_keywords`. Every `draft get` response includes `search` in its metadata: `{keyword, secondary_keywords, market}` for SEO posts, `null` otherwise.
|
|
395
395
|
|
|
396
396
|
### Post details (SEO title, meta description, slug, excerpt)
|
|
397
397
|
|
|
@@ -406,6 +406,10 @@ 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
|
+
|
|
411
|
+
`post_details` also records where the post went: `search_keyword` (the search it was written for), `export_ref` (the last export's destination reference, for example `{destination: "wordpress", wordpress_post_id}`), and `published_url` / `published_at`, which are set only when an export reports the post is live. WordPress exports are always drafts, so they record `export_ref` only.
|
|
412
|
+
|
|
409
413
|
### Share link (public)
|
|
410
414
|
|
|
411
415
|
`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.
|