ai-git-tools 1.0.5 → 2.0.0

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 CHANGED
@@ -4,14 +4,13 @@
4
4
  * AI Git Tools CLI
5
5
  *
6
6
  * AI-powered Git automation for commit messages and PR generation
7
+ * 完全重写版本基于 scripts/ 原始实现
7
8
  */
8
9
 
9
10
  import { Command } from 'commander';
10
- import chalk from 'chalk';
11
11
  import { commitCommand } from '../src/commands/commit.js';
12
12
  import { commitAllCommand } from '../src/commands/commit-all.js';
13
13
  import { prCommand } from '../src/commands/pr.js';
14
- import { workflowCommand } from '../src/commands/workflow.js';
15
14
  import { initCommand } from '../src/commands/init.js';
16
15
 
17
16
  const program = new Command();
@@ -19,68 +18,48 @@ const program = new Command();
19
18
  program
20
19
  .name('ai-git-tools')
21
20
  .description('AI-powered Git automation tools')
22
- .version('1.0.5');
21
+ .version('2.0.0');
23
22
 
24
23
  // Init 命令
25
24
  program
26
25
  .command('init')
27
- .description('初始化配置檔案')
26
+ .description('初始化配置文件 (.ai-git-config.mjs)')
28
27
  .action(initCommand);
29
28
 
30
29
  // Commit 命令
31
30
  program
32
31
  .command('commit')
33
- .description('為已 staged 的變更生成並執行 commit')
34
- .option('-m, --model <model>', '指定 AI 模型')
35
- .option('-v, --verbose', '顯示詳細輸出')
36
- .option('--max-diff <number>', '最大 diff 長度', parseInt)
37
- .option('--max-retries <number>', '最大重試次數', parseInt)
32
+ .description('AI 自动生成 commit message 并提交')
33
+ .option('--model <model>', '指定 AI 模型')
34
+ .option('-v, --verbose', '显示详细输出')
35
+ .option('--max-diff <number>', '最大 diff 长度')
36
+ .option('--max-retries <number>', '最大重试次数')
38
37
  .action(commitCommand);
39
38
 
40
39
  // Commit All 命令
41
40
  program
42
41
  .command('commit-all')
43
- .alias('ca')
44
- .description('智能分析所有變更並自動分組提交')
45
- .option('-m, --model <model>', '指定 AI 模型')
46
- .option('-v, --verbose', '顯示詳細輸出')
47
- .option('--max-diff <number>', '最大 diff 長度', parseInt)
48
- .option('--max-retries <number>', '最大重試次數', parseInt)
42
+ .description('智能分析所有变更并自动分组提交')
43
+ .option('--model <model>', '指定 AI 模型')
44
+ .option('-v, --verbose', '显示详细输出')
45
+ .option('--max-diff <number>', '最大 diff 长度')
46
+ .option('--max-retries <number>', '最大重试次数')
49
47
  .action(commitAllCommand);
50
48
 
51
49
  // PR 命令
52
50
  program
53
51
  .command('pr')
54
- .description('生成 PR 並發送到 GitHub')
55
- .option('-b, --base <branch>', '目標分支')
56
- .option('-h, --head <branch>', '來源分支')
57
- .option('-m, --model <model>', '指定 AI 模型')
58
- .option('--draft', '創建草稿 PR')
59
- .option('--preview', '僅預覽,不創建 PR')
60
- .option('--no-confirm', '跳過確認直接創建')
61
- .option('--auto-reviewers', '自動選擇 reviewers')
62
- .option('--auto-labels', '自動添加 Labels')
52
+ .description('AI 自动生成 PR 并创建 Pull Request')
53
+ .option('--base <branch>', '指定目标分支')
54
+ .option('--head <branch>', '指定来源分支')
55
+ .option('--model <model>', '指定 AI 模型')
56
+ .option('--org <org-name>', '指定 GitHub 组织名称')
57
+ .option('--draft', '创建草稿 PR')
58
+ .option('--preview', '仅预览 PR 内容,不实际创建')
59
+ .option('--no-confirm', '跳过确认直接创建')
60
+ .option('--auto-reviewers', '自动选择 reviewers')
61
+ .option('--auto-labels', '自动添加 Labels')
63
62
  .option('--no-labels', '不添加 Labels')
64
- .option('--org <name>', 'GitHub 組織名稱')
65
63
  .action(prCommand);
66
64
 
67
- // Workflow 命令
68
- program
69
- .command('workflow')
70
- .alias('wf')
71
- .description('完整工作流程:commit-all + pr')
72
- .option('-m, --model <model>', '指定 AI 模型')
73
- .option('-v, --verbose', '顯示詳細輸出')
74
- .option('-b, --base <branch>', 'PR 目標分支')
75
- .option('--draft', '創建草稿 PR')
76
- .option('--auto-reviewers', '自動選擇 reviewers')
77
- .option('--auto-labels', '自動添加 Labels')
78
- .action(workflowCommand);
79
-
80
- // 解析命令列參數
81
- program.parse(process.argv);
82
-
83
- // 如果沒有提供命令,顯示幫助
84
- if (!process.argv.slice(2).length) {
85
- program.outputHelp();
86
- }
65
+ program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-git-tools",
3
- "version": "1.0.5",
3
+ "version": "2.0.0",
4
4
  "description": "AI-powered Git automation tools for commit messages and PR generation",
5
5
  "main": "src/index.js",
6
6
  "type": "module",