Skip to content

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

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

Viet Tran6678e96b7b28
diff --git a/cli/package.json b/cli/package.json
index 3f86dd0..415a5be 100644
--- a/cli/package.json
+++ b/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "uipro-cli",
- "version": "2.0.0",
+ "version": "2.1.0",
"description": "CLI to install UI/UX Pro Max skill for AI coding assistants",
"type": "module",
"bin": {
diff --git a/cli/src/index.ts b/cli/src/index.ts
index 87225ea..bce2498 100644
--- a/cli/src/index.ts
+++ b/cli/src/index.ts
@@ -1,18 +1,25 @@
#!/usr/bin/env node
import { Command } from 'commander';
+import { readFileSync } from 'fs';
+import { fileURLToPath } from 'url';
+import { dirname, join } from 'path';
import { initCommand } from './commands/init.js';
import { versionsCommand } from './commands/versions.js';
import { updateCommand } from './commands/update.js';
import type { AIType } from './types/index.js';
import { AI_TYPES } from './types/index.js';
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
+
const program = new Command();
program
.name('uipro')
.description('CLI to install UI/UX Pro Max skill for AI coding assistants')
- .version('1.9.0');
+ .version(pkg.version);
program
.command('init')