@contenthero/cli 0.1.0
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 +108 -0
- package/dist/args.d.ts +13 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +35 -0
- package/dist/args.js.map +1 -0
- package/dist/commands/account.d.ts +7 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +22 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/auth.d.ts +35 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +210 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/brandkit.d.ts +12 -0
- package/dist/commands/brandkit.d.ts.map +1 -0
- package/dist/commands/brandkit.js +159 -0
- package/dist/commands/brandkit.js.map +1 -0
- package/dist/commands/config.d.ts +11 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +69 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/connected.d.ts +13 -0
- package/dist/commands/connected.d.ts.map +1 -0
- package/dist/commands/connected.js +86 -0
- package/dist/commands/connected.js.map +1 -0
- package/dist/commands/generate.d.ts +15 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +215 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/generation.d.ts +12 -0
- package/dist/commands/generation.d.ts.map +1 -0
- package/dist/commands/generation.js +61 -0
- package/dist/commands/generation.js.map +1 -0
- package/dist/commands/identity.d.ts +10 -0
- package/dist/commands/identity.d.ts.map +1 -0
- package/dist/commands/identity.js +83 -0
- package/dist/commands/identity.js.map +1 -0
- package/dist/commands/inspiration.d.ts +17 -0
- package/dist/commands/inspiration.d.ts.map +1 -0
- package/dist/commands/inspiration.js +124 -0
- package/dist/commands/inspiration.js.map +1 -0
- package/dist/commands/media.d.ts +11 -0
- package/dist/commands/media.d.ts.map +1 -0
- package/dist/commands/media.js +76 -0
- package/dist/commands/media.js.map +1 -0
- package/dist/commands/model.d.ts +10 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +27 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/pipeline.d.ts +10 -0
- package/dist/commands/pipeline.d.ts.map +1 -0
- package/dist/commands/pipeline.js +21 -0
- package/dist/commands/pipeline.js.map +1 -0
- package/dist/commands/post.d.ts +14 -0
- package/dist/commands/post.d.ts.map +1 -0
- package/dist/commands/post.js +267 -0
- package/dist/commands/post.js.map +1 -0
- package/dist/commands/schema.d.ts +11 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +82 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/upscale.d.ts +11 -0
- package/dist/commands/upscale.d.ts.map +1 -0
- package/dist/commands/upscale.js +56 -0
- package/dist/commands/upscale.js.map +1 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +68 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +45 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +63 -0
- package/dist/context.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +51 -0
- package/dist/errors.js.map +1 -0
- package/dist/generation.d.ts +34 -0
- package/dist/generation.d.ts.map +1 -0
- package/dist/generation.js +111 -0
- package/dist/generation.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +14 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +33 -0
- package/dist/output.js.map +1 -0
- package/dist/program.d.ts +11 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +69 -0
- package/dist/program.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero avatar` / `voice` - the account's reusable identity assets.
|
|
3
|
+
* avatar list | get <id> avatars (base look + default voice) and their looks
|
|
4
|
+
* voice list | get <id> saved voices (ids feed generate audio / lip-sync)
|
|
5
|
+
*
|
|
6
|
+
* Reads only; creating avatars and voices stays in the app.
|
|
7
|
+
*/
|
|
8
|
+
import { makeClient } from '../context.js';
|
|
9
|
+
import { emit, keyValues, table } from '../output.js';
|
|
10
|
+
export function registerIdentity(program) {
|
|
11
|
+
const avatar = program.command('avatar').description("Browse the account's avatars");
|
|
12
|
+
avatar
|
|
13
|
+
.command('list')
|
|
14
|
+
.description('List avatars (base look + default voice)')
|
|
15
|
+
.action(async (_opts, command) => {
|
|
16
|
+
const { client, ctx } = makeClient(command);
|
|
17
|
+
const avatars = await client.listAvatars();
|
|
18
|
+
emit(avatars, ctx, (rows) => table(['ID', 'NAME', 'DEFAULT', 'VOICE', 'STATUS'], rows.map((a) => [
|
|
19
|
+
a.id.slice(0, 8),
|
|
20
|
+
a.name,
|
|
21
|
+
a.isDefault ? 'yes' : '',
|
|
22
|
+
a.defaultVoiceId ?? '',
|
|
23
|
+
a.status,
|
|
24
|
+
])));
|
|
25
|
+
});
|
|
26
|
+
avatar
|
|
27
|
+
.command('get')
|
|
28
|
+
.description('Get one avatar with its looks')
|
|
29
|
+
.argument('<id>', 'the avatar id')
|
|
30
|
+
.action(async (id, _opts, command) => {
|
|
31
|
+
const { client, ctx } = makeClient(command);
|
|
32
|
+
const a = await client.getAvatar(id);
|
|
33
|
+
emit(a, ctx, (av) => {
|
|
34
|
+
const head = keyValues([
|
|
35
|
+
['Name', av.name],
|
|
36
|
+
['Id', av.id],
|
|
37
|
+
['Default voice', av.defaultVoiceId ?? ''],
|
|
38
|
+
['Image', av.imageUrl ?? ''],
|
|
39
|
+
...(av.gender ? [['Gender', av.gender]] : []),
|
|
40
|
+
...(av.age ? [['Age', av.age]] : []),
|
|
41
|
+
['Looks', av.looks.length],
|
|
42
|
+
]);
|
|
43
|
+
const looks = av.looks.length
|
|
44
|
+
? '\n\nLooks:\n' +
|
|
45
|
+
table(['ID', 'NAME', 'TYPE', 'DEFAULT'], av.looks.map((l) => [
|
|
46
|
+
l.id.slice(0, 8),
|
|
47
|
+
l.name ?? '',
|
|
48
|
+
l.lookType ?? '',
|
|
49
|
+
l.isDefault ? 'yes' : '',
|
|
50
|
+
]))
|
|
51
|
+
: '';
|
|
52
|
+
return head + looks;
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const voice = program.command('voice').description("Browse the account's saved voices");
|
|
56
|
+
voice
|
|
57
|
+
.command('list')
|
|
58
|
+
.description('List saved voices (favorites first)')
|
|
59
|
+
.action(async (_opts, command) => {
|
|
60
|
+
const { client, ctx } = makeClient(command);
|
|
61
|
+
const voices = await client.listVoices();
|
|
62
|
+
emit(voices, ctx, (rows) => table(['VOICE ID', 'NAME', 'PROVIDER', 'FAV'], rows.map((v) => [v.voiceId, v.name ?? '', v.provider ?? '', v.isFavorited ? 'yes' : ''])));
|
|
63
|
+
});
|
|
64
|
+
voice
|
|
65
|
+
.command('get')
|
|
66
|
+
.description('Get one voice by its voiceId')
|
|
67
|
+
.argument('<id>', 'the voice id')
|
|
68
|
+
.action(async (id, _opts, command) => {
|
|
69
|
+
const { client, ctx } = makeClient(command);
|
|
70
|
+
const v = await client.getVoice(id);
|
|
71
|
+
emit(v, ctx, (voiceDetail) => keyValues([
|
|
72
|
+
['Name', voiceDetail.name ?? ''],
|
|
73
|
+
['Voice id', voiceDetail.voiceId],
|
|
74
|
+
['Provider', voiceDetail.provider ?? ''],
|
|
75
|
+
['Accent', voiceDetail.accent ?? ''],
|
|
76
|
+
['Language', voiceDetail.language ?? ''],
|
|
77
|
+
['Gender', voiceDetail.gender ?? ''],
|
|
78
|
+
['Age', voiceDetail.age ?? ''],
|
|
79
|
+
...(voiceDetail.description ? [['Description', voiceDetail.description]] : []),
|
|
80
|
+
]));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@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EAAE,EAAE;QACpD,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;QAC3C,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACnC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,WAAkB,EAAE,EAAE,CAClC,SAAS,CAAC;YACR,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC;YAChC,CAAC,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC;YACjC,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE,CAAC;YACxC,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,IAAI,EAAE,CAAC;YACpC,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE,CAAC;YACxC,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,IAAI,EAAE,CAAC;YACpC,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,IAAI,EAAE,CAAC;YAC9B,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,WAAW,CAAC,WAAW,CAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACnG,CAAC,CACH,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero inspiration` - research reads over tracked creators/competitors.
|
|
3
|
+
* inspiration accounts the creators the account tracks
|
|
4
|
+
* inspiration account <id> one tracked account + its top outliers
|
|
5
|
+
* inspiration outliers top-performing content, ranked by outlier score
|
|
6
|
+
* inspiration content <id> one item in full (incl. transcript)
|
|
7
|
+
*
|
|
8
|
+
* This is the core "what is working" research surface. Reads only.
|
|
9
|
+
*/
|
|
10
|
+
import type { Command } from 'commander';
|
|
11
|
+
import type { Outlier, TrackedAccount } from '@contenthero/sdk';
|
|
12
|
+
/** A table of tracked accounts (shared with brand-account list). */
|
|
13
|
+
export declare function trackedAccountsTable(rows: TrackedAccount[]): string;
|
|
14
|
+
/** A table of outliers / tracked content. */
|
|
15
|
+
export declare function outliersTable(rows: Outlier[]): string;
|
|
16
|
+
export declare function registerInspiration(program: Command): void;
|
|
17
|
+
//# sourceMappingURL=inspiration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspiration.d.ts","sourceRoot":"","sources":["../../src/commands/inspiration.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAGV,OAAO,EAEP,cAAc,EACf,MAAM,kBAAkB,CAAA;AAMzB,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,MAAM,CAWnE;AAED,6CAA6C;AAC7C,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAWrD;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0F1D"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero inspiration` - research reads over tracked creators/competitors.
|
|
3
|
+
* inspiration accounts the creators the account tracks
|
|
4
|
+
* inspiration account <id> one tracked account + its top outliers
|
|
5
|
+
* inspiration outliers top-performing content, ranked by outlier score
|
|
6
|
+
* inspiration content <id> one item in full (incl. transcript)
|
|
7
|
+
*
|
|
8
|
+
* This is the core "what is working" research surface. Reads only.
|
|
9
|
+
*/
|
|
10
|
+
import { makeClient } from '../context.js';
|
|
11
|
+
import { emit, keyValues, table } from '../output.js';
|
|
12
|
+
import { CliError, EXIT } from '../errors.js';
|
|
13
|
+
import { toFloat, toInt } from '../args.js';
|
|
14
|
+
/** A table of tracked accounts (shared with brand-account list). */
|
|
15
|
+
export function trackedAccountsTable(rows) {
|
|
16
|
+
return table(['ID', 'PLATFORM', 'HANDLE', 'NAME', 'FOLLOWERS'], rows.map((a) => [
|
|
17
|
+
a.id.slice(0, 8),
|
|
18
|
+
a.platform ?? '',
|
|
19
|
+
a.handle ?? '',
|
|
20
|
+
a.name ?? '',
|
|
21
|
+
a.followerCount ?? '',
|
|
22
|
+
]));
|
|
23
|
+
}
|
|
24
|
+
/** A table of outliers / tracked content. */
|
|
25
|
+
export function outliersTable(rows) {
|
|
26
|
+
return table(['ID', 'PLATFORM', 'SCORE', 'VIEWS', 'TITLE'], rows.map((o) => [
|
|
27
|
+
o.id.slice(0, 8),
|
|
28
|
+
o.platform ?? '',
|
|
29
|
+
o.outlierScore != null ? o.outlierScore.toFixed(1) : '',
|
|
30
|
+
o.viewCount ?? '',
|
|
31
|
+
(o.title ?? '').replace(/\s+/g, ' ').slice(0, 50),
|
|
32
|
+
]));
|
|
33
|
+
}
|
|
34
|
+
const SORTS = ['score', 'date', 'views'];
|
|
35
|
+
export function registerInspiration(program) {
|
|
36
|
+
const inspiration = program
|
|
37
|
+
.command('inspiration')
|
|
38
|
+
.description('Research reads: tracked creators and their top content');
|
|
39
|
+
inspiration
|
|
40
|
+
.command('accounts')
|
|
41
|
+
.description('List the creators/competitors the account tracks')
|
|
42
|
+
.action(async (_opts, command) => {
|
|
43
|
+
const { client, ctx } = makeClient(command);
|
|
44
|
+
emit(await client.listInspirationAccounts(), ctx, trackedAccountsTable);
|
|
45
|
+
});
|
|
46
|
+
inspiration
|
|
47
|
+
.command('account')
|
|
48
|
+
.description('Get one tracked account with its top outliers')
|
|
49
|
+
.argument('<id>', 'the inspiration account id')
|
|
50
|
+
.action(async (id, _opts, command) => {
|
|
51
|
+
const { client, ctx } = makeClient(command);
|
|
52
|
+
const detail = await client.getInspirationAccount(id);
|
|
53
|
+
emit(detail, ctx, (d) => {
|
|
54
|
+
const head = keyValues([
|
|
55
|
+
['Name', d.account.name ?? ''],
|
|
56
|
+
['Handle', d.account.handle ?? ''],
|
|
57
|
+
['Platform', d.account.platform ?? ''],
|
|
58
|
+
['Followers', d.account.followerCount ?? ''],
|
|
59
|
+
['Tracked items', d.contentCount],
|
|
60
|
+
]);
|
|
61
|
+
const top = d.topContent.length ? '\n\nTop content:\n' + outliersTable(d.topContent) : '';
|
|
62
|
+
return head + top;
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
inspiration
|
|
66
|
+
.command('outliers')
|
|
67
|
+
.description('List top-performing content (outliers), ranked by outlier score')
|
|
68
|
+
.option('--platform <platform>', 'filter to one platform (youtube, instagram)')
|
|
69
|
+
.option('--type <type>', "content type, e.g. video, short, reel")
|
|
70
|
+
.option('--min-score <n>', 'only content at or above this outlier score', toFloat)
|
|
71
|
+
.option('--search <text>', 'text search across title, creator, handle, description')
|
|
72
|
+
.option('--sort <sort>', `sort order: ${SORTS.join(', ')} (default score)`)
|
|
73
|
+
.option('--limit <n>', 'how many to return (default 20)', toInt)
|
|
74
|
+
.option('--offset <n>', 'pagination offset', toInt)
|
|
75
|
+
.action(async (opts, command) => {
|
|
76
|
+
if (opts.sort && !SORTS.includes(opts.sort)) {
|
|
77
|
+
throw new CliError(`Invalid --sort "${opts.sort}". Expected one of: ${SORTS.join(', ')}.`, EXIT.USAGE);
|
|
78
|
+
}
|
|
79
|
+
const { client, ctx } = makeClient(command);
|
|
80
|
+
const result = await client.listOutliers({
|
|
81
|
+
platform: opts.platform,
|
|
82
|
+
contentType: opts.type,
|
|
83
|
+
minOutlierScore: opts.minScore,
|
|
84
|
+
search: opts.search,
|
|
85
|
+
sortBy: opts.sort,
|
|
86
|
+
limit: opts.limit,
|
|
87
|
+
offset: opts.offset,
|
|
88
|
+
});
|
|
89
|
+
emit(result, ctx, (r) => {
|
|
90
|
+
const t = outliersTable(r.outliers);
|
|
91
|
+
return `${t}\n\n${r.outliers.length} of ${r.total}${r.hasMore ? ' (more available)' : ''}`;
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
inspiration
|
|
95
|
+
.command('content')
|
|
96
|
+
.description('Get one tracked-content item in full (engagement, hashtags, transcript)')
|
|
97
|
+
.argument('<id>', 'the content id (from outliers or an account)')
|
|
98
|
+
.action(async (id, _opts, command) => {
|
|
99
|
+
const { client, ctx } = makeClient(command);
|
|
100
|
+
const content = await client.getInspirationContent(id);
|
|
101
|
+
emit(content, ctx, (c) => {
|
|
102
|
+
const pairs = [
|
|
103
|
+
['Title', c.title ?? ''],
|
|
104
|
+
['Creator', c.sourceCreator ?? ''],
|
|
105
|
+
['Platform', c.platform ?? ''],
|
|
106
|
+
['Outlier score', c.outlierScore != null ? c.outlierScore.toFixed(2) : ''],
|
|
107
|
+
['Views', c.viewCount ?? ''],
|
|
108
|
+
['Likes', c.likeCount ?? ''],
|
|
109
|
+
['Comments', c.commentCount ?? ''],
|
|
110
|
+
];
|
|
111
|
+
if (c.hashtags.length)
|
|
112
|
+
pairs.push(['Hashtags', c.hashtags.join(' ')]);
|
|
113
|
+
if (c.url)
|
|
114
|
+
pairs.push(['URL', c.url]);
|
|
115
|
+
let out = keyValues(pairs);
|
|
116
|
+
if (c.transcript) {
|
|
117
|
+
const preview = c.transcript.replace(/\s+/g, ' ').slice(0, 280);
|
|
118
|
+
out += `\n\nTranscript (${c.transcript.length} chars):\n${preview}${c.transcript.length > 280 ? '…' : ''}`;
|
|
119
|
+
}
|
|
120
|
+
return out;
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=inspiration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspiration.js","sourceRoot":"","sources":["../../src/commands/inspiration.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM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creations").
|
|
3
|
+
* media list [--type --kind --status --limit] recent outputs, newest first
|
|
4
|
+
* media get <id> one output, with its variations
|
|
5
|
+
*
|
|
6
|
+
* Spans creations, reference boards, and looks; filter with --kind. An id may be
|
|
7
|
+
* the full output id, its first 8 chars, or either with a "-N" variation suffix.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from 'commander';
|
|
10
|
+
export declare function registerMedia(program: Command): void;
|
|
11
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/commands/media.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkBxC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqEpD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero media` - the account's studio outputs ("creations").
|
|
3
|
+
* media list [--type --kind --status --limit] recent outputs, newest first
|
|
4
|
+
* media get <id> one output, with its variations
|
|
5
|
+
*
|
|
6
|
+
* Spans creations, reference boards, and looks; filter with --kind. An id may be
|
|
7
|
+
* the full output id, its first 8 chars, or either with a "-N" variation suffix.
|
|
8
|
+
*/
|
|
9
|
+
import { makeClient } from '../context.js';
|
|
10
|
+
import { emit, keyValues, table } from '../output.js';
|
|
11
|
+
import { CliError, EXIT } from '../errors.js';
|
|
12
|
+
import { toInt } from '../args.js';
|
|
13
|
+
const MEDIA_TYPES = ['image', 'video', 'audio', 'transcript'];
|
|
14
|
+
const KINDS = ['creation', 'board', 'look'];
|
|
15
|
+
/** Shorten a prompt for table display. */
|
|
16
|
+
function clip(text, max = 48) {
|
|
17
|
+
if (!text)
|
|
18
|
+
return '';
|
|
19
|
+
const oneLine = text.replace(/\s+/g, ' ').trim();
|
|
20
|
+
return oneLine.length > max ? oneLine.slice(0, max - 1) + '…' : oneLine;
|
|
21
|
+
}
|
|
22
|
+
export function registerMedia(program) {
|
|
23
|
+
const media = program.command('media').description("Browse the account's studio outputs");
|
|
24
|
+
media
|
|
25
|
+
.command('list')
|
|
26
|
+
.description('List recent studio outputs (newest first)')
|
|
27
|
+
.option('--type <type>', `filter by media type: ${MEDIA_TYPES.join(', ')}`)
|
|
28
|
+
.option('--kind <kind>', `filter by asset class: ${KINDS.join(', ')}`)
|
|
29
|
+
.option('--status <status>', "status filter (defaults to 'completed')")
|
|
30
|
+
.option('--limit <n>', 'how many to return (default 20)', toInt)
|
|
31
|
+
.action(async (opts, command) => {
|
|
32
|
+
if (opts.type && !MEDIA_TYPES.includes(opts.type)) {
|
|
33
|
+
throw new CliError(`Invalid --type "${opts.type}". Expected one of: ${MEDIA_TYPES.join(', ')}.`, EXIT.USAGE);
|
|
34
|
+
}
|
|
35
|
+
if (opts.kind && !KINDS.includes(opts.kind)) {
|
|
36
|
+
throw new CliError(`Invalid --kind "${opts.kind}". Expected one of: ${KINDS.join(', ')}.`, EXIT.USAGE);
|
|
37
|
+
}
|
|
38
|
+
const { client, ctx } = makeClient(command);
|
|
39
|
+
const items = await client.listMedia({
|
|
40
|
+
contentType: opts.type,
|
|
41
|
+
kind: opts.kind,
|
|
42
|
+
status: opts.status,
|
|
43
|
+
limit: opts.limit,
|
|
44
|
+
});
|
|
45
|
+
emit(items, ctx, (rows) => table(['ID', 'TYPE', 'KIND', 'MODEL', 'STATUS', 'PROMPT'], rows.map((m) => [
|
|
46
|
+
m.id.slice(0, 8),
|
|
47
|
+
m.type,
|
|
48
|
+
m.kind ?? '',
|
|
49
|
+
m.model ?? '',
|
|
50
|
+
m.status,
|
|
51
|
+
clip(m.prompt),
|
|
52
|
+
])));
|
|
53
|
+
});
|
|
54
|
+
media
|
|
55
|
+
.command('get')
|
|
56
|
+
.description('Get one studio output by id, with its variations')
|
|
57
|
+
.argument('<id>', 'output id (full or first-8), optionally with a "-N" variation suffix')
|
|
58
|
+
.action(async (id, _opts, command) => {
|
|
59
|
+
const { client, ctx } = makeClient(command);
|
|
60
|
+
const item = await client.getMedia(id);
|
|
61
|
+
emit(item, ctx, (m) => {
|
|
62
|
+
const head = keyValues([
|
|
63
|
+
['Id', m.id],
|
|
64
|
+
['Type', m.type],
|
|
65
|
+
['Kind', m.kind ?? 'creation'],
|
|
66
|
+
['Model', m.model ?? ''],
|
|
67
|
+
['Status', m.status],
|
|
68
|
+
...(m.prompt ? [['Prompt', clip(m.prompt, 80)]] : []),
|
|
69
|
+
...(m.creditsUsed != null ? [['Credits used', m.creditsUsed]] : []),
|
|
70
|
+
]);
|
|
71
|
+
const variations = table(['VAR', 'STATUS', 'FAV', 'URL'], m.variations.map((v) => [v.variation, v.status, v.isFavorited ? 'yes' : '', v.url ?? '']));
|
|
72
|
+
return `${head}\n\n${variations}`;
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/commands/media.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,WAAW,GAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;AAC1E,MAAM,KAAK,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAU,CAAA;AAGpD,0CAA0C;AAC1C,SAAS,IAAI,CAAC,IAAmB,EAAE,GAAG,GAAG,EAAE;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IACpB,MAAM,OAAO,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enthero model` - the discovery catalog.
|
|
3
|
+
* model list [--type image|video|audio] models available to this key
|
|
4
|
+
*
|
|
5
|
+
* This is the source of truth for which model ids exist; use it instead of
|
|
6
|
+
* hardcoding ids when scripting generation.
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from 'commander';
|
|
9
|
+
export declare function registerModel(program: Command): void;
|
|
10
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/commands/model.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASxC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuBpD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero model` - the discovery catalog.
|
|
3
|
+
* model list [--type image|video|audio] models available to this key
|
|
4
|
+
*
|
|
5
|
+
* This is the source of truth for which model ids exist; use it instead of
|
|
6
|
+
* hardcoding ids when scripting generation.
|
|
7
|
+
*/
|
|
8
|
+
import { makeClient } from '../context.js';
|
|
9
|
+
import { emit, table } from '../output.js';
|
|
10
|
+
import { CliError, EXIT } from '../errors.js';
|
|
11
|
+
const CONTENT_TYPES = ['image', 'video', 'audio'];
|
|
12
|
+
export function registerModel(program) {
|
|
13
|
+
const model = program.command('model').description('Discover the models available to your key');
|
|
14
|
+
model
|
|
15
|
+
.command('list')
|
|
16
|
+
.description('List the models available to this key (the discovery catalog)')
|
|
17
|
+
.option('--type <type>', 'filter by content type: image, video, or audio')
|
|
18
|
+
.action(async (opts, command) => {
|
|
19
|
+
if (opts.type && !CONTENT_TYPES.includes(opts.type)) {
|
|
20
|
+
throw new CliError(`Invalid --type "${opts.type}". Expected one of: ${CONTENT_TYPES.join(', ')}.`, EXIT.USAGE);
|
|
21
|
+
}
|
|
22
|
+
const { client, ctx } = makeClient(command);
|
|
23
|
+
const models = await client.listModels({ contentType: opts.type });
|
|
24
|
+
emit(models, ctx, (rows) => table(['MODEL', 'TYPE', 'KIND', 'NAME'], rows.map((m) => [m.modelId, m.contentType, m.kind, m.displayName])));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/commands/model.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAG7C,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAU,CAAA;AAG1D,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAA;IAE/F,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,+DAA+D,CAAC;SAC5E,MAAM,CAAC,eAAe,EAAE,gDAAgD,CAAC;SACzE,MAAM,CAAC,KAAK,EAAE,IAAuB,EAAE,OAAgB,EAAE,EAAE;QAC1D,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAmB,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,QAAQ,CAChB,mBAAmB,IAAI,CAAC,IAAI,uBAAuB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAC9E,IAAI,CAAC,KAAK,CACX,CAAA;QACH,CAAC;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;QAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,IAA+B,EAAE,CAAC,CAAA;QAC7F,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAiB,EAAE,EAAE,CACtC,KAAK,CACH,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACjC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CACnE,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero pipeline` - the account's pipeline stages.
|
|
3
|
+
* pipeline stages list the stages, in order
|
|
4
|
+
*
|
|
5
|
+
* Stages are per-account customizable, so resolve one here before placing a post
|
|
6
|
+
* with `post create --stage`. The id is the most stable handle.
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from 'commander';
|
|
9
|
+
export declare function registerPipeline(program: Command): void;
|
|
10
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/commands/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgBvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero pipeline` - the account's pipeline stages.
|
|
3
|
+
* pipeline stages list the stages, in order
|
|
4
|
+
*
|
|
5
|
+
* Stages are per-account customizable, so resolve one here before placing a post
|
|
6
|
+
* with `post create --stage`. The id is the most stable handle.
|
|
7
|
+
*/
|
|
8
|
+
import { makeClient } from '../context.js';
|
|
9
|
+
import { emit, table } from '../output.js';
|
|
10
|
+
export function registerPipeline(program) {
|
|
11
|
+
const pipeline = program.command('pipeline').description('Inspect the content pipeline stages');
|
|
12
|
+
pipeline
|
|
13
|
+
.command('stages')
|
|
14
|
+
.description('List the account\'s pipeline stages, in order')
|
|
15
|
+
.action(async (_opts, command) => {
|
|
16
|
+
const { client, ctx } = makeClient(command);
|
|
17
|
+
const stages = await client.listPipelineStages();
|
|
18
|
+
emit(stages, ctx, (rows) => table(['ORDER', 'NAME', 'SLUG', 'DEFAULT', 'ID'], rows.map((s) => [s.sortOrder, s.name, s.slug ?? '', s.isDefault ? 'yes' : '', s.id])));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/commands/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAE1C,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAA;IAE/F,QAAQ;SACL,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,+CAA+C,CAAC;SAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAgB,EAAE,EAAE;QACxC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;QAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAA;QAChD,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAqB,EAAE,EAAE,CAC1C,KAAK,CACH,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,EAC1C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CACrF,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contenthero post` - the content pipeline (posts, destinations, assets).
|
|
3
|
+
* post list | get | create | update | archive | schedule | publish
|
|
4
|
+
* post destination add | update
|
|
5
|
+
* post asset add
|
|
6
|
+
*
|
|
7
|
+
* A post is the container: create it, attach destinations (platforms) and assets
|
|
8
|
+
* (media URLs), then schedule or publish. Stages accept an id, slug, or name and
|
|
9
|
+
* resolve server-side. Writes need pipeline:write (assets need assets:write,
|
|
10
|
+
* publish needs publish:write); the key's scopes are the consent.
|
|
11
|
+
*/
|
|
12
|
+
import type { Command } from 'commander';
|
|
13
|
+
export declare function registerPost(program: Command): void;
|
|
14
|
+
//# sourceMappingURL=post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/commands/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAgExC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0OnD"}
|