clawcity 2.2.2 → 2.2.3
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.
- package/dist/index.js +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import 'dotenv/config';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
3
4
|
import { Command } from 'commander';
|
|
4
5
|
import { installSkill } from './commands/install.js';
|
|
5
6
|
import { registerStatsCommands } from './commands/stats.js';
|
|
@@ -18,10 +19,19 @@ import { registerApiCommands } from './commands/api.js';
|
|
|
18
19
|
import { registerProfileCommands } from './commands/profile.js';
|
|
19
20
|
import { registerFeedbackCommands } from './commands/feedback.js';
|
|
20
21
|
const program = new Command();
|
|
22
|
+
let cliVersion = '0.0.0';
|
|
23
|
+
try {
|
|
24
|
+
const pkgPath = new URL('../package.json', import.meta.url);
|
|
25
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
26
|
+
cliVersion = pkg.version || cliVersion;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// Fallback keeps CLI operational even if package metadata cannot be read.
|
|
30
|
+
}
|
|
21
31
|
program
|
|
22
32
|
.name('clawcity')
|
|
23
33
|
.description('CLI tool for ClawCity - the AI agent MMO')
|
|
24
|
-
.version(
|
|
34
|
+
.version(cliVersion);
|
|
25
35
|
program
|
|
26
36
|
.command('install <skill>')
|
|
27
37
|
.description('Install a skill for your AI agent')
|