pr-shepherd 0.7.0 → 0.7.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
3
  "description": "Autonomous PR CI monitor and review-comment resolver for Claude Code",
4
- "version": "0.7.0",
4
+ "version": "0.7.1",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
package/README.md CHANGED
@@ -190,6 +190,7 @@ On each tick (4-minute default, tunable via `watch.interval`): fetch PR state in
190
190
  ## CLI
191
191
 
192
192
  ```sh
193
+ pr-shepherd -v|--version # print installed version
193
194
  pr-shepherd check [PR] # read-only PR status snapshot
194
195
  pr-shepherd resolve [PR] [--fetch | --resolve-thread-ids …]
195
196
  pr-shepherd iterate [PR] [--cooldown-seconds N] [--ready-delay Nm] [--last-push-time N]
package/bin/cli.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  * CLI argument parsing and subcommand dispatch for pr-shepherd.
3
3
  *
4
4
  * Usage:
5
+ * pr-shepherd --version
5
6
  * pr-shepherd check [PR] [--format text|json] [--no-cache] [--cache-ttl N]
6
7
  * pr-shepherd resolve [PR] [--fetch] [--resolve-thread-ids A,B] [--minimize-comment-ids X,Y]
7
8
  * [--dismiss-review-ids Q] [--message MSG] [--require-sha SHA]
@@ -9,6 +10,7 @@
9
10
  * pr-shepherd iterate [PR] [--format text|json] [--cooldown-seconds N] [--ready-delay Nm] [--last-push-time N]
10
11
  * pr-shepherd status PR1 [PR2 …]
11
12
  */
13
+ import { readFileSync } from "node:fs";
12
14
  import { runCheck } from "./commands/check.mjs";
13
15
  import { runResolveFetch, runResolveMutate } from "./commands/resolve.mjs";
14
16
  import { runIterate, renderResolveCommand } from "./commands/iterate.mjs";
@@ -24,6 +26,10 @@ import { parseCommonArgs, getFlag, hasFlag, parseList, parseStatusPrNumbers, par
24
26
  export async function main(argv) {
25
27
  const args = argv.slice(2); // strip node + script path
26
28
  const subcommand = args[0];
29
+ if (subcommand === "--version" || subcommand === "-v") {
30
+ process.stdout.write(`${readVersion()}\n`);
31
+ return;
32
+ }
27
33
  switch (subcommand) {
28
34
  case "check":
29
35
  await handleCheck(args.slice(1));
@@ -39,11 +45,17 @@ export async function main(argv) {
39
45
  break;
40
46
  default:
41
47
  process.stderr.write(`Unknown subcommand: ${subcommand ?? "(none)"}\n`);
42
- process.stderr.write("Usage: pr-shepherd <check|resolve|iterate|status> [options]\n");
48
+ process.stderr.write("Usage: pr-shepherd <check|resolve|iterate|status> [options]\n" +
49
+ " pr-shepherd --version | -v\n");
43
50
  process.exitCode = 1;
44
51
  return;
45
52
  }
46
53
  }
54
+ function readVersion() {
55
+ const pkgUrl = new URL("../package.json", import.meta.url);
56
+ const pkg = JSON.parse(readFileSync(pkgUrl, "utf8"));
57
+ return pkg.version;
58
+ }
47
59
  // ---------------------------------------------------------------------------
48
60
  // Subcommand handlers
49
61
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for Claude Code",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Ong",