@letterstory/cli 0.177.209 → 0.177.210
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 +9 -1
- package/lib/commands/repo.mjs +40 -1
- package/lib/commands/site.mjs +55 -1
- 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.210";
|
|
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;
|
|
@@ -249,6 +249,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
249
249
|
"keys",
|
|
250
250
|
// login: one-link device sign-in instead of the loopback browser flow.
|
|
251
251
|
"device",
|
|
252
|
+
// site screenshot: the whole page, not the first screen.
|
|
253
|
+
"full-page",
|
|
252
254
|
"json",
|
|
253
255
|
// sim seed: make the new seed active; collections it doesn't cover start empty.
|
|
254
256
|
"activate",
|
|
@@ -2082,6 +2084,10 @@ The Site (one model of your whole marketing site, keyed by host and path):
|
|
|
2082
2084
|
Staff: any company's site, no account: what Fix would list, each PR
|
|
2083
2085
|
site suggest <host> --idea <id> | --draft-id <id>... | --pattern <folder> | --item <id> --path <path>
|
|
2084
2086
|
Open PR on a suggestion the Site stores, as one job
|
|
2087
|
+
site screenshot [url] [--run <id>] [--path <p>] [--viewport desktop|phone] [--full-page]
|
|
2088
|
+
A screenshot of a page of your site or a build's preview
|
|
2089
|
+
site speed [url] [--run <id>] [--path <p>] [--viewport mobile|desktop]
|
|
2090
|
+
How fast a page loads now: LCP, CLS, INP, TTFB
|
|
2085
2091
|
|
|
2086
2092
|
Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App opens a PR):
|
|
2087
2093
|
repo repos [--gitlab [--search <text>] [--page n]] Repos the Letter GitHub App can reach (--gitlab: the GitLab
|
|
@@ -2108,6 +2114,7 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
2108
2114
|
automate add --template … --slack-channel <C…>
|
|
2109
2115
|
repo slack-targets Slack channels and people Send to Slack can use, with ids
|
|
2110
2116
|
repo slack-test Post a test into the Send to Slack channel
|
|
2117
|
+
repo slack-delete <Slack message link> Delete a message Letter posted (only Letter's own)
|
|
2111
2118
|
repo start --repo <owner/name> [--gitlab] --instructions <text>|--instructions-file <path|-> [--page <path>]...
|
|
2112
2119
|
[--branch <base>] [--attach <path>]... [--attach-url <name>=<https url>]...
|
|
2113
2120
|
[--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
|
|
@@ -2147,6 +2154,7 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
2147
2154
|
repo delete-secret --repo <owner/name> [--gitlab] --secret <KEY>
|
|
2148
2155
|
Delete one
|
|
2149
2156
|
repo status <run-id> Phase, spend, PR link and Claude's summary
|
|
2157
|
+
repo deploy <PR link | owner/repo#12> | --run <id> Whether a merged pull request is live on the site
|
|
2150
2158
|
repo activity <run-id> [--follow] [--since <iso>] What the sandbox is doing, line by line (--follow: until it stops)
|
|
2151
2159
|
repo say <run-id> <message…> Tell a running build something; it carries on with it
|
|
2152
2160
|
repo list [--status running|succeeded|no_changes|failed|cancelled] [--limit n] [--audit <id>]
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -76,6 +76,13 @@ function issueList(flags) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
const ARGS = {
|
|
79
|
+
get_deploy_status: {
|
|
80
|
+
pull_request: { positional: 0, label: "pull request link or owner/repo#12" },
|
|
81
|
+
run_id: "run",
|
|
82
|
+
},
|
|
83
|
+
delete_slack_message: {
|
|
84
|
+
message: { positional: 0, required: true, label: "Slack message link" },
|
|
85
|
+
},
|
|
79
86
|
start_repo_change: {
|
|
80
87
|
provider,
|
|
81
88
|
repo_owner: { value: (flags) => splitRepo(flags).owner },
|
|
@@ -455,9 +462,13 @@ export async function cmdRepo(ctx) {
|
|
|
455
462
|
return repoSlackTargets(rest);
|
|
456
463
|
case "slack-test":
|
|
457
464
|
return repoSlackTest(rest);
|
|
465
|
+
case "slack-delete":
|
|
466
|
+
return repoSlackDelete(rest);
|
|
467
|
+
case "deploy":
|
|
468
|
+
return repoDeploy(rest);
|
|
458
469
|
default:
|
|
459
470
|
throw new CliError(
|
|
460
|
-
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, install-visitors, sites, set-site, reset-site, secrets, set-secret, delete-secret, status, list, publish, merge, retry, revise, address-reviews, say, cancel, repos, branches, prs, settings, suggestions, slack-targets, slack-test, connect, disconnect`
|
|
471
|
+
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, install-visitors, sites, set-site, reset-site, secrets, set-secret, delete-secret, status, deploy, list, publish, merge, retry, revise, address-reviews, say, cancel, repos, branches, prs, settings, suggestions, slack-targets, slack-test, slack-delete, connect, disconnect`
|
|
461
472
|
);
|
|
462
473
|
}
|
|
463
474
|
}
|
|
@@ -722,6 +733,34 @@ async function repoStatus(ctx) {
|
|
|
722
733
|
return 0;
|
|
723
734
|
}
|
|
724
735
|
|
|
736
|
+
/** `repo deploy <pull request link | owner/repo#12> | --run <id>`: is the merge live on the site. */
|
|
737
|
+
async function repoDeploy(ctx) {
|
|
738
|
+
const { client, flags, io } = ctx;
|
|
739
|
+
refuseUnknownFlags(ctx, ARGS.get_deploy_status);
|
|
740
|
+
const result = await client.callTool(
|
|
741
|
+
"get_deploy_status",
|
|
742
|
+
argsFromFlags(ARGS.get_deploy_status, flags, ctx.positionals)
|
|
743
|
+
);
|
|
744
|
+
printResult(io, flags, result, (r) =>
|
|
745
|
+
[`${r.repo}#${r.pr_number}: ${r.state}`, ` ${r.message}`, r.deploy_url ? ` ${r.deploy_url}` : null]
|
|
746
|
+
.filter(Boolean)
|
|
747
|
+
.join("\n")
|
|
748
|
+
);
|
|
749
|
+
return 0;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/** `repo slack-delete <Slack message link>`: take down a message Letter posted. Only Letter's own. */
|
|
753
|
+
async function repoSlackDelete(ctx) {
|
|
754
|
+
const { client, flags, io } = ctx;
|
|
755
|
+
refuseUnknownFlags(ctx, ARGS.delete_slack_message);
|
|
756
|
+
const result = await client.callTool(
|
|
757
|
+
"delete_slack_message",
|
|
758
|
+
argsFromFlags(ARGS.delete_slack_message, flags, ctx.positionals)
|
|
759
|
+
);
|
|
760
|
+
printResult(io, flags, result, (r) => `Deleted: ${r.text}`);
|
|
761
|
+
return 0;
|
|
762
|
+
}
|
|
763
|
+
|
|
725
764
|
const ACTIVITY_MARK = { progress: "·", stage: "▸", say: "»", think: "◇", tool: "$", user: ">", error: "!" };
|
|
726
765
|
|
|
727
766
|
/** `repo activity <run-id> [--follow] [--since <iso>]`: the build's feed; --follow prints new lines until it stops. */
|
package/lib/commands/site.mjs
CHANGED
|
@@ -58,6 +58,19 @@ function proposalInput(flags) {
|
|
|
58
58
|
|
|
59
59
|
const ARGS = {
|
|
60
60
|
list_sites: {},
|
|
61
|
+
screenshot_page: {
|
|
62
|
+
url: { positional: 0, label: "url" },
|
|
63
|
+
run_id: "run",
|
|
64
|
+
path: "path",
|
|
65
|
+
device: { flag: "viewport", enum: ["desktop", "phone"] },
|
|
66
|
+
full_page: { flag: "full-page", type: "bool" },
|
|
67
|
+
},
|
|
68
|
+
test_page_speed: {
|
|
69
|
+
url: { positional: 0, label: "url" },
|
|
70
|
+
run_id: "run",
|
|
71
|
+
path: "path",
|
|
72
|
+
device: { flag: "viewport", enum: ["mobile", "desktop"] },
|
|
73
|
+
},
|
|
61
74
|
map_site: {
|
|
62
75
|
host: { positional: 0, label: "host" },
|
|
63
76
|
url: "url",
|
|
@@ -298,9 +311,13 @@ export async function cmdSite(ctx) {
|
|
|
298
311
|
return siteProspect(rest);
|
|
299
312
|
case "suggest":
|
|
300
313
|
return siteSuggest(rest);
|
|
314
|
+
case "screenshot":
|
|
315
|
+
return siteScreenshot(rest);
|
|
316
|
+
case "speed":
|
|
317
|
+
return siteSpeed(rest);
|
|
301
318
|
default:
|
|
302
319
|
throw new CliError(
|
|
303
|
-
`Unknown site subcommand: ${sub ?? "(none)"}. Try: list, map, refresh, unmap, tree, facts, builds, metrics, page, observations, observe, dismiss, families, decide-family, proposals, propose, decide, fix, competitors, watch-competitors, highlight, prospect, suggest`
|
|
320
|
+
`Unknown site subcommand: ${sub ?? "(none)"}. Try: list, map, refresh, unmap, tree, facts, builds, metrics, page, observations, observe, dismiss, families, decide-family, proposals, propose, decide, fix, competitors, watch-competitors, highlight, prospect, suggest, screenshot, speed`
|
|
304
321
|
);
|
|
305
322
|
}
|
|
306
323
|
}
|
|
@@ -489,6 +506,43 @@ async function siteUnmap(ctx) {
|
|
|
489
506
|
return 0;
|
|
490
507
|
}
|
|
491
508
|
|
|
509
|
+
/** `site screenshot [url] [--run <id>] [--path /p] [--viewport desktop|phone] [--full-page]`: a picture of the page, as a link. */
|
|
510
|
+
async function siteScreenshot(ctx) {
|
|
511
|
+
const { client, flags, io } = ctx;
|
|
512
|
+
refuseUnknownFlags(ctx, ARGS.screenshot_page);
|
|
513
|
+
const result = await client.callTool(
|
|
514
|
+
"screenshot_page",
|
|
515
|
+
argsFromFlags(ARGS.screenshot_page, flags, ctx.positionals)
|
|
516
|
+
);
|
|
517
|
+
printResult(
|
|
518
|
+
io,
|
|
519
|
+
flags,
|
|
520
|
+
result,
|
|
521
|
+
(r) => `${r.url} (${r.device})\n${r.image_url}\nThe link opens until ${r.expires_at}.`
|
|
522
|
+
);
|
|
523
|
+
return 0;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/** `site speed [url] [--run <id>] [--path /p] [--viewport mobile|desktop]`: how fast the page loads now. */
|
|
527
|
+
async function siteSpeed(ctx) {
|
|
528
|
+
const { client, flags, io } = ctx;
|
|
529
|
+
refuseUnknownFlags(ctx, ARGS.test_page_speed);
|
|
530
|
+
const result = await client.callTool(
|
|
531
|
+
"test_page_speed",
|
|
532
|
+
argsFromFlags(ARGS.test_page_speed, flags, ctx.positionals)
|
|
533
|
+
);
|
|
534
|
+
const n = (v, unit = " ms") => (v === null ? "-" : `${v}${unit}`);
|
|
535
|
+
printResult(io, flags, result, (r) =>
|
|
536
|
+
[
|
|
537
|
+
`${r.url} (${r.device}): performance ${n(r.performance_score, "")}`,
|
|
538
|
+
` LCP ${n(r.lcp_ms)} CLS ${n(r.cls, "")} INP ${n(r.inp_ms)} TTFB ${n(r.ttfb_ms)}`,
|
|
539
|
+
` FCP ${n(r.fcp_ms)} TBT ${n(r.tbt_ms)} Speed Index ${n(r.speed_index_ms)}`,
|
|
540
|
+
...r.opportunities.map((o) => ` · ${o.title}${o.saving ? ` (${o.saving})` : ""}`),
|
|
541
|
+
].join("\n")
|
|
542
|
+
);
|
|
543
|
+
return 0;
|
|
544
|
+
}
|
|
545
|
+
|
|
492
546
|
async function siteFacts(ctx) {
|
|
493
547
|
const { client, flags, io } = ctx;
|
|
494
548
|
refuseUnknownFlags(ctx, ARGS.get_site_facts);
|