@clickminded/coauthor-cli 0.0.28 → 0.0.30
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 +5 -0
- package/dist/client.js +10 -0
- package/dist/commands.js +193 -12
- package/dist/parser.js +4 -2
- package/package.json +1 -1
- package/skills/coauthor/SKILL.md +2 -2
- package/skills/coauthor/references/repurposing.md +10 -1
- package/skills/cursor/coauthor-cli.mdc +12 -3
package/dist/client.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export declare class AgentClient {
|
|
|
23
23
|
private readonly fetchImpl;
|
|
24
24
|
constructor(options: AgentClientOptions);
|
|
25
25
|
request(options: RequestOptions): Promise<JsonValue>;
|
|
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.
|
|
29
|
+
*/
|
|
30
|
+
download(url: string): Promise<Uint8Array>;
|
|
26
31
|
}
|
|
27
32
|
export declare function isLiveAction(method: string): boolean;
|
|
28
33
|
export declare function normalizeBaseUrl(baseUrl: string): string;
|
package/dist/client.js
CHANGED
|
@@ -57,6 +57,16 @@ export class AgentClient {
|
|
|
57
57
|
}
|
|
58
58
|
return parsedBody;
|
|
59
59
|
}
|
|
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.
|
|
63
|
+
*/
|
|
64
|
+
async download(url) {
|
|
65
|
+
const response = await this.fetchImpl(url, { method: 'GET' });
|
|
66
|
+
if (!response.ok)
|
|
67
|
+
throw new Error(`Download failed with HTTP ${response.status} for ${url}`);
|
|
68
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
71
|
export function isLiveAction(method) {
|
|
62
72
|
return !['GET', 'HEAD', 'OPTIONS'].includes(method.toUpperCase());
|
package/dist/commands.js
CHANGED
|
@@ -244,6 +244,17 @@ async function runProjectCommand(action, input, client) {
|
|
|
244
244
|
const data = await client.request({ method: 'POST', path: `projects/${encodeURIComponent(projectId)}/rename`, body: { title } });
|
|
245
245
|
return { ok: true, message: `Renamed to "${title.trim()}".`, data };
|
|
246
246
|
}
|
|
247
|
+
if (action === 'duplicate') {
|
|
248
|
+
const projectId = requireProjectId(input);
|
|
249
|
+
const title = getString(input.values, 'title');
|
|
250
|
+
const data = await client.request({
|
|
251
|
+
method: 'POST',
|
|
252
|
+
path: `projects/${encodeURIComponent(projectId)}/duplicate`,
|
|
253
|
+
body: title !== undefined && title.trim() ? { title } : {},
|
|
254
|
+
});
|
|
255
|
+
const newId = data.project?.id;
|
|
256
|
+
return { ok: true, message: newId ? `Duplicated project ${projectId} as ${newId}${data.project?.title ? ` ("${data.project.title}")` : ''}.` : `Duplicated project ${projectId}.`, data };
|
|
257
|
+
}
|
|
247
258
|
if (action === 'delete') {
|
|
248
259
|
const projectId = requireProjectId(input);
|
|
249
260
|
if (!getBoolean(input.values, 'yes')) {
|
|
@@ -252,7 +263,7 @@ async function runProjectCommand(action, input, client) {
|
|
|
252
263
|
const data = await client.request({ method: 'DELETE', path: `projects/${encodeURIComponent(projectId)}` });
|
|
253
264
|
return { ok: true, message: `Deleted project ${projectId}.`, data };
|
|
254
265
|
}
|
|
255
|
-
throw new Error('Usage: coauthor project <create|list|show|rename|delete>');
|
|
266
|
+
throw new Error('Usage: coauthor project <create|list|show|rename|delete|duplicate>');
|
|
256
267
|
}
|
|
257
268
|
async function runWorkspaceCommand(action, input, client) {
|
|
258
269
|
if (action !== 'show')
|
|
@@ -1490,17 +1501,30 @@ async function runRepurposeCommand(action, input, client) {
|
|
|
1490
1501
|
}
|
|
1491
1502
|
if (action === 'generate') {
|
|
1492
1503
|
if (!format)
|
|
1493
|
-
throw new Error(`Usage: coauthor repurpose generate <project-id> --format <${REPURPOSE_GENERATABLE.join('|')}|all> [--writing-model <id>]`);
|
|
1504
|
+
throw new Error(`Usage: coauthor repurpose generate <project-id> --format <${[...REPURPOSE_GENERATABLE, 'video'].join('|')}|all> [--writing-model <id>] [--cta save,follow]`);
|
|
1494
1505
|
const formats = format === 'all' ? REPURPOSE_GENERATABLE : [format];
|
|
1495
1506
|
const writingModel = getString(input.values, 'writing-model');
|
|
1507
|
+
const cta = getString(input.values, 'cta');
|
|
1508
|
+
if (cta !== undefined && format !== 'video')
|
|
1509
|
+
throw new Error('--cta only applies to --format video.');
|
|
1496
1510
|
const results = {};
|
|
1497
1511
|
for (const entry of formats) {
|
|
1498
1512
|
results[entry] = await client.request({
|
|
1499
1513
|
method: 'POST',
|
|
1500
1514
|
path: `${base}/${encodeURIComponent(entry)}/generate`,
|
|
1501
|
-
body:
|
|
1515
|
+
body: {
|
|
1516
|
+
...(writingModel ? { writingModel } : {}),
|
|
1517
|
+
...(entry === 'video' && cta !== undefined ? { cta_variants: parseCtaList(cta) } : {}),
|
|
1518
|
+
},
|
|
1502
1519
|
});
|
|
1503
1520
|
}
|
|
1521
|
+
if (format === 'video') {
|
|
1522
|
+
return {
|
|
1523
|
+
ok: true,
|
|
1524
|
+
message: `Generated the video deck. Slide images are generating (usually 1-3 minutes). Next: coauthor repurpose render ${projectId} --format video --wait, then coauthor repurpose download ${projectId} --format video`,
|
|
1525
|
+
data: results.video,
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1504
1528
|
return {
|
|
1505
1529
|
ok: true,
|
|
1506
1530
|
message: `Generated ${formats.join(', ')}. Review with: coauthor repurpose show ${projectId} --format <format> --json, or save files with: coauthor repurpose download ${projectId} --format ${format}`,
|
|
@@ -1516,11 +1540,137 @@ async function runRepurposeCommand(action, input, client) {
|
|
|
1516
1540
|
data: await client.request({ method: 'POST', path: `${base}/${encodeURIComponent(format)}/save`, body: parseJsonOption(input.values) }),
|
|
1517
1541
|
};
|
|
1518
1542
|
}
|
|
1543
|
+
if (action === 'status') {
|
|
1544
|
+
if (format !== 'video')
|
|
1545
|
+
throw new Error('Usage: coauthor repurpose status <project-id> --format video [--wait]');
|
|
1546
|
+
return videoStatus(client, base, getBoolean(input.values, 'wait'));
|
|
1547
|
+
}
|
|
1548
|
+
if (action === 'render') {
|
|
1549
|
+
if (format !== 'video')
|
|
1550
|
+
throw new Error('Usage: coauthor repurpose render <project-id> --format video [--variant <id>] [--wait]');
|
|
1551
|
+
return videoRender(client, projectId, base, getString(input.values, 'variant'), getBoolean(input.values, 'wait'));
|
|
1552
|
+
}
|
|
1519
1553
|
if (action === 'download')
|
|
1520
|
-
return downloadRepurposed(projectId, format ?? 'all', getString(input.values, 'out'), client);
|
|
1521
|
-
throw new Error('Usage: coauthor repurpose <list|show|generate|save|download> <project-id> --format <format>');
|
|
1554
|
+
return downloadRepurposed(projectId, format ?? 'all', getString(input.values, 'out'), client, getString(input.values, 'variant'));
|
|
1555
|
+
throw new Error('Usage: coauthor repurpose <list|show|generate|save|download|status|render> <project-id> --format <format>');
|
|
1556
|
+
}
|
|
1557
|
+
/** "save,follow,custom:Reply with a question" -> ["save","follow","custom:Reply with a question"]. */
|
|
1558
|
+
function parseCtaList(value) {
|
|
1559
|
+
const items = value.split(',').map((item) => item.trim()).filter(Boolean);
|
|
1560
|
+
if (items.length === 0)
|
|
1561
|
+
throw new Error('--cta needs at least one intent, for example --cta save,follow (save, follow, comment, share, read_more, custom:<text>).');
|
|
1562
|
+
return items;
|
|
1563
|
+
}
|
|
1564
|
+
const VIDEO_ACTIVE_RENDER_STATUSES = ['pending', 'rendering', 'encoding', 'uploading'];
|
|
1565
|
+
function asVideoStatus(data) {
|
|
1566
|
+
return data;
|
|
1567
|
+
}
|
|
1568
|
+
function describeVideoStatus(status) {
|
|
1569
|
+
if (!status.exists)
|
|
1570
|
+
return 'No video yet. Generate one with: coauthor repurpose generate <project-id> --format video';
|
|
1571
|
+
const panels = status.panels;
|
|
1572
|
+
const lines = [panels ? `Panels: ${panels.done}/${panels.total} done, ${panels.generating} generating, ${panels.failed} failed.` : 'Panels: none.'];
|
|
1573
|
+
for (const render of status.renders) {
|
|
1574
|
+
lines.push(`Render ${render.variant_id}: ${render.status}${VIDEO_ACTIVE_RENDER_STATUSES.includes(render.status) ? ` (${render.progress}%)` : ''}${render.video_url ? ` ${render.video_url}` : ''}${render.error_message ? ` - ${render.error_message}` : ''}`);
|
|
1575
|
+
}
|
|
1576
|
+
return lines.join('\n');
|
|
1522
1577
|
}
|
|
1523
|
-
|
|
1578
|
+
// Polls until `settled(status)` or the deadline (9 minutes by default: the
|
|
1579
|
+
// shell limit for agents). Returns the last status and whether it settled.
|
|
1580
|
+
async function pollVideoStatus(client, base, settled, deadline) {
|
|
1581
|
+
const pollMs = Math.min(waitPollMs(), 15_000);
|
|
1582
|
+
for (;;) {
|
|
1583
|
+
const data = await client.request({ path: `${base}/video/status` });
|
|
1584
|
+
const status = asVideoStatus(data);
|
|
1585
|
+
if (settled(status))
|
|
1586
|
+
return { status, data, settled: true };
|
|
1587
|
+
if (Date.now() >= deadline)
|
|
1588
|
+
return { status, data, settled: false };
|
|
1589
|
+
await sleep(pollMs);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
const panelsSettled = (status) => !status.exists || !status.panels || status.panels.generating === 0;
|
|
1593
|
+
const noActiveRender = (status) => !status.renders.some((render) => VIDEO_ACTIVE_RENDER_STATUSES.includes(render.status));
|
|
1594
|
+
async function videoStatus(client, base, wait) {
|
|
1595
|
+
const deadline = Date.now() + waitTimeoutMs(9 * 60_000);
|
|
1596
|
+
const polled = await pollVideoStatus(client, base, (status) => !wait || (panelsSettled(status) && noActiveRender(status)), deadline);
|
|
1597
|
+
const data = polled.data;
|
|
1598
|
+
const stillRunning = wait && !polled.settled;
|
|
1599
|
+
return {
|
|
1600
|
+
ok: true,
|
|
1601
|
+
status: stillRunning ? 'still_running' : undefined,
|
|
1602
|
+
exitCode: stillRunning ? 2 : undefined,
|
|
1603
|
+
message: `${describeVideoStatus(polled.status)}${stillRunning ? '\nStill running. Check again with: coauthor repurpose status <project-id> --format video --wait' : ''}`,
|
|
1604
|
+
data,
|
|
1605
|
+
};
|
|
1606
|
+
}
|
|
1607
|
+
async function videoRender(client, projectId, base, variant, wait) {
|
|
1608
|
+
const deadline = Date.now() + waitTimeoutMs(9 * 60_000);
|
|
1609
|
+
if (wait) {
|
|
1610
|
+
// Slide images usually finish before the render is asked for; wait for stragglers.
|
|
1611
|
+
const panels = await pollVideoStatus(client, base, panelsSettled, deadline);
|
|
1612
|
+
if (!panels.settled) {
|
|
1613
|
+
return { ok: true, status: 'still_running', exitCode: 2, message: `Slide images are still generating.\n${describeVideoStatus(panels.status)}\nCheck again with: coauthor repurpose render ${projectId} --format video --wait`, data: panels.data };
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
const started = await client.request({
|
|
1617
|
+
method: 'POST',
|
|
1618
|
+
path: `${base}/video/render`,
|
|
1619
|
+
body: variant ? { variant } : {},
|
|
1620
|
+
});
|
|
1621
|
+
const render = getResponseValue(started, 'render');
|
|
1622
|
+
const renderId = render ? getResponseString(render, 'id') : undefined;
|
|
1623
|
+
if (!wait) {
|
|
1624
|
+
return {
|
|
1625
|
+
ok: true,
|
|
1626
|
+
message: `Render started (usually about 3 minutes). Check with: coauthor repurpose status ${projectId} --format video --wait, then download with: coauthor repurpose download ${projectId} --format video`,
|
|
1627
|
+
data: started,
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
const finished = await pollVideoStatus(client, base, (status) => {
|
|
1631
|
+
const row = status.renders.find((entry) => entry.id === renderId);
|
|
1632
|
+
return !row || row.status === 'done' || row.status === 'failed';
|
|
1633
|
+
}, deadline);
|
|
1634
|
+
const row = finished.status.renders.find((entry) => entry.id === renderId);
|
|
1635
|
+
if (!finished.settled) {
|
|
1636
|
+
return {
|
|
1637
|
+
ok: true,
|
|
1638
|
+
status: 'still_running',
|
|
1639
|
+
exitCode: 2,
|
|
1640
|
+
message: `Render still running (${row?.status ?? 'pending'}, ${row?.progress ?? 0}%). Check again with: coauthor repurpose status ${projectId} --format video --wait`,
|
|
1641
|
+
data: finished.data,
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
if (row && row.status === 'failed') {
|
|
1645
|
+
return { ok: false, message: `Render failed: ${row.error_message ?? 'unknown error'}. Try again with: coauthor repurpose render ${projectId} --format video`, data: finished.data };
|
|
1646
|
+
}
|
|
1647
|
+
return {
|
|
1648
|
+
ok: true,
|
|
1649
|
+
message: `Render done${row?.video_url ? `: ${row.video_url}` : ''}. Download it with: coauthor repurpose download ${projectId} --format video`,
|
|
1650
|
+
data: finished.data,
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
// Downloads each finished render's MP4 from its public URL (no agent auth) to
|
|
1654
|
+
// <out>/video-<variant>.mp4.
|
|
1655
|
+
async function downloadVideoRenders(client, shown, outDir, variant) {
|
|
1656
|
+
const renders = getResponseValue(shown, 'renders') ?? [];
|
|
1657
|
+
const files = [];
|
|
1658
|
+
const pending = [];
|
|
1659
|
+
for (const render of renders) {
|
|
1660
|
+
const variantId = render.variant_id ?? '';
|
|
1661
|
+
if (variant && variantId !== variant)
|
|
1662
|
+
continue;
|
|
1663
|
+
if (render.status !== 'done' || !render.video_url) {
|
|
1664
|
+
pending.push(variantId);
|
|
1665
|
+
continue;
|
|
1666
|
+
}
|
|
1667
|
+
const name = `video-${variantId.replace(/[^A-Za-z0-9_-]+/g, '_') || render.id || 'render'}.mp4`;
|
|
1668
|
+
await writeFile(join(outDir, name), await client.download(render.video_url));
|
|
1669
|
+
files.push(name);
|
|
1670
|
+
}
|
|
1671
|
+
return { files, pending };
|
|
1672
|
+
}
|
|
1673
|
+
async function downloadRepurposed(projectId, format, outOption, client, variant) {
|
|
1524
1674
|
const outDir = resolve(outOption ?? `coauthor-${projectId.slice(0, 8)}`);
|
|
1525
1675
|
await mkdir(outDir, { recursive: true });
|
|
1526
1676
|
const written = [];
|
|
@@ -1541,10 +1691,29 @@ async function downloadRepurposed(projectId, format, outOption, client) {
|
|
|
1541
1691
|
const formats = format === 'all' ? REPURPOSE_FORMATS : format === 'article' ? [] : [format];
|
|
1542
1692
|
const manifest = {};
|
|
1543
1693
|
const missingLink = [];
|
|
1694
|
+
let noVideoFile = false;
|
|
1544
1695
|
for (const entry of formats) {
|
|
1545
1696
|
const shown = await client.request({ path: `projects/${encodeURIComponent(projectId)}/repurpose/${encodeURIComponent(entry)}` });
|
|
1546
1697
|
const artifact = getResponseValue(shown, 'artifact');
|
|
1547
1698
|
const copy = getResponseValue(shown, 'copy');
|
|
1699
|
+
if (entry === 'video') {
|
|
1700
|
+
if (!artifact) {
|
|
1701
|
+
skipped.push(entry);
|
|
1702
|
+
continue;
|
|
1703
|
+
}
|
|
1704
|
+
const videos = await downloadVideoRenders(client, shown, outDir, variant);
|
|
1705
|
+
written.push(...videos.files);
|
|
1706
|
+
await write('video.json', JSON.stringify(artifact, null, 2));
|
|
1707
|
+
manifest.video = {
|
|
1708
|
+
stale: Boolean(getResponseValue(artifact, 'stale_at')),
|
|
1709
|
+
updated_at: getResponseValue(artifact, 'updated_at') ?? null,
|
|
1710
|
+
files: videos.files,
|
|
1711
|
+
unfinished_variants: videos.pending,
|
|
1712
|
+
};
|
|
1713
|
+
if (videos.files.length === 0)
|
|
1714
|
+
noVideoFile = true;
|
|
1715
|
+
continue;
|
|
1716
|
+
}
|
|
1548
1717
|
if (!artifact || !copy) {
|
|
1549
1718
|
skipped.push(entry);
|
|
1550
1719
|
continue;
|
|
@@ -1565,7 +1734,8 @@ async function downloadRepurposed(projectId, format, outOption, client) {
|
|
|
1565
1734
|
ok: true,
|
|
1566
1735
|
message: [
|
|
1567
1736
|
`Wrote ${written.length} files to ${outDir}`,
|
|
1568
|
-
skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>;
|
|
1737
|
+
skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>; slideshows are made in the web app).` : '',
|
|
1738
|
+
noVideoFile ? `The video has no finished render yet: coauthor repurpose render ${projectId} --format video --wait, then download again.` : '',
|
|
1569
1739
|
staleNote.length > 0 ? `Stale (the draft changed since they were made): ${staleNote.join(', ')}. Regenerate them before posting.` : '',
|
|
1570
1740
|
missingLink.length > 0
|
|
1571
1741
|
? `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.`
|
|
@@ -1838,13 +2008,13 @@ export function helpResult(command = []) {
|
|
|
1838
2008
|
'',
|
|
1839
2009
|
'Commands:',
|
|
1840
2010
|
' auth login|status|logout (logout supports --local-only)',
|
|
1841
|
-
' project create|list|show|rename|delete',
|
|
2011
|
+
' project create|list|show|rename|delete|duplicate',
|
|
1842
2012
|
' workspace show',
|
|
1843
2013
|
' chat [show|list]',
|
|
1844
2014
|
' contract show|save|approve',
|
|
1845
2015
|
' outline show|generate|revise|save|approve',
|
|
1846
2016
|
' research-plan show|generate|revise|save|approve',
|
|
1847
|
-
' repurpose list|generate|show|save|download',
|
|
2017
|
+
' repurpose list|generate|show|save|download|status|render',
|
|
1848
2018
|
' brief review|answer',
|
|
1849
2019
|
' profile list|show',
|
|
1850
2020
|
' source list|add|remove',
|
|
@@ -1879,6 +2049,11 @@ function commandHelp(command) {
|
|
|
1879
2049
|
'Revokes the remote token before removing local credentials. If revocation cannot be confirmed, the token is kept locally so the command can be retried.',
|
|
1880
2050
|
'--local-only removes the local credential without revoking the remote token. Use it only when explicitly abandoning remote revocation.',
|
|
1881
2051
|
].join('\n'),
|
|
2052
|
+
'project duplicate': [
|
|
2053
|
+
'Usage: coauthor project duplicate <project-id> [--title "..."] [--json]',
|
|
2054
|
+
'',
|
|
2055
|
+
'Copies the brief, outline, research, chats, draft, images and repurposed posts into a new project that keeps the same profile. The default title is "<title> (Copy)". Prints the new project id.',
|
|
2056
|
+
].join('\n'),
|
|
1882
2057
|
'project create': [
|
|
1883
2058
|
'Usage: coauthor project create [--title <title>] [--topic <brief>] [--audience <audience>] [--contract <json>] [--profile <profile-id>] [--json]',
|
|
1884
2059
|
'',
|
|
@@ -1923,9 +2098,10 @@ function commandHelp(command) {
|
|
|
1923
2098
|
DRAFT_SAVE_SHAPE,
|
|
1924
2099
|
].join('\n'),
|
|
1925
2100
|
project: [
|
|
1926
|
-
'Usage: coauthor project <create|list|show|rename|delete> [<project-id>] [--title "..."] [--yes] [--json]',
|
|
2101
|
+
'Usage: coauthor project <create|list|show|rename|delete|duplicate> [<project-id>] [--title "..."] [--yes] [--json]',
|
|
1927
2102
|
'',
|
|
1928
2103
|
'create: --title, --topic, --audience, --contract <json|@file>. list: --limit. show: one project.',
|
|
2104
|
+
'duplicate <project-id> [--title "..."]: copies the brief, outline, research, chats, draft, images and repurposed posts into a new project that keeps the same profile (default title is "<title> (Copy)"). Prints the new project id.',
|
|
1929
2105
|
].join('\n'),
|
|
1930
2106
|
profile: [
|
|
1931
2107
|
'Usage: coauthor profile list [--json]',
|
|
@@ -1951,11 +2127,16 @@ function commandHelp(command) {
|
|
|
1951
2127
|
' coauthor repurpose generate <project-id> --format <x-thread|x-post|linkedin|facebook|email|all> [--writing-model <id>] [--json]',
|
|
1952
2128
|
' coauthor repurpose show <project-id> --format <format> [--json]',
|
|
1953
2129
|
' coauthor repurpose save <project-id> --format <format> --data @edits.json [--json]',
|
|
1954
|
-
' coauthor repurpose download <project-id> [--format <format|article|all>] [--out <dir>]',
|
|
2130
|
+
' coauthor repurpose download <project-id> [--format <format|article|all>] [--out <dir>] [--variant <id>]',
|
|
2131
|
+
' coauthor repurpose generate <project-id> --format video [--cta save,follow] [--writing-model <id>] [--json]',
|
|
2132
|
+
' coauthor repurpose status <project-id> --format video [--wait] [--json]',
|
|
2133
|
+
' coauthor repurpose render <project-id> --format video [--variant <id>] [--wait] [--json]',
|
|
1955
2134
|
'',
|
|
1956
2135
|
'Turns the finished draft into social posts and an email newsletter. generate takes about 20-90 seconds per format and replaces the previous version.',
|
|
1957
2136
|
'show returns data.copy (copy-ready text with the destination link filled in). download writes article.md, <format>.md, <format>.json, and manifest.json.',
|
|
1958
|
-
'
|
|
2137
|
+
'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).',
|
|
2138
|
+
'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.',
|
|
2139
|
+
'Slideshows are generated in the web app; download includes them only as JSON once they exist. Publish an X thread with coauthor publish thread.',
|
|
1959
2140
|
].join('\n'),
|
|
1960
2141
|
brief: [
|
|
1961
2142
|
'Usage: coauthor brief review <project-id> [--json]',
|
package/dist/parser.js
CHANGED
|
@@ -69,6 +69,8 @@ const OPTIONS = {
|
|
|
69
69
|
feedback: { type: 'string' },
|
|
70
70
|
profile: { type: 'string' },
|
|
71
71
|
out: { type: 'string' },
|
|
72
|
+
cta: { type: 'string' },
|
|
73
|
+
variant: { type: 'string' },
|
|
72
74
|
all: { type: 'boolean', default: false },
|
|
73
75
|
kind: { type: 'string' },
|
|
74
76
|
apply: { type: 'boolean', default: false },
|
|
@@ -142,7 +144,7 @@ function commandLength(positionals) {
|
|
|
142
144
|
if (first === 'auth')
|
|
143
145
|
return second && ['login', 'status', 'logout'].includes(second) ? 2 : 1;
|
|
144
146
|
if (first === 'project')
|
|
145
|
-
return second && ['create', 'list', 'show', 'rename', 'delete'].includes(second) ? 2 : 1;
|
|
147
|
+
return second && ['create', 'list', 'show', 'rename', 'delete', 'duplicate'].includes(second) ? 2 : 1;
|
|
146
148
|
if (first === 'workspace')
|
|
147
149
|
return second === 'show' ? 2 : 1;
|
|
148
150
|
if (first === 'chat')
|
|
@@ -166,7 +168,7 @@ function commandLength(positionals) {
|
|
|
166
168
|
if (first === 'workflow')
|
|
167
169
|
return second ? 2 : 1;
|
|
168
170
|
if (first === 'repurpose')
|
|
169
|
-
return second && ['list', 'show', 'generate', 'save', 'download'].includes(second) ? 2 : 1;
|
|
171
|
+
return second && ['list', 'show', 'generate', 'save', 'download', 'status', 'render'].includes(second) ? 2 : 1;
|
|
170
172
|
if (first === 'draft' && second === 'revision')
|
|
171
173
|
return positionals[2] && ['show', 'apply', 'discard'].includes(positionals[2]) ? 3 : 2;
|
|
172
174
|
if (first === 'credits')
|
package/package.json
CHANGED
package/skills/coauthor/SKILL.md
CHANGED
|
@@ -62,8 +62,8 @@ Everything else, including auth problems: `references/troubleshooting.md`. Credi
|
|
|
62
62
|
|
|
63
63
|
## Housekeeping
|
|
64
64
|
|
|
65
|
-
`coauthor project rename <id> --title "..."` renames a project. `coauthor project delete <id> --yes` deletes it permanently, so only do it when the user asks, or for a test project you created yourself.
|
|
65
|
+
`coauthor project rename <id> --title "..."` renames a project. `coauthor project duplicate <id> [--title "..."]` copies it with its brief, outline, research, draft, images, and posts (keeping its profile), for example to try a different angle without losing the original. `coauthor project delete <id> --yes` deletes it permanently, so only do it when the user asks, or for a test project you created yourself.
|
|
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,
|
|
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.
|
|
@@ -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)
|
|
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).
|
|
14
14
|
|
|
15
15
|
## Generate
|
|
16
16
|
|
|
@@ -44,6 +44,15 @@ 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
|
+
## Video
|
|
48
|
+
|
|
49
|
+
A short vertical video (1080x1920) of the article's key points, with illustrated panels and a closing call to action.
|
|
50
|
+
|
|
51
|
+
1. `coauthor repurpose generate <id> --format video [--cta save,follow] --json` writes the video script and starts its panel images. CTA intents: `save`, `follow`, `comment`, `share`, `read_more`, `custom:<text>`; the default is `save`. Panel images cost image credits, which is why video is not part of `--format all`.
|
|
52
|
+
2. `coauthor repurpose status <id> --format video --wait --json` waits until the panels are done (`ready_to_render`).
|
|
53
|
+
3. `coauthor repurpose render <id> --format video [--variant <id>] --wait --json` renders the MP4. It takes about 3 minutes for a typical video and runs on a shared queue, so only one render per account at a time: `render_in_progress` (429) means wait for the current one. `panels_not_ready` (409) means the panel images aren't finished yet.
|
|
54
|
+
4. `coauthor repurpose download <id> --format video --out <dir>` saves `video-<variant>.mp4`.
|
|
55
|
+
|
|
47
56
|
## Deliver
|
|
48
57
|
|
|
49
58
|
`coauthor repurpose download <id> --out <dir>` writes:
|
|
@@ -64,11 +64,11 @@ Everything else, including auth problems: `references/troubleshooting.md`. Credi
|
|
|
64
64
|
|
|
65
65
|
## Housekeeping
|
|
66
66
|
|
|
67
|
-
`coauthor project rename <id> --title "..."` renames a project. `coauthor project delete <id> --yes` deletes it permanently, so only do it when the user asks, or for a test project you created yourself.
|
|
67
|
+
`coauthor project rename <id> --title "..."` renames a project. `coauthor project duplicate <id> [--title "..."]` copies it with its brief, outline, research, draft, images, and posts (keeping its profile), for example to try a different angle without losing the original. `coauthor project delete <id> --yes` deletes it permanently, so only do it when the user asks, or for a test project you created yourself.
|
|
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,
|
|
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.
|
|
72
72
|
|
|
73
73
|
# Reference sections
|
|
74
74
|
|
|
@@ -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)
|
|
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).
|
|
414
414
|
|
|
415
415
|
### Generate
|
|
416
416
|
|
|
@@ -444,6 +444,15 @@ 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
|
+
### Video
|
|
448
|
+
|
|
449
|
+
A short vertical video (1080x1920) of the article's key points, with illustrated panels and a closing call to action.
|
|
450
|
+
|
|
451
|
+
1. `coauthor repurpose generate <id> --format video [--cta save,follow] --json` writes the video script and starts its panel images. CTA intents: `save`, `follow`, `comment`, `share`, `read_more`, `custom:<text>`; the default is `save`. Panel images cost image credits, which is why video is not part of `--format all`.
|
|
452
|
+
2. `coauthor repurpose status <id> --format video --wait --json` waits until the panels are done (`ready_to_render`).
|
|
453
|
+
3. `coauthor repurpose render <id> --format video [--variant <id>] --wait --json` renders the MP4. It takes about 3 minutes for a typical video and runs on a shared queue, so only one render per account at a time: `render_in_progress` (429) means wait for the current one. `panels_not_ready` (409) means the panel images aren't finished yet.
|
|
454
|
+
4. `coauthor repurpose download <id> --format video --out <dir>` saves `video-<variant>.mp4`.
|
|
455
|
+
|
|
447
456
|
### Deliver
|
|
448
457
|
|
|
449
458
|
`coauthor repurpose download <id> --out <dir>` writes:
|