patchrelay 0.5.1 → 0.6.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.
@@ -7,10 +7,10 @@ const fallbackBuildInfo = {
7
7
  commit: "unknown",
8
8
  builtAt: "unknown",
9
9
  };
10
- export function getBuildInfo() {
11
- const buildInfoPath = path.resolve(process.cwd(), "dist/build-info.json");
12
- const fallbackPath = getBundledAssetPath("dist/build-info.json");
13
- const resolvedPath = existsSync(buildInfoPath) ? buildInfoPath : fallbackPath;
10
+ export function getBuildInfo(paths) {
11
+ const fallbackPath = paths?.bundledPath ?? getBundledAssetPath("dist/build-info.json");
12
+ const cwdBuildInfoPath = paths?.cwdPath ?? path.resolve(process.cwd(), "dist/build-info.json");
13
+ const resolvedPath = existsSync(fallbackPath) ? fallbackPath : cwdBuildInfoPath;
14
14
  if (!existsSync(resolvedPath)) {
15
15
  return fallbackBuildInfo;
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.5.1",
4
- "commit": "f9af41f91077",
5
- "builtAt": "2026-03-13T13:10:49.667Z"
3
+ "version": "0.6.1",
4
+ "commit": "dbfd3577f1dc",
5
+ "builtAt": "2026-03-13T13:28:48.369Z"
6
6
  }
package/dist/cli/args.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export const KNOWN_COMMANDS = new Set([
2
+ "version",
2
3
  "serve",
3
4
  "inspect",
4
5
  "live",
package/dist/cli/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { loadConfig } from "../config.js";
2
+ import { getBuildInfo } from "../build-info.js";
2
3
  import { runPreflight } from "../preflight.js";
3
4
  import { assertKnownFlags, parseArgs, resolveCommand } from "./args.js";
4
5
  import { handleConnectCommand, handleInstallationsCommand } from "./commands/connect.js";
@@ -39,6 +40,7 @@ function helpText() {
39
40
  " upserts the repo config and reuses or starts the Linear connection flow.",
40
41
  "",
41
42
  "Commands:",
43
+ " version [--json] Show the installed PatchRelay build version",
42
44
  " init <public-base-url> [--force] [--json] Bootstrap the machine-level PatchRelay home",
43
45
  " project apply <id> <repo-path> [--issue-prefix <prefixes>] [--team-id <ids>] [--no-connect] [--no-open] [--timeout <seconds>] [--json]",
44
46
  " Upsert one local repository and connect it to Linear when ready",
@@ -67,6 +69,8 @@ function helpText() {
67
69
  }
68
70
  function getCommandConfigProfile(command) {
69
71
  switch (command) {
72
+ case "version":
73
+ return "service";
70
74
  case "doctor":
71
75
  case "install-service":
72
76
  return "doctor";
@@ -89,6 +93,9 @@ function getCommandConfigProfile(command) {
89
93
  }
90
94
  function validateFlags(command, commandArgs, parsed) {
91
95
  switch (command) {
96
+ case "version":
97
+ assertKnownFlags(parsed, command, ["json"]);
98
+ return;
92
99
  case "help":
93
100
  case "serve":
94
101
  assertKnownFlags(parsed, command, []);
@@ -164,15 +171,20 @@ export async function runCli(argv, options) {
164
171
  writeOutput(stderr, `${error instanceof Error ? error.message : String(error)}\n`);
165
172
  return 1;
166
173
  }
174
+ const json = parsed.flags.get("json") === true;
167
175
  if (command === "help") {
168
176
  writeOutput(stdout, `${helpText()}\n`);
169
177
  return 0;
170
178
  }
179
+ if (command === "version") {
180
+ const buildInfo = getBuildInfo();
181
+ writeOutput(stdout, json ? formatJson(buildInfo) : `${buildInfo.version}\n`);
182
+ return 0;
183
+ }
171
184
  if (command === "serve") {
172
185
  return -1;
173
186
  }
174
187
  const runInteractive = options?.runInteractive ?? runInteractiveCommand;
175
- const json = parsed.flags.get("json") === true;
176
188
  if (command === "init") {
177
189
  return await handleInitCommand({
178
190
  commandArgs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {