@clickminded/coauthor-cli 0.0.31 → 0.0.32

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/client.d.ts CHANGED
@@ -24,8 +24,8 @@ export declare class AgentClient {
24
24
  constructor(options: AgentClientOptions);
25
25
  request(options: RequestOptions): Promise<JsonValue>;
26
26
  /**
27
- * Fetches a public file (for example a rendered MP4 on the CDN) as bytes.
28
- * Sends no Authorization header: the URL is not an agent API endpoint.
27
+ * Fetches a public file (a rendered MP4 or slide PNG on the CDN) as bytes.
28
+ * Sends no Authorization header: these URLs are not on the CoAuthor API.
29
29
  */
30
30
  download(url: string): Promise<Uint8Array>;
31
31
  }
package/dist/client.js CHANGED
@@ -58,13 +58,16 @@ export class AgentClient {
58
58
  return parsedBody;
59
59
  }
60
60
  /**
61
- * Fetches a public file (for example a rendered MP4 on the CDN) as bytes.
62
- * Sends no Authorization header: the URL is not an agent API endpoint.
61
+ * Fetches a public file (a rendered MP4 or slide PNG on the CDN) as bytes.
62
+ * Sends no Authorization header: these URLs are not on the CoAuthor API.
63
63
  */
64
64
  async download(url) {
65
- const response = await this.fetchImpl(url, { method: 'GET' });
65
+ const target = new URL(url);
66
+ if (target.protocol !== 'https:' && target.protocol !== 'http:')
67
+ throw new Error(`Refusing to download a non-http URL: ${url}`);
68
+ const response = await this.fetchImpl(target, { method: 'GET' });
66
69
  if (!response.ok)
67
- throw new Error(`Download failed with HTTP ${response.status} for ${url}`);
70
+ throw new Error(`Download failed with HTTP ${response.status}: ${url}`);
68
71
  return new Uint8Array(await response.arrayBuffer());
69
72
  }
70
73
  }
@@ -9,5 +9,10 @@ export type CommandContext = {
9
9
  token: string;
10
10
  };
11
11
  export declare function runCommand(input: ParsedCommand, context: CommandContext): Promise<CommandResult>;
12
+ /**
13
+ * `--cta save,follow,custom:Join the webinar` -> the web app's cta_variants
14
+ * list (at most 4 endings, at most one custom).
15
+ */
16
+ export declare function parseSlideshowCtaOption(raw: string): JsonValue[];
12
17
  export declare function creditsExhaustedPauseResult(projectId: string, target: 'research' | 'draft', message: string, data: JsonValue): CommandResult;
13
18
  export declare function helpResult(command?: string[]): CommandResult;
package/dist/commands.js CHANGED
@@ -1494,6 +1494,52 @@ async function runLogCommand(action, input, client) {
1494
1494
  }
1495
1495
  const REPURPOSE_FORMATS = ['x-thread', 'x-post', 'linkedin', 'facebook', 'email', 'slideshow', 'video'];
1496
1496
  const REPURPOSE_GENERATABLE = ['x-thread', 'x-post', 'linkedin', 'facebook', 'email'];
