From 8c185d7512c7f632f5ae9e663e4b441e42d86948 Mon Sep 17 00:00:00 2001 From: Manuel Salcedo Date: Sun, 7 Jun 2026 23:29:23 -0600 Subject: [PATCH] fix(cli): support version flag --- .changeset/cli-version-flag.md | 5 +++++ src/cli/index.ts | 2 ++ tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 .changeset/cli-version-flag.md diff --git a/.changeset/cli-version-flag.md b/.changeset/cli-version-flag.md new file mode 100644 index 0000000..b825de6 --- /dev/null +++ b/.changeset/cli-version-flag.md @@ -0,0 +1,5 @@ +--- +"mcp-handler": patch +--- + +Add `--version` support to the published CLI binaries. diff --git a/src/cli/index.ts b/src/cli/index.ts index e3d27ca..d65bd49 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -4,6 +4,7 @@ import { Command } from "commander"; import fs from "node:fs/promises"; import path from "node:path"; import chalk from "chalk"; +import packageJson from "../../package.json"; const program = new Command(); @@ -127,6 +128,7 @@ async function init() { program .name("mcp-handler") .description("Initialize MCP route handler in your Next.js project") + .version(packageJson.version) .action(init); program.parse(); diff --git a/tsconfig.json b/tsconfig.json index da55d8d..8532f2b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "declaration": true, "outDir": "./dist", "esModuleInterop": true, + "resolveJsonModule": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true