fix(cli): dynamically read version from package.json

This commit is contained in:
redshift
2026-04-25 22:12:08 +05:30
parent 30f71d42a8
commit 51c80c6d3d
+2 -3
View File
@@ -30,6 +30,7 @@ import {
isCocodInstalled,
resolveCocodExecutable,
} from "./daemon/wallet/cocod-client";
import packageJson from "../package.json" with { type: "json" };
type RoutstrModel = {
id: string;
@@ -52,8 +53,6 @@ type UsageEntry = {
client?: string;
};
const cliVersion = "0.1.1";
function parsePositiveIntOrExit(value: string, fieldName: string): number {
const parsed = Number.parseInt(value, 10);
if (!Number.isFinite(parsed) || parsed <= 0) {
@@ -209,7 +208,7 @@ async function initDaemon(): Promise<void> {
program
.name("routstrd")
.description("Routstr daemon - Manage routstr processes")
.version(cliVersion, "--version", "output the version number");
.version(packageJson.version, "--version", "output the version number");
// Onboard - initialize the daemon
program