1497
+ const SLIDESHOW_FORMAT_ALIASES = ['slideshow', 'carousel'];
1498
+ // Labels match the web app's CTA picker.
1499
+ const SLIDESHOW_CTA_LABELS = {
1500
+ save: 'Save post',
1501
+ follow: 'Follow account',
1502
+ comment: 'Leave a comment',
1503
+ share: 'Share with others',
1504
+ read_more: 'Read the full article',
1505
+ };
1506
+ /**
1507
+ * `--cta save,follow,custom:Join the webinar` -> the web app's cta_variants
1508
+ * list (at most 4 endings, at most one custom).
1509
+ */
1510
+ export function parseSlideshowCtaOption(raw) {
1511
+ const entries = raw.split(',').map((entry) => entry.trim()).filter(Boolean);
1512
+ if (entries.length === 0)
1513
+ throw new Error('--cta needs at least one of: save, follow, comment, share, read_more, custom:<text>');
1514
+ const intents = [];
1515
+ const seen = new Set();
1516
+ let customCount = 0;
1517
+ for (const entry of entries) {
1518
+ const customMatch = /^custom\s*:\s*(.+)$/i.exec(entry);
1519
+ if (customMatch) {
1520
+ customCount += 1;
1521
+ if (customCount > 1)
1522
+ throw new Error('--cta allows at most one custom ending (custom:<text>).');
1523
+ const text = customMatch[1].trim().slice(0, 120);
1524
+ intents.push({ id: 'custom-0', type: 'custom', label: text, custom_text: text });
1525
+ continue;
1526
+ }
1527
+ const type = entry.toLowerCase().replace(/[\s-]+/g, '_');
1528
+ const label = SLIDESHOW_CTA_LABELS[type];
1529
+ if (!label)
1530
+ throw new Error(`Unknown --cta "${entry}". Use save, follow, comment, share, read_more, or custom:<text>.`);
1531
+ if (seen.has(type))
1532
+ continue;
1533
+ seen.add(type);
1534
+ intents.push({ id: type, type, label, custom_text: null });
1535
+ }
1536
+ if (intents.length > 4)
1537
+ throw new Error('--cta allows at most 4 endings.');
1538
+ return intents;
1539
+ }
1540
+ function isSlideshowFormat(format) {
1541
+ return Boolean(format && SLIDESHOW_FORMAT_ALIASES.includes(format.trim().toLowerCase()));
1542
+ }
1497
1543
  async function runRepurposeCommand(action, input, client) {
1498
1544
  const projectId = requireProjectId(input);
1499
1545
  const base = `projects/${encodeURIComponent(projectId)}/repurpose`;
@@ -1507,12 +1553,14 @@ async function runRepurposeCommand(action, input, client) {
1507
1553
  }
1508
1554
  if (action === 'generate') {
1509
1555
  if (!format)
1510
- throw new Error(`Usage: coauthor repurpose generate <project-id> --format <${[...REPURPOSE_GENERATABLE, 'video'].join('|')}|all> [--writing-model <id>] [--cta save,follow]`);
1556
+ throw new Error(`Usage: coauthor repurpose generate <project-id> --format <${[...REPURPOSE_GENERATABLE, 'slideshow', 'video'].join('|')}|all> [--writing-model <id>] [--cta save,follow]`);
1557
+ if (isSlideshowFormat(format))
1558
+ return generateSlideshow(projectId, base, input, client);
1511
1559
  const formats = format === 'all' ? REPURPOSE_GENERATABLE : [format];
1512
1560
  const writingModel = getString(input.values, 'writing-model');
1513
1561
  const cta = getString(input.values, 'cta');
1514
1562
  if (cta !== undefined && format !== 'video')
1515
- throw new Error('--cta only applies to --format video.');
1563
+ throw new Error('--cta only applies to --format video or slideshow.');
1516
1564
  const results = {};
1517
1565
  for (const entry of formats) {
1518
1566
  results[entry] = await client.request({
@@ -1547,18 +1595,21 @@ async function runRepurposeCommand(action, input, client) {
1547
1595
  };
1548
1596
  }
1549
1597
  if (action === 'status') {
1598
+ if (isSlideshowFormat(format))
1599
+ return slideshowStatus(projectId, base, getBoolean(input.values, 'wait'), client);
1550
1600
  if (format !== 'video')
1551
- throw new Error('Usage: coauthor repurpose status <project-id> --format video [--wait]');
1601
+ throw new Error('Usage: coauthor repurpose status <project-id> --format <slideshow|video> [--wait]');
1552
1602
  return videoStatus(client, base, getBoolean(input.values, 'wait'));
1553
1603
  }
1554
1604
  if (action === 'render') {
1555
1605
  if (format !== 'video')
1556
- throw new Error('Usage: coauthor repurpose render <project-id> --format video [--variant <id>] [--wait]');
1606
+ throw new Error('Usage: coauthor repurpose render <project-id> --format video [--variant <id>] [--wait] (slideshow PNGs are rendered by repurpose download)');
1557
1607
  return videoRender(client, projectId, base, getString(input.values, 'variant'), getBoolean(input.values, 'wait'));
1558
1608
  }
1559
- if (action === 'download')
1560
- return downloadRepurposed(projectId, format ?? 'all', getString(input.values, 'out'), client, getString(input.values, 'variant'));
1561
- throw new Error('Usage: coauthor repurpose <list|show|generate|save|download|status|render> <project-id> --format <format>');
1609
+ if (action === 'download') {
1610
+ return downloadRepurposed(projectId, isSlideshowFormat(format) ? 'slideshow' : format ?? 'all', getString(input.values, 'out'), client, getString(input.values, 'variant'));
1611
+ }
1612
+ throw new Error('Usage: coauthor repurpose <list|show|generate|save|status|render|download> <project-id> --format <format>');
1562
1613
  }
1563
1614
  /** "save,follow,custom:Reply with a question" -> ["save","follow","custom:Reply with a question"]. */
1564
1615
  function parseCtaList(value) {
@@ -1610,6 +1661,26 @@ async function videoStatus(client, base, wait) {
1610
1661
  data,
1611
1662
  };
1612
1663
  }
1664
+ async function generateSlideshow(projectId, base, input, client) {
1665
+ const cta = getString(input.values, 'cta');
1666
+ const writingModel = getString(input.values, 'writing-model');
1667
+ const body = {};
1668
+ if (cta !== undefined)
1669
+ body.cta_variants = parseSlideshowCtaOption(cta);
1670
+ if (writingModel)
1671
+ body.writingModel = writingModel;
1672
+ const data = await client.request({ method: 'POST', path: `${base}/slideshow/generate`, body });
1673
+ const total = extractNestedNumber(data, ['panels', 'total']);
1674
+ return {
1675
+ ok: true,
1676
+ message: [
1677
+ `Generated the slideshow text${total !== undefined ? ` and queued ${total} panel image${total === 1 ? '' : 's'}` : ''}.`,
1678
+ `Wait for the images with: coauthor repurpose status ${projectId} --format slideshow --wait`,
1679
+ `Then save the PNGs with: coauthor repurpose download ${projectId} --format slideshow`,
1680
+ ].join('\n'),
1681
+ data,
1682
+ };
1683
+ }
1613
1684
  async function videoRender(client, projectId, base, variant, wait) {
1614
1685
  const deadline = Date.now() + waitTimeoutMs(9 * 60_000);
1615
1686
  if (wait) {
@@ -1676,6 +1747,86 @@ async function downloadVideoRenders(client, shown, outDir, variant) {
1676
1747
  }
1677
1748
  return { files, pending };
1678
1749
  }
1750
+ function slideshowCounts(data) {
1751
+ const read = (key) => {
1752
+ const value = getResponseValue(data, key);
1753
+ return typeof value === 'number' ? value : 0;
1754
+ };
1755
+ return { total: read('total'), ready: read('ready'), generating: read('generating'), failed: read('failed') };
1756
+ }
1757
+ // Polls panel image status until nothing is generating, capped under the
1758
+ // 10-minute agent shell limit (resumable still_running on timeout).
1759
+ async function slideshowStatus(projectId, base, wait, client) {
1760
+ const statusPath = `${base}/slideshow/status`;
1761
+ let data = await client.request({ path: statusPath });
1762
+ if (wait) {
1763
+ const deadline = Date.now() + waitTimeoutMs(9 * 60_000);
1764
+ const pollMs = Math.max(waitPollMs(), 0);
1765
+ while (slideshowCounts(data).generating > 0 && Date.now() < deadline) {
1766
+ await sleep(Math.min(pollMs, 15_000));
1767
+ data = await client.request({ path: statusPath });
1768
+ }
1769
+ }
1770
+ const counts = slideshowCounts(data);
1771
+ const stillRunning = wait && counts.generating > 0;
1772
+ const nextStep = counts.generating > 0
1773
+ ? ` Check again with: coauthor repurpose status ${projectId} --format slideshow --wait`
1774
+ : counts.failed > 0
1775
+ ? ' Retry the failed panels in the web app (Promote > Slideshow) or with coauthor image generate, then download.'
1776
+ : ` Save the PNGs with: coauthor repurpose download ${projectId} --format slideshow`;
1777
+ return {
1778
+ ok: counts.failed === 0 && !stillRunning,
1779
+ status: stillRunning ? 'still_running' : undefined,
1780
+ exitCode: stillRunning ? 2 : undefined,
1781
+ resume_command: stillRunning ? `coauthor repurpose status ${projectId} --format slideshow --wait` : undefined,
1782
+ message: `Slideshow images: ${counts.ready}/${counts.total} ready, ${counts.failed} failed, ${counts.generating} still generating.${nextStep}`,
1783
+ data,
1784
+ };
1785
+ }
1786
+ /** Path-safe folder for a CTA variant id (same rule the worker uses for its R2 keys). */
1787
+ function slideshowVariantFolder(variant) {
1788
+ return variant.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, '-').replace(/^-+|-+$/g, '') || 'variant';
1789
+ }
1790
+ /**
1791
+ * Renders the slideshow on the server and saves the PNGs as
1792
+ * <outDir>/slideshow/<variant>/slide-NN.png. Returns the relative paths written.
1793
+ */
1794
+ async function downloadSlideshowPngs(projectId, outDir, client, variant) {
1795
+ const rendered = await client.request({
1796
+ method: 'POST',
1797
+ path: `projects/${encodeURIComponent(projectId)}/repurpose/slideshow/render`,
1798
+ body: variant ? { variant } : {},
1799
+ });
1800
+ const variants = getResponseValue(rendered, 'variants');
1801
+ const files = [];
1802
+ const byVariant = {};
1803
+ for (const entry of Array.isArray(variants) ? variants : []) {
1804
+ const name = getResponseString(entry, 'variant');
1805
+ const slides = getResponseValue(entry, 'slides');
1806
+ if (!name || !Array.isArray(slides))
1807
+ continue;
1808
+ const folder = join('slideshow', slideshowVariantFolder(name));
1809
+ await mkdir(join(outDir, folder), { recursive: true });
1810
+ const written = [];
1811
+ for (const slide of slides) {
1812
+ const url = getResponseString(slide, 'url');
1813
+ const index = getResponseValue(slide, 'index');
1814
+ if (!url || typeof index !== 'number')
1815
+ continue;
1816
+ const relative = join(folder, `slide-${String(index).padStart(2, '0')}.png`);
1817
+ await writeFile(join(outDir, relative), await client.download(url));
1818
+ written.push(relative);
1819
+ }
1820
+ files.push(...written);
1821
+ byVariant[name] = written;
1822
+ }
1823
+ return {
1824
+ files,
1825
+ render_hash: getResponseString(rendered, 'render_hash') ?? null,
1826
+ stale: Boolean(getResponseValue(rendered, 'stale')),
1827
+ variants: byVariant,
1828
+ };
1829
+ }
1679
1830
  async function downloadRepurposed(projectId, format, outOption, client, variant) {
1680
1831
  const outDir = resolve(outOption ?? `coauthor-${projectId.slice(0, 8)}`);
1681
1832
  await mkdir(outDir, { recursive: true });
@@ -1698,6 +1849,7 @@ async function downloadRepurposed(projectId, format, outOption, client, variant)
1698
1849
  const manifest = {};
1699
1850
  const missingLink = [];
1700
1851
  let noVideoFile = false;
1852
+ const notReady = [];
1701
1853
  for (const entry of formats) {
1702
1854
  const shown = await client.request({ path: `projects/${encodeURIComponent(projectId)}/repurpose/${encodeURIComponent(entry)}` });
1703
1855
  const artifact = getResponseValue(shown, 'artifact');
@@ -1720,6 +1872,25 @@ async function downloadRepurposed(projectId, format, outOption, client, variant)
1720
1872
  noVideoFile = true;
1721
1873
  continue;
1722
1874
  }
1875
+ if (entry === 'slideshow' && artifact) {
1876
+ const panelsReady = extractNestedBoolean(shown, ['panels', 'all_ready']);
1877
+ // --format all skips a slideshow whose images are unfinished; an explicit
1878
+ // --format slideshow asks the server, which explains what is missing.
1879
+ if (format === 'all' && panelsReady !== true) {
1880
+ notReady.push(entry);
1881
+ continue;
1882
+ }
1883
+ const slideshow = await downloadSlideshowPngs(projectId, outDir, client, variant);
1884
+ written.push(...slideshow.files);
1885
+ await write('slideshow.json', JSON.stringify(artifact, null, 2));
1886
+ manifest[entry] = {
1887
+ stale: slideshow.stale || Boolean(getResponseValue(artifact, 'stale_at')),
1888
+ updated_at: getResponseValue(artifact, 'updated_at') ?? null,
1889
+ render_hash: slideshow.render_hash,
1890
+ variants: slideshow.variants,
1891
+ };
1892
+ continue;
1893
+ }
1723
1894
  if (!artifact || !copy) {
1724
1895
  skipped.push(entry);
1725
1896
  continue;
@@ -1734,20 +1905,21 @@ async function downloadRepurposed(projectId, format, outOption, client, variant)
1734
1905
  updated_at: getResponseValue(artifact, 'updated_at') ?? null,
1735
1906
  };
1736
1907
  }
1737
- await write('manifest.json', JSON.stringify({ project_id: projectId, downloaded_at: new Date().toISOString(), formats: manifest, skipped, missing_article_link: missingLink }, null, 2));
1908
+ await write('manifest.json', JSON.stringify({ project_id: projectId, downloaded_at: new Date().toISOString(), formats: manifest, skipped, not_ready: notReady, missing_article_link: missingLink }, null, 2));
1738
1909
  const staleNote = Object.entries(manifest).filter(([, value]) => value.stale).map(([key]) => key);
1739
1910
  return {
1740
1911
  ok: true,
1741
1912
  message: [
1742
1913
  `Wrote ${written.length} files to ${outDir}`,
1743
- skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>; slideshows are made in the web app).` : '',
1914
+ skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>).` : '',
1744
1915
  noVideoFile ? `The video has no finished render yet: coauthor repurpose render ${projectId} --format video --wait, then download again.` : '',
1916
+ notReady.length > 0 ? `Skipped the slideshow: its images are not all ready. Run coauthor repurpose status ${projectId} --format slideshow --wait, then download again.` : '',
1745
1917
  staleNote.length > 0 ? `Stale (the draft changed since they were made): ${staleNote.join(', ')}. Regenerate them before posting.` : '',
1746
1918
  missingLink.length > 0
1747
1919
  ? `No article link yet: ${missingLink.join(', ')} still contain {{POST_URL}}. Set it with coauthor repurpose save ${projectId} --format <format> --data '{"destination_url":"https://..."}' and download again, or replace it when posting.`
1748
1920
  : '',
1749
1921
  ].filter(Boolean).join('\n'),
1750
- data: { out_dir: outDir, files: written, skipped },
1922
+ data: { out_dir: outDir, files: written, skipped, not_ready: notReady },
1751
1923
  };
1752
1924
  }
1753
1925
  function renderRepurposeMarkdown(format, copy) {
@@ -1949,6 +2121,14 @@ function extractNestedString(value, path) {
1949
2121
  const current = extractNestedValue(value, path);
1950
2122
  return typeof current === 'string' ? current : undefined;
1951
2123
  }
2124
+ function extractNestedNumber(value, path) {
2125
+ const current = extractNestedValue(value, path);
2126
+ return typeof current === 'number' && Number.isFinite(current) ? current : undefined;
2127
+ }
2128
+ function extractNestedBoolean(value, path) {
2129
+ const current = extractNestedValue(value, path);
2130
+ return typeof current === 'boolean' ? current : undefined;
2131
+ }
1952
2132
  function extractNestedValue(value, path) {
1953
2133
  let current = value;
1954
2134
  for (const key of path) {
@@ -2020,7 +2200,7 @@ export function helpResult(command = []) {
2020
2200
  ' contract show|save|approve',
2021
2201
  ' outline show|generate|revise|save|approve',
2022
2202
  ' research-plan show|generate|revise|save|approve',
2023
- ' repurpose list|generate|show|save|download|status|render',
2203
+ ' repurpose list|generate|show|save|status|render|download',
2024
2204
  ' brief review|answer',
2025
2205
  ' profile list|show',
2026
2206
  ' source list|add|remove',
@@ -2131,18 +2311,22 @@ function commandHelp(command) {
2131
2311
  repurpose: [
2132
2312
  'Usage: coauthor repurpose list <project-id> [--json]',
2133
2313
  ' coauthor repurpose generate <project-id> --format <x-thread|x-post|linkedin|facebook|email|all> [--writing-model <id>] [--json]',
2314
+ ' coauthor repurpose generate <project-id> --format slideshow [--cta save,follow,comment,share,read_more,custom:<text>] [--writing-model <id>] [--json]',
2134
2315
  ' coauthor repurpose show <project-id> --format <format> [--json]',
2316
+ ' coauthor repurpose status <project-id> --format slideshow [--wait] [--json]',
2135
2317
  ' coauthor repurpose save <project-id> --format <format> --data @edits.json [--json]',
2136
2318
  ' coauthor repurpose download <project-id> [--format <format|article|all>] [--out <dir>] [--variant <id>]',
2137
- ' coauthor repurpose generate <project-id> --format video [--cta save,follow] [--writing-model <id>] [--json]',
2138
- ' coauthor repurpose status <project-id> --format video [--wait] [--json]',
2319
+ ' coauthor repurpose generate <project-id> --format <slideshow|video> [--cta save,follow] [--writing-model <id>] [--json]',
2320
+ ' coauthor repurpose status <project-id> --format <slideshow|video> [--wait] [--json]',
2139
2321
  ' coauthor repurpose render <project-id> --format video [--variant <id>] [--wait] [--json]',
2140
2322
  '',
2141
- 'Turns the finished draft into social posts and an email newsletter. generate takes about 20-90 seconds per format and replaces the previous version.',
2323
+ 'Turns the finished draft into social posts, an email newsletter, and a carousel slideshow. generate takes about 20-90 seconds per format and replaces the previous version.',
2142
2324
  'show returns data.copy (copy-ready text with the destination link filled in). download writes article.md, <format>.md, <format>.json, and manifest.json.',
2143
2325
  'Video: generate writes a short vertical deck and starts its slide images (1-3 minutes); --cta picks the ending call to action (comma-separated: save, follow, comment, share, read_more, custom:<text>; default save).',
2144
2326
  'status shows panels done/failed/generating and each render; render makes the MP4 (about 3 minutes, one render at a time per account; --wait polls up to 9 minutes, exit code 2 if still running); download saves finished MP4s as <out>/video-<variant>.mp4.',
2145
- 'Slideshows are generated in the web app; download includes them only as JSON once they exist. Publish an X thread with coauthor publish thread.',
2327
+ 'Slideshow: generate writes the slides and queues one image per panel (--cta picks up to 4 ending slides, default save; all is text formats only). status --wait waits up to 9 minutes for the images.',
2328
+ 'download --format slideshow renders 1080x1350 PNGs on the server into <out>/slideshow/<cta>/slide-NN.png (--variant picks one CTA); --format all includes them once every image is ready.',
2329
+ 'Publish an X thread with coauthor publish thread.',
2146
2330
  ].join('\n'),
2147
2331
  brief: [
2148
2332
  'Usage: coauthor brief review <project-id> [--json]',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickminded/coauthor-cli",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "coauthor": "dist/index.js",
@@ -66,4 +66,4 @@ Everything else, including auth problems: `references/troubleshooting.md`. Credi
66
66
 
67
67
  ## Not in the CLI yet
68
68
 
69
- Creating or editing writer profiles, PDFs over about 3.3 MB, adding more images than CoAuthor planned, and slideshows. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
69
+ Creating or editing writer profiles, PDFs over about 3.3 MB, and adding more images than CoAuthor planned. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
@@ -25,4 +25,4 @@ Images cost credits each time they are generated or edited, so check the brief a
25
25
 
26
26
  ## Other formats
27
27
 
28
- X posts, LinkedIn, Facebook, and email newsletter versions: see `references/repurposing.md`. Carousel slideshows and short videos are generated in the CoAuthor web app (open the project, then Promote).
28
+ X posts, LinkedIn, Facebook, and email newsletter versions: see `references/repurposing.md`. Carousel slideshows and short vertical videos: same file, under Slideshow and Video.
@@ -1,4 +1,4 @@
1
- # Repurposing: social posts and an email newsletter
1
+ # Repurposing: social posts, an email newsletter, slideshows, and video
2
2
 
3
3
  Once the draft is final, CoAuthor turns it into distribution copy in the project's voice.
4
4
 
@@ -10,7 +10,7 @@ Once the draft is final, CoAuthor turns it into distribution copy in the project
10
10
  | Facebook post | `facebook` | Variations with alternate hooks |
11
11
  | Email newsletter | `email` | Variations with subject line, preheader, and body |
12
12
 
13
- Slideshows (carousels) are generated in the CoAuthor web app (open the project, then Promote); `repurpose download` includes them as JSON once they exist. Short vertical videos can be made from the CLI (see below).
13
+ Carousel slideshows and short vertical videos have their own steps, because their illustrated panels are generated as images first (see Slideshow and Video below).
14
14
 
15
15
  ## Generate
16
16
 
@@ -44,6 +44,16 @@ coauthor repurpose save <id> --format x-thread --data '{"posts":[...]}' --json
44
44
 
45
45
  Add `"destination_url": "https://..."` to point the posts at the published article. Keep the `{{POST_URL}}` placeholder in stored text; it is replaced with the destination URL on copy.
46
46
 
47
+ ## Slideshow
48
+
49
+ A carousel of 1080x1350 slides (for LinkedIn or Instagram) with illustrated panels and a closing call-to-action slide.
50
+
51
+ 1. `coauthor repurpose generate <id> --format slideshow [--cta save,follow] --json` writes the slides and queues one image per panel. Up to 4 endings: `save`, `follow`, `comment`, `share`, `read_more`, plus one `custom:<text>`; the default is `save`. Panel images cost image credits, which is why slideshows are not part of `--format all`.
52
+ 2. `coauthor repurpose status <id> --format slideshow --wait --json` waits until no panel is still generating. If some failed, retry them with `coauthor image generate` or in the web app.
53
+ 3. `coauthor repurpose download <id> --format slideshow [--variant <cta>] --out <dir>` renders the PNGs on the server and saves them as `slideshow/<cta>/slide-NN.png`, one folder per ending. `panels_not_ready` (409) means images are still generating or failed. Rendering again with no changes returns the same files.
54
+
55
+ The server draws the slides with the Inter font, so line breaks can differ slightly from the web app's own PNG download.
56
+
47
57
  ## Video
48
58
 
49
59
  A short vertical video (1080x1920) of the article's key points, with illustrated panels and a closing call to action.
@@ -68,7 +68,7 @@ Everything else, including auth problems: `references/troubleshooting.md`. Credi
68
68
 
69
69
  ## Not in the CLI yet
70
70
 
71
- Creating or editing writer profiles, PDFs over about 3.3 MB, adding more images than CoAuthor planned, and slideshows. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
71
+ Creating or editing writer profiles, PDFs over about 3.3 MB, and adding more images than CoAuthor planned. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
72
72
 
73
73
  # Reference sections
74
74
 
@@ -354,7 +354,7 @@ Images cost credits each time they are generated or edited, so check the brief a
354
354
 
355
355
  ### Other formats
356
356
 
357
- X posts, LinkedIn, Facebook, and email newsletter versions: see `references/repurposing.md`. Carousel slideshows and short videos are generated in the CoAuthor web app (open the project, then Promote).
357
+ X posts, LinkedIn, Facebook, and email newsletter versions: see `references/repurposing.md`. Carousel slideshows and short vertical videos: same file, under Slideshow and Video.
358
358
 
359
359
  ## references/publishing-and-export.md
360
360
 
@@ -398,7 +398,7 @@ After a network error or an unclear result on an export or publish, do not run i
398
398
 
399
399
  ## references/repurposing.md
400
400
 
401
- ## Repurposing: social posts and an email newsletter
401
+ ## Repurposing: social posts, an email newsletter, slideshows, and video
402
402
 
403
403
  Once the draft is final, CoAuthor turns it into distribution copy in the project's voice.
404
404
 
@@ -410,7 +410,7 @@ Once the draft is final, CoAuthor turns it into distribution copy in the project
410
410
  | Facebook post | `facebook` | Variations with alternate hooks |
411
411
  | Email newsletter | `email` | Variations with subject line, preheader, and body |
412
412
 
413
- Slideshows (carousels) are generated in the CoAuthor web app (open the project, then Promote); `repurpose download` includes them as JSON once they exist. Short vertical videos can be made from the CLI (see below).
413
+ Carousel slideshows and short vertical videos have their own steps, because their illustrated panels are generated as images first (see Slideshow and Video below).
414
414
 
415
415
  ### Generate
416
416
 
@@ -444,6 +444,16 @@ coauthor repurpose save <id> --format x-thread --data '{"posts":[...]}' --json
444
444
 
445
445
  Add `"destination_url": "https://..."` to point the posts at the published article. Keep the `{{POST_URL}}` placeholder in stored text; it is replaced with the destination URL on copy.
446
446
 
447
+ ### Slideshow
448
+
449
+ A carousel of 1080x1350 slides (for LinkedIn or Instagram) with illustrated panels and a closing call-to-action slide.
450
+
451
+ 1. `coauthor repurpose generate <id> --format slideshow [--cta save,follow] --json` writes the slides and queues one image per panel. Up to 4 endings: `save`, `follow`, `comment`, `share`, `read_more`, plus one `custom:<text>`; the default is `save`. Panel images cost image credits, which is why slideshows are not part of `--format all`.
452
+ 2. `coauthor repurpose status <id> --format slideshow --wait --json` waits until no panel is still generating. If some failed, retry them with `coauthor image generate` or in the web app.
453
+ 3. `coauthor repurpose download <id> --format slideshow [--variant <cta>] --out <dir>` renders the PNGs on the server and saves them as `slideshow/<cta>/slide-NN.png`, one folder per ending. `panels_not_ready` (409) means images are still generating or failed. Rendering again with no changes returns the same files.
454
+
455
+ The server draws the slides with the Inter font, so line breaks can differ slightly from the web app's own PNG download.
456
+
447
457
  ### Video
448
458
 
449
459
  A short vertical video (1080x1920) of the article's key points, with illustrated panels and a closing call to action.