@letterstory/cli 0.99.0 → 0.100.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 +2 -1
- package/lib/commands/repo.mjs +19 -2
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
} from "./commands.mjs";
|
|
60
60
|
|
|
61
61
|
// Keep in sync with cli/package.json.
|
|
62
|
-
export const VERSION = "0.
|
|
62
|
+
export const VERSION = "0.100.0";
|
|
63
63
|
|
|
64
64
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
65
65
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
@@ -1118,6 +1118,7 @@ Insights:
|
|
|
1118
1118
|
|
|
1119
1119
|
Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub App opens a PR):
|
|
1120
1120
|
repo repos Repos the Letterstory GitHub App can reach
|
|
1121
|
+
repo branches --repo owner/name Branches a change can start from (default first)
|
|
1121
1122
|
repo start --repo <owner/name> --instructions <text>|--instructions-file <path|->
|
|
1122
1123
|
[--branch <base>] [--attach <path>]... [--attach-url <name>=<https url>]... [--wait]
|
|
1123
1124
|
Start a change (attached files go to the sandbox);
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// pull request by the Letterstory GitHub App (src/lib/repo-changes). One subcommand per tool:
|
|
3
3
|
// repo start → start_repo_change repo status → get_repo_change
|
|
4
4
|
// repo list → list_repo_changes repo cancel → cancel_repo_change
|
|
5
|
-
// repo repos → list_github_app_repos
|
|
5
|
+
// repo repos → list_github_app_repos repo branches → list_repo_branches
|
|
6
6
|
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
8
|
import { basename } from "node:path";
|
|
@@ -64,6 +64,10 @@ const ARGS = {
|
|
|
64
64
|
audit_id: "audit",
|
|
65
65
|
},
|
|
66
66
|
list_github_app_repos: {},
|
|
67
|
+
list_repo_branches: {
|
|
68
|
+
repo_owner: { value: (flags) => splitRepo(flags).owner },
|
|
69
|
+
repo_name: { value: (flags) => splitRepo(flags).name },
|
|
70
|
+
},
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
const TERMINAL = new Set(["succeeded", "no_changes", "failed", "cancelled"]);
|
|
@@ -100,9 +104,11 @@ export async function cmdRepo(ctx) {
|
|
|
100
104
|
return repoCancel(rest);
|
|
101
105
|
case "repos":
|
|
102
106
|
return repoRepos(rest);
|
|
107
|
+
case "branches":
|
|
108
|
+
return repoBranches(rest);
|
|
103
109
|
default:
|
|
104
110
|
throw new CliError(
|
|
105
|
-
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, sites, set-site, reset-site, status, list, cancel, repos`
|
|
111
|
+
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, sites, set-site, reset-site, status, list, cancel, repos, branches`
|
|
106
112
|
);
|
|
107
113
|
}
|
|
108
114
|
}
|
|
@@ -302,4 +308,15 @@ async function repoRepos(ctx) {
|
|
|
302
308
|
return 0;
|
|
303
309
|
}
|
|
304
310
|
|
|
311
|
+
/** `repo branches --repo owner/name`: the branches a run can start from, default first. */
|
|
312
|
+
async function repoBranches(ctx) {
|
|
313
|
+
const { client, flags, io } = ctx;
|
|
314
|
+
refuseUnknownFlags(ctx, {}, ["repo", "owner", "name"]);
|
|
315
|
+
const result = await client.callTool("list_repo_branches", argsFromFlags(ARGS.list_repo_branches, flags));
|
|
316
|
+
printResult(io, flags, result, (r) =>
|
|
317
|
+
r.branches.map((b) => (b === r.defaultBranch ? `${b} (default)` : b)).join("\n")
|
|
318
|
+
);
|
|
319
|
+
return 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
305
322
|
export { ARGS };
|