@letterstory/cli 0.104.1 → 0.105.0

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.104.1";
63
+ export const VERSION = "0.105.0";
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
@@ -1176,6 +1176,7 @@ The Site (one model of your whole marketing site, keyed by host and path):
1176
1176
  Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub App opens a PR):
1177
1177
  repo repos Repos the Letterstory GitHub App can reach
1178
1178
  repo branches --repo owner/name Branches a change can start from (default first)
1179
+ repo prs [--repo owner/name] Every open PR (whoever opened it), longest-idle first
1179
1180
  repo suggestions Fixes found and not acted on yet, and how to start each
1180
1181
  repo settings [--action build|build_pr|slack] [--branch <name>|none] [--slack-agent <name|U…>|none]
1181
1182
  [--slack-channel <C…>|none]
@@ -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 prs → list_open_pull_requests (every open PR, whoever opened it)
7
8
  // repo install-letterprove → letterprove_open_install_pr
8
9
  // repo suggestions → list_suggested_fixes
9
10
  // repo settings → get_repo_change_settings, or set_repo_change_settings with --action / --branch
@@ -109,6 +110,10 @@ const ARGS = {
109
110
  repo_owner: { value: (flags) => splitRepo(flags).owner },
110
111
  repo_name: { value: (flags) => splitRepo(flags).name },
111
112
  },
113
+ list_open_pull_requests: {
114
+ repo_owner: { value: (flags) => (flags.repo === undefined ? undefined : splitRepo(flags).owner) },
115
+ repo_name: { value: (flags) => (flags.repo === undefined ? undefined : splitRepo(flags).name) },
116
+ },
112
117
  };
113
118
 
114
119
  const TERMINAL = new Set(["succeeded", "no_changes", "failed", "cancelled"]);
@@ -154,6 +159,8 @@ export async function cmdRepo(ctx) {
154
159
  return repoRepos(rest);
155
160
  case "branches":
156
161
  return repoBranches(rest);
162
+ case "prs":
163
+ return repoPrs(rest);
157
164
  case "settings":
158
165
  return repoSettings(rest);
159
166
  case "suggestions":
@@ -164,7 +171,7 @@ export async function cmdRepo(ctx) {
164
171
  return repoSlackTest(rest);
165
172
  default:
166
173
  throw new CliError(
167
- `Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, sites, set-site, reset-site, status, list, publish, cancel, repos, branches, settings, suggestions, slack-targets, slack-test`
174
+ `Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, sites, set-site, reset-site, status, list, publish, cancel, repos, branches, prs, settings, suggestions, slack-targets, slack-test`
168
175
  );
169
176
  }
170
177
  }
@@ -401,6 +408,24 @@ async function repoRepos(ctx) {
401
408
  return 0;
402
409
  }
403
410
 
411
+ /** `repo prs [--repo owner/name]`: every open PR, longest-idle first, and which Letterstory opened. */
412
+ async function repoPrs(ctx) {
413
+ const { client, flags, io } = ctx;
414
+ refuseUnknownFlags(ctx, {}, ["repo"]);
415
+ const result = await client.callTool("list_open_pull_requests", argsFromFlags(ARGS.list_open_pull_requests, flags));
416
+ printResult(io, flags, result, (r) =>
417
+ r.pullRequests.length === 0
418
+ ? "No open pull requests."
419
+ : r.pullRequests
420
+ .map(
421
+ (p) =>
422
+ `${p.repo}#${p.number} ${p.title} (${p.daysSinceUpdate}d idle${p.draft ? ", draft" : ""}${p.letterRun ? `, Letterstory run ${p.letterRun.status}` : ""})\n ${p.url}`
423
+ )
424
+ .join("\n")
425
+ );
426
+ return 0;
427
+ }
428
+
404
429
  /** `repo branches --repo owner/name`: the branches a run can start from, default first. */
405
430
  async function repoBranches(ctx) {
406
431
  const { client, flags, io } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.104.1",
3
+ "version": "0.105.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",