ai-git-tools 2.0.26 → 2.0.27
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/bin/cli.js +12 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -4,21 +4,31 @@
|
|
|
4
4
|
* AI Git Tools CLI
|
|
5
5
|
*
|
|
6
6
|
* AI-powered Git automation for commit messages and PR generation
|
|
7
|
-
*
|
|
7
|
+
* 完全重寫版本基於 scripts/ 原始實現
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Command } from 'commander';
|
|
11
|
+
import { readFileSync } from 'fs';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
import { dirname, join } from 'path';
|
|
11
14
|
import { commitCommand } from '../src/commands/commit.js';
|
|
12
15
|
import { commitAllCommand } from '../src/commands/commit-all.js';
|
|
13
16
|
import { prCommand } from '../src/commands/pr.js';
|
|
14
17
|
import { initCommand } from '../src/commands/init.js';
|
|
15
18
|
|
|
19
|
+
// 讀取 package.json 獲取版本號
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
const packageJson = JSON.parse(
|
|
23
|
+
readFileSync(join(__dirname, '../package.json'), 'utf-8')
|
|
24
|
+
);
|
|
25
|
+
|
|
16
26
|
const program = new Command();
|
|
17
27
|
|
|
18
28
|
program
|
|
19
29
|
.name('ai-git-tools')
|
|
20
30
|
.description('AI-powered Git automation tools')
|
|
21
|
-
.version(
|
|
31
|
+
.version(packageJson.version);
|
|
22
32
|
|
|
23
33
|
// Init 命令
|
|
24
34
|
program
|