@letterstory/cli 0.8.0 → 0.9.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/lib/cli.mjs +12 -5
- package/lib/commands/onboard.mjs +29 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from "./commands.mjs";
|
|
41
41
|
|
|
42
42
|
// Keep in sync with cli/package.json.
|
|
43
|
-
export const VERSION = "0.
|
|
43
|
+
export const VERSION = "0.9.0";
|
|
44
44
|
|
|
45
45
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
46
46
|
// can't accidentally swallow the id as --json's value.
|
|
@@ -254,12 +254,19 @@ Phantom orchestrator:
|
|
|
254
254
|
phantom-job status <job-id> Check a job's stage
|
|
255
255
|
|
|
256
256
|
Phantom onboarding recipe (domain -> live phantom blog with first posts):
|
|
257
|
-
${bin === "phantom" ? "onboard" : "phantom-onboard"} <domain> [--
|
|
258
|
-
[--cover editorial_image|full_ai|line_art] [--theme T]
|
|
257
|
+
${bin === "phantom" ? "onboard" : "phantom-onboard"} <domain> [--about "the beat"] [--name X]
|
|
258
|
+
[--posts N] [--cadence N] [--cover editorial_image|full_ai|line_art] [--theme T]
|
|
259
|
+
[--real] [--domain host] [--domain-mode subdomain|buy_now|connect_later]
|
|
260
|
+
[--accept] [--dry-run]
|
|
259
261
|
Plan (read-only) then, with --accept
|
|
260
262
|
or an override flag, provision + configure
|
|
261
|
-
+ seed. --
|
|
262
|
-
|
|
263
|
+
+ seed. --about becomes the planner's
|
|
264
|
+
steering prompt, so it shapes the topic map
|
|
265
|
+
and every post — use it for a client's
|
|
266
|
+
second phantom. --name is committed at
|
|
267
|
+
create (it seeds the URL); pass it before
|
|
268
|
+
applying. --domain-mode buy_now SPENDS
|
|
269
|
+
money (2/org, $30 cap).
|
|
263
270
|
|
|
264
271
|
Seers (event-driven signals -> drafts):
|
|
265
272
|
seers list List seers with recent activity
|
package/lib/commands/onboard.mjs
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
// durable onboarding job server-side and returns a job_id; this command then polls
|
|
7
7
|
// `get_phantom_onboard_status` until the job is done (provision → configure → seed).
|
|
8
8
|
//
|
|
9
|
+
// `--about "<the beat>"` is the highest-leverage flag: it becomes the publication's planner
|
|
10
|
+
// steering prompt, so it shapes the topic map and every post the site ever writes — not just
|
|
11
|
+
// the name. Use it when the client already has a phantom and this one needs a different beat.
|
|
12
|
+
//
|
|
13
|
+
// `--domain <host>` records a custom domain; nothing is bought unless you also pass
|
|
14
|
+
// `--domain-mode buy_now`, which SPENDS money against a 2-per-org, $30-per-domain cap.
|
|
15
|
+
//
|
|
9
16
|
// IMPORTANT: the masthead name is committed when the site is created (it seeds the URL),
|
|
10
17
|
// so to use a name other than the inferred one, pass --name BEFORE applying. The first
|
|
11
18
|
// posts are written by background jobs (20-40min each); they're reported as job ids and
|
|
@@ -15,6 +22,7 @@ import { CliError } from "../client.mjs";
|
|
|
15
22
|
import { flagStr, flagNum, flagBool, requirePositional, printResult, compact, ok, pollUntil } from "./shared.mjs";
|
|
16
23
|
|
|
17
24
|
const COVER_STYLES = ["editorial_image", "full_ai", "line_art"];
|
|
25
|
+
const DOMAIN_MODES = ["subdomain", "buy_now", "connect_later"];
|
|
18
26
|
|
|
19
27
|
function formatPlan(plan) {
|
|
20
28
|
const lines = [
|
|
@@ -23,6 +31,10 @@ function formatPlan(plan) {
|
|
|
23
31
|
` description: ${plan.description}`,
|
|
24
32
|
` defaults: ${plan.defaults.cadence_per_week}/week · ${plan.defaults.cover_canvas} · seed ${plan.defaults.posts_to_seed}`,
|
|
25
33
|
];
|
|
34
|
+
if (plan.direction) lines.push(` direction: ${plan.direction}`);
|
|
35
|
+
if (plan.domain_plan?.site_domain) {
|
|
36
|
+
lines.push(` domain: ${plan.domain_plan.site_domain} (${plan.domain_plan.mode})`);
|
|
37
|
+
}
|
|
26
38
|
if (plan.strategy) {
|
|
27
39
|
lines.push(` topics: ${(plan.strategy.priority_topics ?? []).slice(0, 5).join(", ") || "(none)"}`);
|
|
28
40
|
} else {
|
|
@@ -54,12 +66,28 @@ function overridesFromFlags(flags) {
|
|
|
54
66
|
if (cover !== undefined && !COVER_STYLES.includes(cover)) {
|
|
55
67
|
throw new CliError(`--cover must be one of: ${COVER_STYLES.join(", ")}`);
|
|
56
68
|
}
|
|
69
|
+
const domainMode = flagStr(flags["domain-mode"]);
|
|
70
|
+
if (domainMode !== undefined && !DOMAIN_MODES.includes(domainMode)) {
|
|
71
|
+
throw new CliError(`--domain-mode must be one of: ${DOMAIN_MODES.join(", ")}`);
|
|
72
|
+
}
|
|
73
|
+
const siteDomain = flagStr(flags.domain);
|
|
74
|
+
// buy_now spends real money against a 2-per-org cap; refusing the mismatch here beats
|
|
75
|
+
// silently downgrading it to a subdomain launch the caller didn't ask for.
|
|
76
|
+
if (domainMode && domainMode !== "subdomain" && !siteDomain) {
|
|
77
|
+
throw new CliError(`--domain-mode ${domainMode} needs --domain <bare-domain>`);
|
|
78
|
+
}
|
|
57
79
|
return compact({
|
|
58
80
|
name: flagStr(flags.name),
|
|
59
81
|
cadence_per_week: flagNum(flags.cadence),
|
|
60
82
|
cover_canvas: cover,
|
|
61
83
|
theme: flagStr(flags.theme),
|
|
62
84
|
posts_to_seed: flagNum(flags.posts),
|
|
85
|
+
// The highest-leverage override: it becomes the planner's steering prompt, so it
|
|
86
|
+
// shapes the topic map and every post, not just the masthead.
|
|
87
|
+
direction: flagStr(flags.about) ?? flagStr(flags.direction),
|
|
88
|
+
site_domain: siteDomain,
|
|
89
|
+
domain_mode: domainMode,
|
|
90
|
+
is_test: flagBool(flags["real"]) ? false : undefined,
|
|
63
91
|
});
|
|
64
92
|
}
|
|
65
93
|
|
|
@@ -84,7 +112,7 @@ export async function cmdOnboard(ctx) {
|
|
|
84
112
|
if (!flagBool(flags.accept) && !overrideGiven) {
|
|
85
113
|
ok(
|
|
86
114
|
ctx,
|
|
87
|
-
"Re-run with --accept to apply, or pass --name/--cadence/--cover/--posts/--theme to adjust. " +
|
|
115
|
+
"Re-run with --accept to apply, or pass --about/--name/--cadence/--cover/--posts/--theme/--domain to adjust. " +
|
|
88
116
|
"Note: --name is committed at create (it seeds the URL)."
|
|
89
117
|
);
|
|
90
118
|
return 0;
|