@letterstory/cli 0.177.143 → 0.177.145
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 +3 -2
- package/lib/commands/admin.mjs +8 -2
- package/lib/commands/insights.mjs +16 -1
- package/lib/commands/posts.mjs +16 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
94
94
|
|
|
95
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
96
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.145";
|
|
97
97
|
|
|
98
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
99
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -705,7 +705,7 @@ Content:
|
|
|
705
705
|
[--paper-trail '<json>'] [--metadata-json '<json>']
|
|
706
706
|
Edit a post; only what you pass changes
|
|
707
707
|
posts edit <article-id> --instruction "<what to change>"
|
|
708
|
-
posts remediate <article-id> [--instruction "<what to change>"] [--line "<sentence>" ...] [--apply] [--allow-edited]
|
|
708
|
+
posts remediate <article-id> [--instruction "<what to change>"] [--line "<sentence>" ...] [--edits-json '[{"before":"...","after":"..."}]'] [--apply] [--allow-edited]
|
|
709
709
|
change only the named sentences, never the rest; a dry run unless --apply
|
|
710
710
|
Rewrite the post with AI from an instruction
|
|
711
711
|
posts mentions <article-id> Re-apply the brand-mention & competitor policy
|
|
@@ -1946,6 +1946,7 @@ Insights:
|
|
|
1946
1946
|
insights question <key> [--period 14d|30d|90d] [--filter all|named_you|rival_not_you|no_one] [--limit n]
|
|
1947
1947
|
One By-question row: the wordings asked and the AI answers
|
|
1948
1948
|
insights detection How your brand is detected in AI answers (terms, who set them)
|
|
1949
|
+
insights set-detection --term <name> [--dry-run] Change the names counted in AI answers (--clear restores inferred names)
|
|
1949
1950
|
insights properties Search Console properties the connected Google account can read, the
|
|
1950
1951
|
unverified ones, and the one tracked
|
|
1951
1952
|
insights property <site-url> Pick the Search Console property to track (a key minted by an admin)
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5221,8 +5221,12 @@ async function cmdAdminRepublish(ctx) {
|
|
|
5221
5221
|
}
|
|
5222
5222
|
|
|
5223
5223
|
const RECIPES = "/api/superadmin/recipes";
|
|
5224
|
-
/**
|
|
5225
|
-
|
|
5224
|
+
/**
|
|
5225
|
+
* The fields a recipe file carries: what import_recipes reads back. Every field a save accepts (recipes/types.ts
|
|
5226
|
+
* RECIPE_FIELDS) is here, held by commands-admin-recipes.test.ts: a field left out was dropped by every export and
|
|
5227
|
+
* saved as its default by every import, six times before that test.
|
|
5228
|
+
*/
|
|
5229
|
+
export const RECIPE_FILE_FIELDS = [
|
|
5226
5230
|
"id",
|
|
5227
5231
|
"kind",
|
|
5228
5232
|
"name",
|
|
@@ -5248,6 +5252,8 @@ const RECIPE_FILE_FIELDS = [
|
|
|
5248
5252
|
"repeats",
|
|
5249
5253
|
// The site's pages the fit reads before deciding it (2026-11-16); left out here, an export would drop it.
|
|
5250
5254
|
"read_pages",
|
|
5255
|
+
// Whether Ideas pre-builds it as a preview (2026-11-24); left out here, an import saved it false.
|
|
5256
|
+
"visible",
|
|
5251
5257
|
"status",
|
|
5252
5258
|
"needs",
|
|
5253
5259
|
"variations",
|
|
@@ -32,6 +32,19 @@ export const ARGS = {
|
|
|
32
32
|
period: { flag: "period", enum: PERIODS },
|
|
33
33
|
},
|
|
34
34
|
get_brand_detection: {},
|
|
35
|
+
set_brand_detection: {
|
|
36
|
+
detection: {
|
|
37
|
+
object: {
|
|
38
|
+
terms: { flag: "term", type: "list" },
|
|
39
|
+
exact_case_terms: { flag: "exact-case-term", type: "list" },
|
|
40
|
+
exclude_phrases: { flag: "exclude-phrase", type: "list" },
|
|
41
|
+
clear: { flag: "clear", type: "bool" },
|
|
42
|
+
note: { flag: "note" },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
dry_run: { flag: "dry-run", type: "bool" },
|
|
46
|
+
sample_answer: { flag: "sample-answer" },
|
|
47
|
+
},
|
|
35
48
|
get_reads: {
|
|
36
49
|
period: { flag: "period", enum: PERIODS },
|
|
37
50
|
sites: { flag: "site", type: "list" },
|
|
@@ -143,6 +156,8 @@ export async function cmdInsights(ctx) {
|
|
|
143
156
|
return call(rest, "get_share_of_voice_question");
|
|
144
157
|
case "detection":
|
|
145
158
|
return call(rest, "get_brand_detection");
|
|
159
|
+
case "set-detection":
|
|
160
|
+
return call(rest, "set_brand_detection");
|
|
146
161
|
case "reads":
|
|
147
162
|
return call(rest, "get_reads");
|
|
148
163
|
case "tracking-cadence":
|
|
@@ -178,7 +193,7 @@ export async function cmdInsights(ctx) {
|
|
|
178
193
|
return call(rest, "select_gsc_property");
|
|
179
194
|
default:
|
|
180
195
|
throw new CliError(
|
|
181
|
-
`Unknown insights subcommand: ${sub ?? "(none)"}. Try: summary, reads, tracking-cadence, set-tracking-cadence, prompts, keywords [topic], add-keywords, pages, page, mentions, portrayal, claims, competitors, question, detection, activity, story, site, post, top, bank, access, properties, property`
|
|
196
|
+
`Unknown insights subcommand: ${sub ?? "(none)"}. Try: summary, reads, tracking-cadence, set-tracking-cadence, prompts, keywords [topic], add-keywords, pages, page, mentions, portrayal, claims, competitors, question, detection, set-detection, activity, story, site, post, top, bank, access, properties, property`
|
|
182
197
|
);
|
|
183
198
|
}
|
|
184
199
|
}
|
package/lib/commands/posts.mjs
CHANGED
|
@@ -20,6 +20,20 @@ import {
|
|
|
20
20
|
const ARTICLE = { positional: 0, label: "article-id", required: true };
|
|
21
21
|
const COMMENT = { positional: 1, label: "comment-id", required: true };
|
|
22
22
|
|
|
23
|
+
/** `--<name> '<json>'` → a JSON list, or undefined when the flag is not set. */
|
|
24
|
+
function jsonListFlag(flags, name) {
|
|
25
|
+
const raw = flagStr(flags[name]);
|
|
26
|
+
if (raw === undefined) return undefined;
|
|
27
|
+
let parsed;
|
|
28
|
+
try {
|
|
29
|
+
parsed = JSON.parse(raw);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
throw new CliError(`--${name} is not valid JSON: ${err.message}`);
|
|
32
|
+
}
|
|
33
|
+
if (!Array.isArray(parsed)) throw new CliError(`--${name} must be a JSON list`);
|
|
34
|
+
return parsed;
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
/** `--<name> '<json>'` → a JSON object, or undefined when the flag is not set. */
|
|
24
38
|
function jsonObjectFlag(flags, name) {
|
|
25
39
|
const raw = flagStr(flags[name]);
|
|
@@ -92,6 +106,8 @@ export const ARGS = {
|
|
|
92
106
|
article_id: ARTICLE,
|
|
93
107
|
instruction: "instruction",
|
|
94
108
|
lines: { flag: "line", type: "list", label: "line" },
|
|
109
|
+
// A JSON list of {before, after} from an earlier dry run: applied as reviewed, no model call.
|
|
110
|
+
edits: { value: (flags) => jsonListFlag(flags, "edits-json") },
|
|
95
111
|
apply: { flag: "apply", type: "bool" },
|
|
96
112
|
allow_edited: { flag: "allow-edited", type: "bool" },
|
|
97
113
|
},
|