@letterstory/cli 0.101.1 → 0.102.1

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
@@ -60,7 +60,7 @@ import {
60
60
  } from "./commands.mjs";
61
61
 
62
62
  // Keep in sync with cli/package.json.
63
- export const VERSION = "0.101.1";
63
+ export const VERSION = "0.102.1";
64
64
 
65
65
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
66
66
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
@@ -400,7 +400,7 @@ Flows:
400
400
 
401
401
  Connectors:
402
402
  connectors list List external publish destinations
403
- connectors publish <article-id> --to <connector> --target <uuid> [--flow-run <uuid>]
403
+ connectors publish <article-id> --to <connector> --target <uuid>
404
404
  [--confirm-missing-target] re-publish even though
405
405
  the item was deleted/unpublished on the provider
406
406
  connectors status --connector <connector> --publish-id <id>
@@ -1152,12 +1152,16 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
1152
1152
  repo fix-audit --issue <issue-type> [--audit <id>] [--branch <base>] [--preview] [--wait]
1153
1153
  One PR fixing a site-audit issue on every affected page,
1154
1154
  in the repo verified to build the site
1155
+ repo install-letterprove --repo <owner/name> [--branch <base>] [--wait]
1156
+ One PR adding Letterprove's script and identify calls
1157
+ (pick the repo where users sign in)
1155
1158
  repo sites [--detect [--force]] Which website each repo builds, and the evidence
1156
1159
  repo set-site --repo <owner/name> --site <host> [--not]
1157
1160
  Say which site a repo builds (--not: correct a wrong label)
1158
1161
  repo reset-site --repo <owner/name> --site <host> Back to automatic detection
1159
1162
  repo status <run-id> Phase, spend, PR link and Claude's summary
1160
1163
  repo list [--status running|succeeded|no_changes|failed|cancelled] [--limit n] [--audit <id>]
1164
+ [--source site_audit_issue|site_quick_check|letterprove_install]
1161
1165
  repo publish <run-id> Make PR on a preview in review
1162
1166
  repo cancel <run-id> Stop it and delete the sandbox; no PR (Discard a preview)
1163
1167
 
@@ -16,7 +16,6 @@ export const ARGS = {
16
16
  article_id: { positional: 0, label: "article-id", required: true },
17
17
  connector: { flag: "to", required: true, enum: PUBLISH_CONNECTORS },
18
18
  target_id: { flag: "target", required: true },
19
- flow_run_id: "flow-run",
20
19
  // A re-publish whose external item was deleted or unpublished in the client's CMS
21
20
  // is refused, and the refusal explains itself. --confirm-missing-target is the
22
21
  // answer to that specific question: it re-creates / re-publishes the item there.
@@ -1,6 +1,6 @@
1
- // `flows` — manage the flow_run.completed completion webhook. list/run/status
2
- // (Enhance flow authoring + running) are retired along with the rest of that UI;
3
- // see docs/architecture/enhance-flows-retirement.md for the removal. get_webhook/set_webhook are untouched —
1
+ // `flows webhook` — manage the API key's webhook destination (article.published, article.finished).
2
+ // list/run/status (Enhance flow authoring + running) are retired and the flow tables dropped;
3
+ // see docs/architecture/enhance-flows-retirement.md. get_webhook/set_webhook are untouched —
4
4
  // they configure a webhook on the API key, not an Enhance flow.
5
5
 
6
6
  import { CliError } from "../client.mjs";
@@ -4,6 +4,7 @@
4
4
  // repo list → list_repo_changes repo cancel → cancel_repo_change
5
5
  // repo publish → publish_repo_change (Make PR on a preview)
6
6
  // repo repos → list_github_app_repos repo branches → list_repo_branches
7
+ // repo install-letterprove → letterprove_open_install_pr
7
8
 
8
9
  import { readFileSync } from "node:fs";
9
10
  import { basename } from "node:path";
@@ -59,6 +60,11 @@ const ARGS = {
59
60
  base_branch: "branch",
60
61
  preview: { flag: "preview", type: "bool" },
61
62
  },
63
+ letterprove_open_install_pr: {
64
+ repo_owner: { value: (flags) => splitRepo(flags).owner },
65
+ repo_name: { value: (flags) => splitRepo(flags).name },
66
+ base_branch: "branch",
67
+ },
62
68
  get_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
63
69
  cancel_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
64
70
  publish_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
@@ -66,6 +72,7 @@ const ARGS = {
66
72
  status: { flag: "status", enum: ["running", "succeeded", "no_changes", "failed", "cancelled"] },
67
73
  limit: { flag: "limit", type: "num" },
68
74
  audit_id: "audit",
75
+ source_kind: { flag: "source", enum: ["site_audit_issue", "site_quick_check", "letterprove_install"] },
69
76
  },
70
77
  list_github_app_repos: {},
71
78
  list_repo_branches: {
@@ -99,6 +106,8 @@ export async function cmdRepo(ctx) {
99
106
  return repoStatus(rest);
100
107
  case "fix-audit":
101
108
  return repoFixAudit(rest);
109
+ case "install-letterprove":
110
+ return repoInstallLetterprove(rest);
102
111
  case "sites":
103
112
  return repoSites(rest);
104
113
  case "set-site":
@@ -117,7 +126,7 @@ export async function cmdRepo(ctx) {
117
126
  return repoBranches(rest);
118
127
  default:
119
128
  throw new CliError(
120
- `Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, sites, set-site, reset-site, status, list, publish, cancel, repos, branches`
129
+ `Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, sites, set-site, reset-site, status, list, publish, cancel, repos, branches`
121
130
  );
122
131
  }
123
132
  }
@@ -239,6 +248,22 @@ async function repoFixAudit(ctx) {
239
248
  return followRun(ctx, result.run);
240
249
  }
241
250
 
251
+ /** `repo install-letterprove --repo owner/name [--branch b] [--wait]`: Letterprove's script + identify calls → one PR. */
252
+ async function repoInstallLetterprove(ctx) {
253
+ const { client, flags, io } = ctx;
254
+ refuseUnknownFlags(ctx, {}, ["repo", "owner", "name", "branch", "wait"]);
255
+ const result = await client.callTool(
256
+ "letterprove_open_install_pr",
257
+ argsFromFlags(ARGS.letterprove_open_install_pr, flags, ctx.positionals)
258
+ );
259
+ ok(ctx, result.message);
260
+ if (!flags.wait) {
261
+ printResult(io, flags, result.run, describe);
262
+ return 0;
263
+ }
264
+ return followRun(ctx, result.run);
265
+ }
266
+
242
267
  /** `repo sites [--detect] [--force]`: which website each repo builds, and why. */
243
268
  async function repoSites(ctx) {
244
269
  const { client, flags, io } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.101.1",
3
+ "version": "0.102.1",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",