@letterstory/cli 0.176.35 → 0.176.37

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 CHANGED
@@ -83,7 +83,7 @@ import {
83
83
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
84
84
 
85
85
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
86
- export const VERSION = "0.176.35";
86
+ export const VERSION = "0.176.37";
87
87
 
88
88
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
89
89
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -99,6 +99,8 @@ export const BOOLEAN_FLAGS = new Set([
99
99
  "wait",
100
100
  // automations set: stop reading a data feed.
101
101
  "no-reads",
102
+ // automations add|set --reads: leave out records the feed only changed.
103
+ "new-only",
102
104
  // vary start: pause the test running on the page first.
103
105
  "pause-running",
104
106
  // bench run: the spec was just changed.
@@ -605,13 +607,15 @@ Reviewers:
605
607
  automations dismiss <topic-id> --collection <id> Set one subject aside
606
608
  automations add topic|series|signal|best --collection <id> [--topic <id>] [--goal <target-id>]
607
609
  [--seer <id>] [--pace <n> | --on "fri 09:00 America/New_York"] [--brief <text>]
608
- [--reads <seer-id> [--window <days>]] [--new-topic <name>] [--new-series <name>]
610
+ [--reads <seer-id> [--window <days>] [--new-only]] [--new-topic <name>] [--new-series <name>]
609
611
  Add one (refused if it says the same as another).
610
612
  --on pins it: one post a week, on that day and time
611
613
  --reads: a data feed (a data_feed seer) whose records in
612
614
  the window before each post are the post's own data
615
+ --new-only: only records the feed dates in the window,
616
+ not ones it merely changed (a price, a flag)
613
617
  automations set <automation-id> --collection <id> [--pace <n> | --on "<day> <HH:MM> <tz>" | --unpin]
614
- [--reads <seer-id> [--window <days>] | --no-reads]
618
+ [--reads <seer-id> [--window <days>] [--new-only] | --no-reads]
615
619
  [--pause | --resume] [--goal <id>] [--brief <text>] [--remap]
616
620
  automations remove <automation-id> --collection <id>
617
621
  automate options What an automation can be made of here: the triggers,
@@ -1687,6 +1691,9 @@ Insights:
1687
1691
  insights question <key> [--period 14d|30d|90d] [--filter all|named_you|rival_not_you|no_one] [--limit n]
1688
1692
  One By-question row: the wordings asked and the AI answers
1689
1693
  insights detection How your brand is detected in AI answers (terms, who set them)
1694
+ insights properties Search Console properties the connected Google account can read, the
1695
+ unverified ones, and the one tracked
1696
+ insights property <site-url> Pick the Search Console property to track (a key minted by an admin)
1690
1697
  insights site [--period 14d|30d|90d] [--collection <uuid>]
1691
1698
  insights post <article-id> [--period 14d|30d|90d]
1692
1699
  insights top [--period 14d|30d|90d] [--collection <uuid>] [--limit <n>] [--sort clicks|impressions]
@@ -26,6 +26,7 @@ export function parsePublishAt(text) {
26
26
  /**
27
27
  * `--reads <seer-id> [--window <days>]` → { seer_id, window_days } (the tool's `reads`): a data
28
28
  * feed the automation reads, the window ending at each post's publish instant (7 days unless set).
29
+ * `--new-only` adds include_changed: false (records the feed only changed never count).
29
30
  * `--no-reads` sends null (stop reading one).
30
31
  */
31
32
  export function parseReads(flags) {
@@ -33,12 +34,13 @@ export function parseReads(flags) {
33
34
  const seer = flagStr(flags.reads);
34
35
  if (seer === undefined) {
35
36
  if (flags.window !== undefined) throw new CliError("--window goes with --reads <seer-id>");
37
+ if (flags["new-only"] === true) throw new CliError("--new-only goes with --reads <seer-id>");
36
38
  return undefined;
37
39
  }
38
40
  const days = flags.window === undefined ? 7 : Number(flags.window);
39
41
  if (!Number.isInteger(days) || days < 1)
40
42
  throw new CliError("--window takes a whole number of days, e.g. --window 7");
41
- return { seer_id: seer, window_days: days };
43
+ return { seer_id: seer, window_days: days, ...(flags["new-only"] === true ? { include_changed: false } : {}) };
42
44
  }
43
45
 
44
46
  /** See `argsFromFlags` in shared.mjs; `scripts/parity-check.ts` diffs these keys against the tool. */
@@ -3,7 +3,8 @@
3
3
  // insights.ts); plus Measure's Overview (`summary`), GEO → Competitors
4
4
  // (`competitors`), AI Visibility Bank (`bank`) and phantom Page Access (`access`);
5
5
  // Measure → Reads (`reads`), Questions (`questions`), Pages (`pages`, one page's answers `page`) and the posts naming you (`mentions`), and the live feed of what
6
- // is reading the phantom sites (`activity`) — the same reads the web app renders.
6
+ // is reading the phantom sites (`activity`) — the same reads the web app renders. Search Console's
7
+ // property: which ones the connected Google account can read (`properties`) and the one tracked (`property`).
7
8
 
8
9
  import { CliError } from "../client.mjs";
9
10
  import { flagStr, flagNum, requirePositional, printResult, compact, argsFromFlags } from "./shared.mjs";
@@ -56,6 +57,10 @@ export const ARGS = {
56
57
  phantom_id: { flag: "phantom" },
57
58
  limit: { flag: "limit", type: "num" },
58
59
  },
60
+ list_gsc_properties: {},
61
+ select_gsc_property: {
62
+ site_url: { positional: 0, label: "site-url", required: true },
63
+ },
59
64
  get_share_of_voice_question: {
60
65
  question_key: { positional: 0, label: "question-key", required: true },
61
66
  period: { flag: "period", enum: PERIODS },
@@ -98,9 +103,13 @@ export async function cmdInsights(ctx) {
98
103
  return call(rest, "list_site_mentions");
99
104
  case "activity":
100
105
  return call(rest, "get_recent_activity");
106
+ case "properties":
107
+ return call(rest, "list_gsc_properties");
108
+ case "property":
109
+ return call(rest, "select_gsc_property");
101
110
  default:
102
111
  throw new CliError(
103
- `Unknown insights subcommand: ${sub ?? "(none)"}. Try: summary, reads, questions, pages, page, mentions, competitors, question, detection, activity, site, post, top, bank, access`
112
+ `Unknown insights subcommand: ${sub ?? "(none)"}. Try: summary, reads, questions, pages, page, mentions, competitors, question, detection, activity, site, post, top, bank, access, properties, property`
104
113
  );
105
114
  }
106
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.35",
3
+ "version": "0.176.37",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",