@letterstory/cli 0.177.110 → 0.177.112

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
@@ -91,7 +91,7 @@ import {
91
91
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
92
92
 
93
93
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
94
- export const VERSION = "0.177.110";
94
+ export const VERSION = "0.177.112";
95
95
 
96
96
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
97
97
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -237,6 +237,8 @@ export const BOOLEAN_FLAGS = new Set([
237
237
  "no-modifiers",
238
238
  // site map: do not start an audit for a host that has none.
239
239
  "no-audit",
240
+ // site map: the owner lets Letter crawl past the site's robots.txt.
241
+ "crawl-past-robots",
240
242
  // admin deployments: answer from our rows alone, without reading the host.
241
243
  "no-host",
242
244
  // site metrics: skip the previous window (no deltas, no revamp indicator).
@@ -1957,7 +1959,7 @@ Build (a change to your site, or launching what isn't code; the Build box's own
1957
1959
 
1958
1960
  The Site (one model of your whole marketing site, keyed by host and path):
1959
1961
  site list Mapped hosts, and hosts you already have elsewhere
1960
- site map <host> [--sitemap <url>] [--max-pages <n>] [--no-audit] [--relation owned|watched]
1962
+ site map <host> [--sitemap <url>] [--max-pages <n>] [--no-audit] [--relation owned|watched] [--crawl-past-robots]
1961
1963
  Map a host from its sitemap; starts an audit if it has none
1962
1964
  site refresh <host> [--force-map] [--force-audit] [--skip-observe] [--skip-suggest]
1963
1965
  Run the daily loop now: re-map, re-audit, signals, Jev
@@ -65,6 +65,7 @@ const ARGS = {
65
65
  max_pages: { flag: "max-pages", type: "num" },
66
66
  audit: { flag: "no-audit", type: "bool", invert: true },
67
67
  relation: { flag: "relation", enum: ["owned", "watched"] },
68
+ crawl_past_robots: { flag: "crawl-past-robots", type: "bool" },
68
69
  },
69
70
  refresh_site: {
70
71
  host: { positional: 0, required: true, label: "host" },
@@ -438,6 +438,13 @@ export async function cmdUsage(ctx) {
438
438
  const t = r.totals;
439
439
  const lines = [
440
440
  `${r.app.host ?? "Your app"}, last ${r.days} days: ${t.people} people, ${t.companies} companies, ${t.pages} pages`,
441
+ ...(r.browsers
442
+ ? [` of ${r.browsers.total} browsers since ${r.browsers.since}, ${r.browsers.signed_in} signed in`]
443
+ : []),
444
+ ...r.sources.map(
445
+ (s) =>
446
+ ` ${s.source === "letter" ? "Letter, tracked since" : "PostHog history from"} ${s.first_day}: ${s.people} people`
447
+ ),
441
448
  "",
442
449
  "Features",
443
450
  ...r.features
@@ -10,6 +10,8 @@
10
10
  // letterstory visits citations --since 30d
11
11
  // letterstory visits people --since 30d [--path /pricing] people who read the site, and how many were identified
12
12
  // letterstory visits who --icp [--category Investors] [--path /pricing] who was identified (--icp: who fits your ICP)
13
+ // letterstory visits converts [--event signup] [--days 30] which pages lead to a conversion, by lift
14
+ // letterstory visits retention [--days 90] which features new people used early and came back
13
15
  // letterstory visits export --since 30d --format csv
14
16
  // letterstory visits export --include people --icp > icp.csv the people who fit your ICP, as Humans shows them
15
17
  // letterstory visits sites
@@ -62,6 +64,13 @@ export const ARGS = {
62
64
  },
63
65
  visitors_get_citations: { site_id: "site", days },
64
66
  visitors_get_human_visits: { site_id: "site", days, path: "path" },
67
+ visitors_get_conversions: {
68
+ site_id: "site",
69
+ days,
70
+ event: { flag: "event" },
71
+ limit: { flag: "limit", type: "num" },
72
+ },
73
+ visitors_get_feature_retention: { site_id: "site", days },
65
74
  visitors_get_people: {
66
75
  site_id: "site",
67
76
  days,
@@ -192,6 +201,10 @@ export async function cmdVisits(ctx) {
192
201
  return visitsPeople(rest);
193
202
  case "who":
194
203
  return visitsWho(rest);
204
+ case "converts":
205
+ return visitsConverts(rest);
206
+ case "retention":
207
+ return visitsRetention(rest);
195
208
  case "compare":
196
209
  return visitsCompare(rest);
197
210
  case "export":
@@ -510,6 +523,43 @@ async function visitsWho(ctx) {
510
523
  return 0;
511
524
  }
512
525
 
526
+ async function visitsConverts(ctx) {
527
+ const { flags, io } = ctx;
528
+ const result = await call(ctx, "visitors_get_conversions");
529
+ printResult(io, flags, result, (r) => {
530
+ if (!r.event) return 'No events tracked yet. Add lettervisit("track", "signup") where it happens.';
531
+ const pct = (v) => `${(v * 100).toFixed(1)}%`;
532
+ const lines = [
533
+ `${r.event}: ${r.browsers ? `${r.browsers.converted} of ${r.browsers.total} browsers (${pct(r.browsers.rate)})` : "no browsers"} since ${r.since}`,
534
+ `Events: ${r.events.map((e) => `${e.name} ${e.browsers}`).join(", ")}`,
535
+ "",
536
+ ];
537
+ for (const p of r.pages)
538
+ lines.push(
539
+ ` ${p.path.slice(0, 40).padEnd(42)} ${String(p.viewers).padStart(6)} viewers ${pct(p.rate).padStart(6)} ${p.lift === null ? "" : `${p.lift}x`}`
540
+ );
541
+ return lines.join("\n");
542
+ });
543
+ return 0;
544
+ }
545
+
546
+ async function visitsRetention(ctx) {
547
+ const { flags, io } = ctx;
548
+ const result = await call(ctx, "visitors_get_feature_retention");
549
+ printResult(io, flags, result, (r) => {
550
+ if (!r.features.length) return "Not enough new people yet.";
551
+ const pct = (v) => `${(v * 100).toFixed(0)}%`;
552
+ return [
553
+ `New people since ${r.since}: used early (first ${r.early_days} days) vs not, back by week 3`,
554
+ ...r.features.map(
555
+ (f) =>
556
+ ` ${f.feature.slice(0, 36).padEnd(38)} ${String(f.users).padStart(5)} people ${pct(f.rate).padStart(4)} vs ${pct(f.rate_others).padStart(4)} ${f.lift === null ? "" : `${f.lift}x`}`
557
+ ),
558
+ ].join("\n");
559
+ });
560
+ return 0;
561
+ }
562
+
513
563
  async function visitsCompare(ctx) {
514
564
  const { flags, io } = ctx;
515
565
  const result = await call(ctx, "visitors_compare_agents");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.110",
3
+ "version": "0.177.112",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",