// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import { readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

import type { Command } from 'commander';

export function registerVersionCommand(program: Command): void {
  program
    .command('version')
    .description('Print the installed version')
    .action(() => {
      const packageJsonPath = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json');
      const { version } = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as { version: string };
      console.log(version);
    });
}
