@letterstory/cli 0.177.83 → 0.177.85
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/insights.mjs +14 -2
- package/lib/commands/usage.mjs +21 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
91
91
|
|
|
92
92
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
93
|
-
export const VERSION = "0.177.
|
|
93
|
+
export const VERSION = "0.177.85";
|
|
94
94
|
|
|
95
95
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
96
96
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1873,7 +1873,8 @@ Insights:
|
|
|
1873
1873
|
insights summary [--period …] [--part <block>]... Measure Overview: AI named/cited rates, share of voice, search, targets
|
|
1874
1874
|
insights reads [--period …] [--site all|own|phantoms|<key>]... [--path <path>] [--engine <operator>]
|
|
1875
1875
|
Measure → Reads: AI engines and people reading your sites, counted one way
|
|
1876
|
-
insights
|
|
1876
|
+
insights prompts [--period 14d|30d|90d] Measure → Prompt tracking: every prompt we ask, each engine's latest answer, share / change / cited
|
|
1877
|
+
insights keywords [topic] [--refresh] Measure → Keyword tracking: your keywords (searches, difficulty, intent, rank, tracked), or research a topic
|
|
1877
1878
|
insights pages [--period 14d|30d|90d] [--site own|phantoms|<key>] Measure → Pages: your pages AI answers cited, won questions first
|
|
1878
1879
|
insights page <page> [--period 14d|30d|90d] [--question <prompt-id>] [--filter all|won] [--limit n]
|
|
1879
1880
|
One cited page: the AI answers that linked it, word for word
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// network, single-post, and top-posts levels (ported from phantomstory-cli's
|
|
3
3
|
// insights.ts); plus Measure's Overview (`summary`), GEO → Competitors
|
|
4
4
|
// (`competitors`), AI Visibility Bank (`bank`) and phantom Page Access (`access`);
|
|
5
|
-
// Measure → Reads (`reads`),
|
|
5
|
+
// Measure → Reads (`reads`), Prompt tracking (`prompts`, also `questions`), Keyword tracking (`keywords`, or
|
|
6
|
+
// `keywords <topic>` to research one), Pages (`pages`, one page's answers `page`), the posts naming you (`mentions`)
|
|
6
7
|
// and Portrayal (`portrayal`, its claims `claims`: how AI answers describe you), and the live feed of what
|
|
7
8
|
// is reading the phantom sites (`activity`) — the same reads the web app renders. Search Console's
|
|
8
9
|
// property: which ones the connected Google account can read (`properties`) and the one tracked (`property`).
|
|
@@ -40,6 +41,14 @@ export const ARGS = {
|
|
|
40
41
|
list_measure_questions: {
|
|
41
42
|
period: { flag: "period", enum: PERIODS },
|
|
42
43
|
},
|
|
44
|
+
list_seo_opportunities: {
|
|
45
|
+
cluster_id: { flag: "cluster" },
|
|
46
|
+
refresh: { flag: "refresh", type: "bool" },
|
|
47
|
+
country: { flag: "country" },
|
|
48
|
+
},
|
|
49
|
+
research_keywords: {
|
|
50
|
+
topic: { positional: 0, label: "topic", required: true },
|
|
51
|
+
},
|
|
43
52
|
list_cited_pages: {
|
|
44
53
|
period: { flag: "period", enum: PERIODS },
|
|
45
54
|
sites: { flag: "site", type: "list" },
|
|
@@ -104,7 +113,10 @@ export async function cmdInsights(ctx) {
|
|
|
104
113
|
case "reads":
|
|
105
114
|
return call(rest, "get_reads");
|
|
106
115
|
case "questions":
|
|
116
|
+
case "prompts":
|
|
107
117
|
return call(rest, "list_measure_questions");
|
|
118
|
+
case "keywords":
|
|
119
|
+
return rest.positionals.length > 0 ? call(rest, "research_keywords") : call(rest, "list_seo_opportunities");
|
|
108
120
|
case "pages":
|
|
109
121
|
return call(rest, "list_cited_pages");
|
|
110
122
|
case "page":
|
|
@@ -123,7 +135,7 @@ export async function cmdInsights(ctx) {
|
|
|
123
135
|
return call(rest, "select_gsc_property");
|
|
124
136
|
default:
|
|
125
137
|
throw new CliError(
|
|
126
|
-
`Unknown insights subcommand: ${sub ?? "(none)"}. Try: summary, reads,
|
|
138
|
+
`Unknown insights subcommand: ${sub ?? "(none)"}. Try: summary, reads, prompts, keywords [topic], pages, page, mentions, portrayal, claims, competitors, question, detection, activity, site, post, top, bank, access, properties, property`
|
|
127
139
|
);
|
|
128
140
|
}
|
|
129
141
|
}
|
package/lib/commands/usage.mjs
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// letterstory usage import-posthog --project <id> --key <phx_…> [--days 90] [--host app.acme.com]
|
|
7
7
|
// [--feature-urls map.json] [--dry-run] history from your PostHog (import_posthog_usage)
|
|
8
8
|
// letterstory usage posthog connect --project <id> --key <phx_…> [--posthog-host eu.posthog.com] [--host app.acme.com]
|
|
9
|
+
// [--internal-accounts accounts.json] confirmed account IDs for new Proofs suggestions
|
|
9
10
|
// connect PostHog for good: 90 days now, then daily
|
|
10
11
|
// letterstory usage posthog [status]|sync [--days 7]|disconnect the connection (never its key), sync now, remove it
|
|
11
12
|
// letterstory usage case-study [--days 7|30|90] the patterns and the latest case study
|
|
@@ -40,6 +41,12 @@ export const ARGS = {
|
|
|
40
41
|
reset: { flag: "clear-choice", type: "bool" },
|
|
41
42
|
},
|
|
42
43
|
connect_proof_database: {
|
|
44
|
+
known_internal_accounts: {
|
|
45
|
+
value: (flags) =>
|
|
46
|
+
flags["internal-accounts"]
|
|
47
|
+
? JSON.parse(readFileSync(String(flags["internal-accounts"]), "utf8"))
|
|
48
|
+
: undefined,
|
|
49
|
+
},
|
|
43
50
|
project_ref: { flag: "project" },
|
|
44
51
|
host: { flag: "host" },
|
|
45
52
|
access_token: { flag: "key" },
|
|
@@ -62,12 +69,18 @@ export const ARGS = {
|
|
|
62
69
|
focus: { flag: "focus" },
|
|
63
70
|
source: { flag: "source" },
|
|
64
71
|
},
|
|
72
|
+
compare_proof_actions: {
|
|
73
|
+
previous_choice_id: { flag: "previous-choice-id" },
|
|
74
|
+
choice_id: { flag: "choice-id" },
|
|
75
|
+
window: { value: (flags) => ({ since: flags.since, until: flags.until }) },
|
|
76
|
+
},
|
|
65
77
|
refresh_proof_actions: {},
|
|
66
78
|
get_proof_actions: { id: { flag: "id" } },
|
|
67
79
|
decide_proof_action: {
|
|
68
80
|
analysis_id: { flag: "analysis-id" },
|
|
69
81
|
card_id: { flag: "card-id" },
|
|
70
82
|
decision: { flag: "decision" },
|
|
83
|
+
replace_choice_id: { flag: "replace-choice-id" },
|
|
71
84
|
},
|
|
72
85
|
instrument_proof_action: {
|
|
73
86
|
action: { flag: "action" },
|
|
@@ -121,6 +134,12 @@ export const ARGS = {
|
|
|
121
134
|
dry_run: { flag: "dry-run", type: "bool" },
|
|
122
135
|
},
|
|
123
136
|
connect_posthog_usage: {
|
|
137
|
+
known_internal_accounts: {
|
|
138
|
+
value: (flags) =>
|
|
139
|
+
flags["internal-accounts"]
|
|
140
|
+
? JSON.parse(readFileSync(String(flags["internal-accounts"]), "utf8"))
|
|
141
|
+
: undefined,
|
|
142
|
+
},
|
|
124
143
|
project_id: { flag: "project" },
|
|
125
144
|
// --key, or POSTHOG_PERSONAL_API_KEY so the key stays out of the shell's history.
|
|
126
145
|
personal_api_key: {
|
|
@@ -278,9 +297,10 @@ export async function cmdUsage(ctx) {
|
|
|
278
297
|
printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, [])));
|
|
279
298
|
return 0;
|
|
280
299
|
}
|
|
281
|
-
if (["proofs", "find-proofs", "review-proof", "refresh-proofs"].includes(ctx.positionals[0])) {
|
|
300
|
+
if (["proofs", "find-proofs", "review-proof", "refresh-proofs", "compare-proofs"].includes(ctx.positionals[0])) {
|
|
282
301
|
const tool = {
|
|
283
302
|
proofs: "get_proof_actions",
|
|
303
|
+
"compare-proofs": "compare_proof_actions",
|
|
284
304
|
"refresh-proofs": "refresh_proof_actions",
|
|
285
305
|
"find-proofs": "generate_proof_actions",
|
|
286
306
|
"review-proof": "decide_proof_action",
|