@dongowu/git-ai-cli 1.0.19 → 1.0.20
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/README.md +78 -6
- package/README_EN.md +75 -4
- package/dist/cli.js +2 -135
- package/dist/cli.js.map +1 -1
- package/dist/cli_main.d.ts +2 -0
- package/dist/cli_main.d.ts.map +1 -0
- package/dist/cli_main.js +189 -0
- package/dist/cli_main.js.map +1 -0
- package/dist/commands/commit.d.ts.map +1 -1
- package/dist/commands/commit.js +26 -8
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/config_manage.d.ts +14 -0
- package/dist/commands/config_manage.d.ts.map +1 -0
- package/dist/commands/config_manage.js +185 -0
- package/dist/commands/config_manage.js.map +1 -0
- package/dist/commands/hook.d.ts.map +1 -1
- package/dist/commands/hook.js +58 -6
- package/dist/commands/hook.js.map +1 -1
- package/dist/commands/msg.d.ts +1 -0
- package/dist/commands/msg.d.ts.map +1 -1
- package/dist/commands/msg.js +28 -5
- package/dist/commands/msg.js.map +1 -1
- package/dist/commands/report.d.ts +7 -2
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +90 -14
- package/dist/commands/report.js.map +1 -1
- package/dist/utils/agent_lite.d.ts +5 -0
- package/dist/utils/agent_lite.d.ts.map +1 -0
- package/dist/utils/agent_lite.js +263 -0
- package/dist/utils/agent_lite.js.map +1 -0
- package/dist/utils/ai.d.ts.map +1 -1
- package/dist/utils/ai.js +167 -18
- package/dist/utils/ai.js.map +1 -1
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +64 -5
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/git.d.ts +9 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +188 -50
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/update.d.ts +3 -1
- package/dist/utils/update.d.ts.map +1 -1
- package/dist/utils/update.js +53 -2
- package/dist/utils/update.js.map +1 -1
- package/package.json +1 -1
- package/release_notes.md +4 -2
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ git-ai
|
|
|
57
57
|
|
|
58
58
|
### 3. 🤖 Agent 智能体 (New)
|
|
59
59
|
从单纯的“文本生成”进化为“智能代码专家”。
|
|
60
|
-
- **Smart Diff**: 遇到超大变更不再瞎编。Agent
|
|
60
|
+
- **Smart Diff**: 遇到超大变更不再瞎编。Agent 会自动分析统计数据,只读取核心文件的代码,大幅降低 Token 限制带来的影响。
|
|
61
61
|
- **影响分析 (Impact Analysis)**: 修改了核心 API?Agent 会主动**搜索整个代码库**(`git grep`),检查调用方是否同步修改,并在 Commit Body 中提示潜在风险。
|
|
62
62
|
- **Git Flow 护航**: 在 `release/*` 或 `hotfix/*` 分支上自动开启深度检查,守卫生产环境。
|
|
63
63
|
|
|
@@ -82,13 +82,58 @@ git-ai
|
|
|
82
82
|
|
|
83
83
|
```json
|
|
84
84
|
{
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
85
|
+
"provider": "deepseek",
|
|
86
|
+
"baseUrl": "https://api.deepseek.com/v1",
|
|
87
|
+
"model": "deepseek-reasoner",
|
|
88
|
+
"agentModel": "deepseek-chat",
|
|
89
|
+
"locale": "zh",
|
|
90
|
+
"enableFooter": true
|
|
89
91
|
}
|
|
90
92
|
```
|
|
91
93
|
|
|
94
|
+
说明:
|
|
95
|
+
- `model`:基础模式生成提交信息的模型
|
|
96
|
+
- `agentModel`:Agent 模式(`-a`)专用模型(建议选择稳定支持 tools 的模型;DeepSeek 常用 `deepseek-chat`)
|
|
97
|
+
- `locale`:仅支持 `zh` / `en`
|
|
98
|
+
- `apiKey` 建议通过环境变量或全局配置设置,不要提交到仓库
|
|
99
|
+
|
|
100
|
+
### 命令行配置(可脚本化)
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# 查看当前生效配置(包含环境变量覆盖)
|
|
104
|
+
git-ai config get --json
|
|
105
|
+
|
|
106
|
+
# 设置全局配置(写入全局配置文件)
|
|
107
|
+
git-ai config set model deepseek-chat
|
|
108
|
+
|
|
109
|
+
# 设置项目级配置(写入当前项目 .git-ai.json)
|
|
110
|
+
git-ai config set agentModel deepseek-chat --local
|
|
111
|
+
|
|
112
|
+
# 查看可配置项 / 环境变量覆盖
|
|
113
|
+
git-ai config describe
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 环境变量(CI/脚本)
|
|
117
|
+
|
|
118
|
+
常用环境变量(优先级高于配置文件):
|
|
119
|
+
- `GIT_AI_PROVIDER` / `GIT_AI_BASE_URL` / `GIT_AI_MODEL` / `GIT_AI_AGENT_MODEL`
|
|
120
|
+
- `GIT_AI_API_KEY`(也支持 `DEEPSEEK_API_KEY`、`OPENAI_API_KEY`)
|
|
121
|
+
- `GIT_AI_TIMEOUT_MS`(请求超时,默认 120000)
|
|
122
|
+
- `GIT_AI_MAX_DIFF_CHARS`(控制 diff 截断长度)
|
|
123
|
+
- `GIT_AI_MAX_OUTPUT_TOKENS`(控制输出 token 上限)
|
|
124
|
+
- `GIT_AI_AUTO_AGENT=0`(关闭自动 Agent;仍可用 `-a` 强制开启)
|
|
125
|
+
- `GIT_AI_DISABLE_AGENT=1`(完全禁用 Agent)
|
|
126
|
+
- `GIT_AI_RECENT_COMMITS_ALL=1`(Recent Commits 不限制作者)
|
|
127
|
+
- `GIT_AI_RECENT_COMMITS_FALLBACK=0`(禁用“无作者回退”)
|
|
128
|
+
- `GIT_AI_DISABLE_UPDATE=1`(关闭更新检查)
|
|
129
|
+
- `GIT_AI_UPDATE_INTERVAL_HOURS=24`(更新检查间隔,单位小时)
|
|
130
|
+
- `GIT_AI_MSG_DELIM=<<<GIT_AI_END>>>`(`git-ai msg -n` 多候选分隔符)
|
|
131
|
+
- `GIT_AI_DEBUG=1`(打印更详细错误)
|
|
132
|
+
|
|
133
|
+
OpenCommit 兼容变量(可直接复用):
|
|
134
|
+
- `OCO_AI_PROVIDER` / `OCO_MODEL` / `OCO_API_KEY`
|
|
135
|
+
- `OCO_TOKENS_MAX_INPUT` / `OCO_TOKENS_MAX_OUTPUT`
|
|
136
|
+
|
|
92
137
|
### 忽略文件 `.git-aiignore`
|
|
93
138
|
在项目根目录创建,用于排除不想发送给 AI 的文件(语法同 `.gitignore`):
|
|
94
139
|
|
|
@@ -98,6 +143,21 @@ dist/
|
|
|
98
143
|
*.min.js
|
|
99
144
|
```
|
|
100
145
|
|
|
146
|
+
同时兼容 OpenCommit 的 `.opencommitignore`(两者都会读取)。
|
|
147
|
+
|
|
148
|
+
### 常见问题
|
|
149
|
+
|
|
150
|
+
**1) 401 / API Key 无效**
|
|
151
|
+
- 先看生效配置:`git-ai config get --json --local`
|
|
152
|
+
- 再检查环境变量是否覆盖:`GIT_AI_API_KEY / DEEPSEEK_API_KEY / OPENAI_API_KEY / OCO_API_KEY`
|
|
153
|
+
|
|
154
|
+
**2) Diff 被截断**
|
|
155
|
+
- 通过 `.git-aiignore` / `.opencommitignore` 忽略大文件(lock/build/map)
|
|
156
|
+
- 或设置 `GIT_AI_MAX_DIFF_CHARS`(也兼容 `OCO_TOKENS_MAX_INPUT`)
|
|
157
|
+
|
|
158
|
+
**3) Agent 自动回退到基础模式**
|
|
159
|
+
- 设置 `GIT_AI_DEBUG=1` 可以看到回退原因(超时/限流/鉴权等)
|
|
160
|
+
|
|
101
161
|
---
|
|
102
162
|
|
|
103
163
|
## 📖 使用方式
|
|
@@ -139,6 +199,12 @@ git-ai report
|
|
|
139
199
|
|
|
140
200
|
# 生成最近 30 天的汇报
|
|
141
201
|
git-ai report --days 30
|
|
202
|
+
|
|
203
|
+
# 指定日期范围
|
|
204
|
+
git-ai report --from 2025-01-01 --to 2025-01-31
|
|
205
|
+
|
|
206
|
+
# JSON 输出(便于脚本处理)
|
|
207
|
+
git-ai report --days 7 --json
|
|
142
208
|
```
|
|
143
209
|
|
|
144
210
|
---
|
|
@@ -148,10 +214,14 @@ git-ai report --days 30
|
|
|
148
214
|
| 命令 | 别名 | 说明 |
|
|
149
215
|
|------|------|------|
|
|
150
216
|
| `git-ai init` | `config` | **初始化配置**(设置模型、Key、语言) |
|
|
217
|
+
| `git-ai config get` | | 查看当前生效配置(支持 `--json` / `--local`) |
|
|
218
|
+
| `git-ai config set <key> <value>` | | 设置配置(支持 `--local` / `--json`) |
|
|
219
|
+
| `git-ai config describe` | | 查看可配置项与环境变量覆盖 |
|
|
151
220
|
| `git-ai` | | 交互式生成并提交 |
|
|
152
221
|
| `git-ai -a` | | **Agent 模式** (深度分析 & 影响检查) |
|
|
153
222
|
| `git-ai -y` | | 跳过确认直接提交 |
|
|
154
223
|
| `git-ai -n 3` | | 生成 3 条候选消息 |
|
|
224
|
+
| `git-ai -l en` | | 强制输出语言(en/zh) |
|
|
155
225
|
| `git-ai hook install` | | **安装 Git Hook** (支持 `--global`) |
|
|
156
226
|
| `git-ai hook remove` | | 移除 Git Hook |
|
|
157
227
|
| `git-ai report` | | **生成 AI 周报** (支持 `--days`) |
|
|
@@ -159,6 +229,8 @@ git-ai report --days 30
|
|
|
159
229
|
|
|
160
230
|
---
|
|
161
231
|
|
|
232
|
+
**提示**:`git-ai msg -n` 默认使用分隔符 `<<<GIT_AI_END>>>`;脚本场景建议使用 `--json`。
|
|
233
|
+
|
|
162
234
|
## 🤖 支持的模型
|
|
163
235
|
|
|
164
236
|
| 类型 | 服务商 | 优势 | 配置方式 |
|
|
@@ -184,4 +256,4 @@ git-ai report --days 30
|
|
|
184
256
|
Made with ❤️ by git-ai team
|
|
185
257
|
<br>
|
|
186
258
|
<sub>🤖 Generated by git-ai 🚀</sub>
|
|
187
|
-
</p>
|
|
259
|
+
</p>
|
package/README_EN.md
CHANGED
|
@@ -57,7 +57,7 @@ git-ai
|
|
|
57
57
|
|
|
58
58
|
### 3. 🤖 Agent Intelligence (New)
|
|
59
59
|
Evolving from a text generator to a code expert.
|
|
60
|
-
- **Smart Diff**:
|
|
60
|
+
- **Smart Diff**: The Agent analyzes file stats and reads only the critical diffs to reduce truncation and token usage on large refactors.
|
|
61
61
|
- **Impact Analysis**: Changing a core API? The Agent proactively searches your codebase (`git grep`) to find usages and warns you about potential breaking changes in the commit body.
|
|
62
62
|
- **Git Flow Guard**: Automatically enables deep analysis on `release/*` or `hotfix/*` branches to protect production code.
|
|
63
63
|
|
|
@@ -82,13 +82,58 @@ Create this file in your project root to override global settings:
|
|
|
82
82
|
|
|
83
83
|
```json
|
|
84
84
|
{
|
|
85
|
-
"
|
|
86
|
-
"
|
|
85
|
+
"provider": "deepseek",
|
|
86
|
+
"baseUrl": "https://api.deepseek.com/v1",
|
|
87
|
+
"model": "deepseek-reasoner",
|
|
88
|
+
"agentModel": "deepseek-chat",
|
|
87
89
|
"locale": "en",
|
|
88
|
-
"
|
|
90
|
+
"enableFooter": true
|
|
89
91
|
}
|
|
90
92
|
```
|
|
91
93
|
|
|
94
|
+
Notes:
|
|
95
|
+
- `model`: base generation model
|
|
96
|
+
- `agentModel`: Agent mode (`-a`) model (pick a tool-capable model; DeepSeek typically uses `deepseek-chat`)
|
|
97
|
+
- `locale`: only `zh` / `en`
|
|
98
|
+
- It's recommended to set `apiKey` via env vars or global config (don't commit keys into the repo)
|
|
99
|
+
|
|
100
|
+
### CLI Config (scriptable)
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Show effective config (includes env overrides)
|
|
104
|
+
git-ai config get --json
|
|
105
|
+
|
|
106
|
+
# Set global config
|
|
107
|
+
git-ai config set model deepseek-chat
|
|
108
|
+
|
|
109
|
+
# Set per-project config (write to .git-ai.json)
|
|
110
|
+
git-ai config set agentModel deepseek-chat --local
|
|
111
|
+
|
|
112
|
+
# List keys + env overrides
|
|
113
|
+
git-ai config describe
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Environment Variables (CI/Scripts)
|
|
117
|
+
|
|
118
|
+
Common env overrides (higher priority than config files):
|
|
119
|
+
- `GIT_AI_PROVIDER` / `GIT_AI_BASE_URL` / `GIT_AI_MODEL` / `GIT_AI_AGENT_MODEL`
|
|
120
|
+
- `GIT_AI_API_KEY` (also supports `DEEPSEEK_API_KEY`, `OPENAI_API_KEY`)
|
|
121
|
+
- `GIT_AI_TIMEOUT_MS` (request timeout, default 120000)
|
|
122
|
+
- `GIT_AI_MAX_DIFF_CHARS` (diff truncation length)
|
|
123
|
+
- `GIT_AI_MAX_OUTPUT_TOKENS` (output token limit)
|
|
124
|
+
- `GIT_AI_AUTO_AGENT=0` (disable auto Agent; `-a` still forces it)
|
|
125
|
+
- `GIT_AI_DISABLE_AGENT=1` (disable Agent completely)
|
|
126
|
+
- `GIT_AI_RECENT_COMMITS_ALL=1` (recent commits not limited by author)
|
|
127
|
+
- `GIT_AI_RECENT_COMMITS_FALLBACK=0` (disable no-author fallback)
|
|
128
|
+
- `GIT_AI_DISABLE_UPDATE=1` (disable update check)
|
|
129
|
+
- `GIT_AI_UPDATE_INTERVAL_HOURS=24` (update check interval in hours)
|
|
130
|
+
- `GIT_AI_MSG_DELIM=<<<GIT_AI_END>>>` (delimiter for `git-ai msg -n`)
|
|
131
|
+
- `GIT_AI_DEBUG=1` (print more error details)
|
|
132
|
+
|
|
133
|
+
OpenCommit-compatible env vars:
|
|
134
|
+
- `OCO_AI_PROVIDER` / `OCO_MODEL` / `OCO_API_KEY`
|
|
135
|
+
- `OCO_TOKENS_MAX_INPUT` / `OCO_TOKENS_MAX_OUTPUT`
|
|
136
|
+
|
|
92
137
|
### Ignore File `.git-aiignore`
|
|
93
138
|
Exclude specific files from AI analysis (syntax similar to `.gitignore`):
|
|
94
139
|
|
|
@@ -98,6 +143,21 @@ dist/
|
|
|
98
143
|
*.min.js
|
|
99
144
|
```
|
|
100
145
|
|
|
146
|
+
Also compatible with OpenCommit's `.opencommitignore` (both will be read).
|
|
147
|
+
|
|
148
|
+
### Troubleshooting
|
|
149
|
+
|
|
150
|
+
**1) 401 / Invalid API key**
|
|
151
|
+
- Check effective config: `git-ai config get --json --local`
|
|
152
|
+
- Make sure env vars aren't overriding your key: `GIT_AI_API_KEY / DEEPSEEK_API_KEY / OPENAI_API_KEY / OCO_API_KEY`
|
|
153
|
+
|
|
154
|
+
**2) Diff truncated**
|
|
155
|
+
- Ignore large files via `.git-aiignore` / `.opencommitignore`
|
|
156
|
+
- Or set `GIT_AI_MAX_DIFF_CHARS` (also supports `OCO_TOKENS_MAX_INPUT`)
|
|
157
|
+
|
|
158
|
+
**3) Agent falls back to basic mode**
|
|
159
|
+
- Set `GIT_AI_DEBUG=1` to see the real failure reason (timeout/rate limit/auth, etc.)
|
|
160
|
+
|
|
101
161
|
---
|
|
102
162
|
|
|
103
163
|
## 📖 Usage
|
|
@@ -136,6 +196,12 @@ git-ai report
|
|
|
136
196
|
|
|
137
197
|
# Generate report for the last 30 days
|
|
138
198
|
git-ai report --days 30
|
|
199
|
+
|
|
200
|
+
# Specify date range
|
|
201
|
+
git-ai report --from 2025-01-01 --to 2025-01-31
|
|
202
|
+
|
|
203
|
+
# JSON output (for scripts)
|
|
204
|
+
git-ai report --days 7 --json
|
|
139
205
|
```
|
|
140
206
|
|
|
141
207
|
---
|
|
@@ -145,6 +211,9 @@ git-ai report --days 30
|
|
|
145
211
|
| Command | Alias | Description |
|
|
146
212
|
|---------|-------|-------------|
|
|
147
213
|
| `git-ai init` | `config` | **Initialize Config** (Provider, Key, Language) |
|
|
214
|
+
| `git-ai config get` | | Show effective config (supports `--json` / `--local`) |
|
|
215
|
+
| `git-ai config set <key> <value>` | | Set config (supports `--local` / `--json`) |
|
|
216
|
+
| `git-ai config describe` | | List config keys and env overrides |
|
|
148
217
|
| `git-ai` | | Interactive generation & commit |
|
|
149
218
|
| `git-ai -a` | | **Agent Mode** (Deep analysis & Impact check) |
|
|
150
219
|
| `git-ai -y` | | Skip confirmation and commit directly |
|
|
@@ -156,6 +225,8 @@ git-ai report --days 30
|
|
|
156
225
|
|
|
157
226
|
---
|
|
158
227
|
|
|
228
|
+
Tip: `git-ai msg -n` uses `<<<GIT_AI_END>>>` as the default delimiter; prefer `--json` for scripts.
|
|
229
|
+
|
|
159
230
|
## 📄 License
|
|
160
231
|
|
|
161
232
|
[MIT](LICENSE)
|
package/dist/cli.js
CHANGED
|
@@ -12,139 +12,6 @@ process.emit = function (name, data, ...args) {
|
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
return originalEmit.apply(process, [name, data, ...args]);
|
|
14
14
|
};
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import { createRequire } from 'node:module';
|
|
18
|
-
import { runConfig } from './commands/config.js';
|
|
19
|
-
import { runCommit } from './commands/commit.js';
|
|
20
|
-
import { runMsg } from './commands/msg.js';
|
|
21
|
-
import { runHook } from './commands/hook.js';
|
|
22
|
-
import { runReport } from './commands/report.js';
|
|
23
|
-
import { checkUpdate } from './utils/update.js';
|
|
24
|
-
const require = createRequire(import.meta.url);
|
|
25
|
-
const pkg = require('../package.json');
|
|
26
|
-
const cli = cac('git-ai');
|
|
27
|
-
// Default command (backward compatible) - interactive commit
|
|
28
|
-
cli
|
|
29
|
-
.command('', 'Generate AI-powered commit message (interactive)')
|
|
30
|
-
.option('-y, --yes', 'Skip confirmation and commit directly')
|
|
31
|
-
.option('-n, --num <count>', 'Generate multiple commit messages to choose from', { default: 1 })
|
|
32
|
-
.option('-l, --locale <locale>', 'Override locale (zh/en)')
|
|
33
|
-
.option('-a, --agent', 'Use Agent mode for deep analysis and impact checking')
|
|
34
|
-
.option('--hook', '[deprecated] Use `git-ai msg` instead')
|
|
35
|
-
.action(async (options) => {
|
|
36
|
-
try {
|
|
37
|
-
// Deprecated --hook redirects to msg command behavior
|
|
38
|
-
if (options.hook) {
|
|
39
|
-
const { runMsg } = await import('./commands/msg.js');
|
|
40
|
-
await runMsg({ quiet: true, locale: options.locale });
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
await runCommit({
|
|
44
|
-
autoCommit: options.yes ?? false,
|
|
45
|
-
numChoices: Math.min(Math.max(Number(options.num) || 1, 1), 5),
|
|
46
|
-
locale: options.locale,
|
|
47
|
-
agentMode: options.agent,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
52
|
-
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
// Explicit commit subcommand
|
|
57
|
-
cli
|
|
58
|
-
.command('commit', 'Generate and commit with AI message (interactive)')
|
|
59
|
-
.option('-y, --yes', 'Skip confirmation and commit directly')
|
|
60
|
-
.option('-n, --num <count>', 'Generate multiple commit messages to choose from', { default: 1 })
|
|
61
|
-
.option('-l, --locale <locale>', 'Override locale (zh/en)')
|
|
62
|
-
.option('-a, --agent', 'Use Agent mode for deep analysis and impact checking')
|
|
63
|
-
.action(async (options) => {
|
|
64
|
-
try {
|
|
65
|
-
await runCommit({
|
|
66
|
-
autoCommit: options.yes ?? false,
|
|
67
|
-
numChoices: Math.min(Math.max(Number(options.num) || 1, 1), 5),
|
|
68
|
-
locale: options.locale,
|
|
69
|
-
agentMode: options.agent,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
74
|
-
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
// Message-only command (for hooks and scripts)
|
|
79
|
-
cli
|
|
80
|
-
.command('msg', 'Generate commit message only (stdout, for hooks/scripts)')
|
|
81
|
-
.option('-n, --num <count>', 'Generate multiple messages', { default: 1 })
|
|
82
|
-
.option('--json', 'Output as JSON')
|
|
83
|
-
.option('--quiet', 'Suppress spinner and colors')
|
|
84
|
-
.option('-l, --locale <locale>', 'Override locale (zh/en)')
|
|
85
|
-
.action(async (options) => {
|
|
86
|
-
try {
|
|
87
|
-
await runMsg({
|
|
88
|
-
num: Math.min(Math.max(Number(options.num) || 1, 1), 5),
|
|
89
|
-
json: options.json ?? false,
|
|
90
|
-
quiet: options.quiet ?? false,
|
|
91
|
-
locale: options.locale,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
if (options.json) {
|
|
96
|
-
console.log(JSON.stringify({ success: false, error: String(error) }));
|
|
97
|
-
}
|
|
98
|
-
else if (!options.quiet) {
|
|
99
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
100
|
-
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
101
|
-
}
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
cli
|
|
106
|
-
.command('config', 'Configure AI provider settings')
|
|
107
|
-
.alias('init')
|
|
108
|
-
.action(async () => {
|
|
109
|
-
try {
|
|
110
|
-
await runConfig();
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
114
|
-
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
cli
|
|
119
|
-
.command('hook <action>', 'Manage Git hooks (install/remove/status)')
|
|
120
|
-
.option('-g, --global', 'Apply to global Git hooks (all repositories)')
|
|
121
|
-
.action(async (action, options) => {
|
|
122
|
-
try {
|
|
123
|
-
await runHook(action, { global: options.global });
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
127
|
-
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
128
|
-
process.exit(1);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
cli
|
|
132
|
-
.command('report', 'Generate AI-powered weekly/daily reports from git history')
|
|
133
|
-
.option('--days <number>', 'Number of days to analyze')
|
|
134
|
-
.action(async (options) => {
|
|
135
|
-
try {
|
|
136
|
-
await runReport({ days: options.days ? Number(options.days) : undefined });
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
140
|
-
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
141
|
-
process.exit(1);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
cli.help();
|
|
145
|
-
cli.version(pkg.version || '0.0.0');
|
|
146
|
-
// Check for updates asynchronously
|
|
147
|
-
checkUpdate().then(() => {
|
|
148
|
-
cli.parse();
|
|
149
|
-
});
|
|
15
|
+
void import('./cli_main.js');
|
|
16
|
+
export {};
|
|
150
17
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,mDAAmD;AACnD,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;AAClC,8DAA8D;AAC9D,OAAO,CAAC,IAAI,GAAG,UAAU,IAAS,EAAE,IAAS,EAAE,GAAG,IAAW;IAC3D,IACE,IAAI,KAAK,SAAS;QAClB,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,EAAE,IAAI,KAAK,oBAAoB;QACnC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EACnC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,8DAA8D;IAC9D,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAQ,CAAC,CAAC;AACnE,CAAQ,CAAC;AAET,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,mDAAmD;AACnD,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;AAClC,8DAA8D;AAC9D,OAAO,CAAC,IAAI,GAAG,UAAU,IAAS,EAAE,IAAS,EAAE,GAAG,IAAW;IAC3D,IACE,IAAI,KAAK,SAAS;QAClB,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,EAAE,IAAI,KAAK,oBAAoB;QACnC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EACnC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,8DAA8D;IAC9D,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAQ,CAAC,CAAC;AACnE,CAAQ,CAAC;AAET,KAAK,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli_main.d.ts","sourceRoot":"","sources":["../src/cli_main.ts"],"names":[],"mappings":""}
|
package/dist/cli_main.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { cac } from 'cac';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import { runConfig } from './commands/config.js';
|
|
5
|
+
import { runConfigDescribe, runConfigGet, runConfigSet } from './commands/config_manage.js';
|
|
6
|
+
import { runCommit } from './commands/commit.js';
|
|
7
|
+
import { runMsg } from './commands/msg.js';
|
|
8
|
+
import { runHook } from './commands/hook.js';
|
|
9
|
+
import { runReport } from './commands/report.js';
|
|
10
|
+
import { checkUpdate } from './utils/update.js';
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const pkg = require('../package.json');
|
|
13
|
+
const cli = cac('git-ai');
|
|
14
|
+
function shouldAllowUpdateCheck(argv) {
|
|
15
|
+
const args = argv.slice(2);
|
|
16
|
+
const hasFlag = (flag) => args.includes(flag) || args.some((arg) => arg.startsWith(`${flag}=`));
|
|
17
|
+
// Avoid polluting machine-readable output or hooks.
|
|
18
|
+
if (hasFlag('--json') || hasFlag('--quiet') || hasFlag('--hook'))
|
|
19
|
+
return false;
|
|
20
|
+
if (hasFlag('--help') || hasFlag('-h') || hasFlag('--version') || hasFlag('-v'))
|
|
21
|
+
return false;
|
|
22
|
+
// Avoid noisy output for message-only command.
|
|
23
|
+
const cmd = args.find((arg) => !arg.startsWith('-'));
|
|
24
|
+
if (cmd === 'msg')
|
|
25
|
+
return false;
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
// Default command (backward compatible) - interactive commit
|
|
29
|
+
cli
|
|
30
|
+
.command('', 'Generate AI-powered commit message (interactive)')
|
|
31
|
+
.option('-y, --yes', 'Skip confirmation and commit directly')
|
|
32
|
+
.option('-n, --num <count>', 'Generate multiple commit messages to choose from', { default: 1 })
|
|
33
|
+
.option('-l, --locale <locale>', 'Override locale (zh/en)')
|
|
34
|
+
.option('-a, --agent', 'Use Agent mode for deep analysis and impact checking')
|
|
35
|
+
.option('--hook', '[deprecated] Use `git-ai msg` instead')
|
|
36
|
+
.action(async (options) => {
|
|
37
|
+
try {
|
|
38
|
+
// Deprecated --hook redirects to msg command behavior
|
|
39
|
+
if (options.hook) {
|
|
40
|
+
const { runMsg } = await import('./commands/msg.js');
|
|
41
|
+
await runMsg({ quiet: true, locale: options.locale });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
await runCommit({
|
|
45
|
+
autoCommit: options.yes ?? false,
|
|
46
|
+
numChoices: Math.min(Math.max(Number(options.num) || 1, 1), 5),
|
|
47
|
+
locale: options.locale,
|
|
48
|
+
agentMode: options.agent,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
53
|
+
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
// Explicit commit subcommand
|
|
58
|
+
cli
|
|
59
|
+
.command('commit', 'Generate and commit with AI message (interactive)')
|
|
60
|
+
.option('-y, --yes', 'Skip confirmation and commit directly')
|
|
61
|
+
.option('-n, --num <count>', 'Generate multiple commit messages to choose from', { default: 1 })
|
|
62
|
+
.option('-l, --locale <locale>', 'Override locale (zh/en)')
|
|
63
|
+
.option('-a, --agent', 'Use Agent mode for deep analysis and impact checking')
|
|
64
|
+
.action(async (options) => {
|
|
65
|
+
try {
|
|
66
|
+
await runCommit({
|
|
67
|
+
autoCommit: options.yes ?? false,
|
|
68
|
+
numChoices: Math.min(Math.max(Number(options.num) || 1, 1), 5),
|
|
69
|
+
locale: options.locale,
|
|
70
|
+
agentMode: options.agent,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
75
|
+
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
// Message-only command (for hooks and scripts)
|
|
80
|
+
cli
|
|
81
|
+
.command('msg', 'Generate commit message only (stdout, for hooks/scripts)')
|
|
82
|
+
.option('-n, --num <count>', 'Generate multiple messages', { default: 1 })
|
|
83
|
+
.option('--json', 'Output as JSON')
|
|
84
|
+
.option('--quiet', 'Suppress spinner and colors')
|
|
85
|
+
.option('-l, --locale <locale>', 'Override locale (zh/en)')
|
|
86
|
+
.action(async (options) => {
|
|
87
|
+
try {
|
|
88
|
+
await runMsg({
|
|
89
|
+
num: Math.min(Math.max(Number(options.num) || 1, 1), 5),
|
|
90
|
+
json: options.json ?? false,
|
|
91
|
+
quiet: options.quiet ?? false,
|
|
92
|
+
locale: options.locale,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
if (options.json) {
|
|
97
|
+
console.log(JSON.stringify({ success: false, error: String(error) }));
|
|
98
|
+
}
|
|
99
|
+
else if (!options.quiet) {
|
|
100
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
101
|
+
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
102
|
+
}
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
cli
|
|
107
|
+
.command('config [action] [key] [value]', 'Configure AI provider settings')
|
|
108
|
+
.alias('init')
|
|
109
|
+
.option('--json', 'Output as JSON (for get/set/describe)')
|
|
110
|
+
.option('--local', 'Use local .git-ai.json (for get/set)')
|
|
111
|
+
.action(async (action, key, value, options) => {
|
|
112
|
+
try {
|
|
113
|
+
const act = (action || '').trim();
|
|
114
|
+
if (!act) {
|
|
115
|
+
await runConfig();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (act === 'get') {
|
|
119
|
+
runConfigGet({ json: options?.json, local: options?.local });
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (act === 'describe') {
|
|
123
|
+
runConfigDescribe({ json: options?.json });
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (act === 'set') {
|
|
127
|
+
if (!key || value === undefined) {
|
|
128
|
+
throw new Error('Usage: git-ai config set <key> <value>');
|
|
129
|
+
}
|
|
130
|
+
runConfigSet(key, value, { json: options?.json, local: options?.local });
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
throw new Error(`Unknown config action: ${act}`);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
137
|
+
console.error(chalk.red(`\n? Error: ${message}\n`));
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
cli
|
|
142
|
+
.command('hook <action>', 'Manage Git hooks (install/remove/status)')
|
|
143
|
+
.option('-g, --global', 'Apply to global Git hooks (all repositories)')
|
|
144
|
+
.action(async (action, options) => {
|
|
145
|
+
try {
|
|
146
|
+
await runHook(action, { global: options.global });
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
150
|
+
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
cli
|
|
155
|
+
.command('report', 'Generate AI-powered weekly/daily reports from git history')
|
|
156
|
+
.option('--days <number>', 'Number of days to analyze')
|
|
157
|
+
.option('--from <date>', 'Start date (YYYY-MM-DD)')
|
|
158
|
+
.option('--to <date>', 'End date (YYYY-MM-DD)')
|
|
159
|
+
.option('--json', 'Output as JSON')
|
|
160
|
+
.action(async (options) => {
|
|
161
|
+
try {
|
|
162
|
+
await runReport({
|
|
163
|
+
days: options.days ? Number(options.days) : undefined,
|
|
164
|
+
from: options.from,
|
|
165
|
+
to: options.to,
|
|
166
|
+
json: options.json,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
171
|
+
console.error(chalk.red(`\n❌ Error: ${message}\n`));
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
cli.help();
|
|
176
|
+
cli.version(pkg.version || '0.0.0');
|
|
177
|
+
const allowUpdateCheck = shouldAllowUpdateCheck(process.argv);
|
|
178
|
+
cli.parse();
|
|
179
|
+
// Check for updates asynchronously after command execution.
|
|
180
|
+
if (allowUpdateCheck) {
|
|
181
|
+
let updateScheduled = false;
|
|
182
|
+
process.on('beforeExit', () => {
|
|
183
|
+
if (updateScheduled)
|
|
184
|
+
return;
|
|
185
|
+
updateScheduled = true;
|
|
186
|
+
void checkUpdate({ allow: true });
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=cli_main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli_main.js","sourceRoot":"","sources":["../src/cli_main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,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AAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAYD,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/commands/commit.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAYD,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8O1E"}
|