@letterstory/cli 0.176.44 → 0.176.45
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 +2 -1
- package/lib/commands/visits.mjs +28 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
85
85
|
|
|
86
86
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
87
|
-
export const VERSION = "0.176.
|
|
87
|
+
export const VERSION = "0.176.45";
|
|
88
88
|
|
|
89
89
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
90
90
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1853,6 +1853,7 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
1853
1853
|
Pages one agent read that the other didn't
|
|
1854
1854
|
visits export [--since 30d] [--format json|csv] [--table agent_visits|citations]
|
|
1855
1855
|
visits sites Your Visitors sites and their install checks
|
|
1856
|
+
visits domain <domain> [--site <id>] [--name <n>] Move a site to a new domain, keeping its key
|
|
1856
1857
|
visits pages [--since 28d] [--path '/docs/*'] [--agent <id>] [--limit <n>] [--site <id>]
|
|
1857
1858
|
People and AI agents per page
|
|
1858
1859
|
visits health --site <id> Staff: how far to trust a site's numbers, each check and its fix
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// letterstory visits people --since 30d people who read the site, and how many were identified
|
|
12
12
|
// letterstory visits export --since 30d --format csv
|
|
13
13
|
// letterstory visits sites
|
|
14
|
+
// letterstory visits domain composal.com [--site <id>] move the site to a new domain, keeping its key
|
|
14
15
|
// letterstory visits pages --since 28d [--path '/docs/*'] [--agent openai-crawler]
|
|
15
16
|
// letterstory visits health --site <id> staff: how far to trust a site's numbers, and what to fix
|
|
16
17
|
// letterstory visits connect vercel|cloudflare send the host's request logs (no code to deploy)
|
|
@@ -26,6 +27,11 @@ const days = { value: (flags) => sinceDays(flags.since) };
|
|
|
26
27
|
|
|
27
28
|
export const ARGS = {
|
|
28
29
|
visitors_list_sites: {},
|
|
30
|
+
visitors_update_site: {
|
|
31
|
+
site_id: "site",
|
|
32
|
+
domain: { positional: 0, label: "new domain (e.g. acme.com)", required: true },
|
|
33
|
+
name: "name",
|
|
34
|
+
},
|
|
29
35
|
visitors_get_agent_visits: {
|
|
30
36
|
site_id: "site",
|
|
31
37
|
days,
|
|
@@ -99,6 +105,8 @@ export async function cmdVisits(ctx) {
|
|
|
99
105
|
return visitsExport(rest);
|
|
100
106
|
case "sites":
|
|
101
107
|
return visitsSites(rest);
|
|
108
|
+
case "domain":
|
|
109
|
+
return visitsDomain(rest);
|
|
102
110
|
case "pages":
|
|
103
111
|
return visitsPages(rest);
|
|
104
112
|
case "health":
|
|
@@ -111,7 +119,7 @@ export async function cmdVisits(ctx) {
|
|
|
111
119
|
return visitsDisconnect(rest);
|
|
112
120
|
default:
|
|
113
121
|
throw new CliError(
|
|
114
|
-
"Usage: visits [list|citations|people|compare|export|sites|pages|health|connect|connectors|disconnect]"
|
|
122
|
+
"Usage: visits [list|citations|people|compare|export|sites|domain|pages|health|connect|connectors|disconnect]"
|
|
115
123
|
);
|
|
116
124
|
}
|
|
117
125
|
}
|
|
@@ -359,6 +367,25 @@ async function visitsPages(ctx) {
|
|
|
359
367
|
return 0;
|
|
360
368
|
}
|
|
361
369
|
|
|
370
|
+
async function visitsDomain(ctx) {
|
|
371
|
+
const { flags, io } = ctx;
|
|
372
|
+
const result = await call(ctx, "visitors_update_site");
|
|
373
|
+
printResult(io, flags, result, (r) => {
|
|
374
|
+
const domain = r.site?.domain ?? "";
|
|
375
|
+
if (!r.changed) return `Already on ${domain}.`;
|
|
376
|
+
const check = r.verification;
|
|
377
|
+
return [
|
|
378
|
+
`Moved ${r.previous_domain ?? "the site"} to ${domain}; the key stays ${r.site?.key ?? ""}.`,
|
|
379
|
+
check
|
|
380
|
+
? check.found
|
|
381
|
+
? `Proven: the script was found on ${check.checked_url ?? domain}.`
|
|
382
|
+
: `Not proven yet: ${check.reason}`
|
|
383
|
+
: "Same site: its proof carried over.",
|
|
384
|
+
].join("\n");
|
|
385
|
+
});
|
|
386
|
+
return 0;
|
|
387
|
+
}
|
|
388
|
+
|
|
362
389
|
async function visitsSites(ctx) {
|
|
363
390
|
const { flags, io } = ctx;
|
|
364
391
|
const result = await call(ctx, "visitors_list_sites");
|