@hifullmoon/aicommit 1.4.0 → 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/.aicommit.config.example.json +30 -10
- package/CHANGELOG.md +75 -74
- package/README.md +71 -49
- package/README.zh-CN.md +109 -87
- package/SECURITY.md +1 -1
- package/docs/distribution.md +13 -76
- package/docs/privacy.md +8 -8
- package/docs/provider-presets.md +22 -9
- package/docs/troubleshooting.md +0 -1
- package/package.json +6 -6
- package/presets/provider-presets.json +48 -15
- package/schemas/aicommit-provider-presets.schema.json +24 -4
- package/src/cli.js +57 -17
- package/src/completion.js +4 -1
- package/src/config-command.js +7 -5
- package/src/config.js +198 -26
- package/src/doctor.js +5 -3
- package/src/main.js +29 -6
- package/src/provider-presets.js +43 -15
- package/src/setup.js +66 -37
- package/src/split.js +9 -2
- package/src/ui.js +66 -13
|
@@ -1,40 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
+
"schemaVersion": 1,
|
|
2
3
|
"defaultProvider": "minimax",
|
|
3
4
|
"providers": {
|
|
4
5
|
"minimax": {
|
|
5
6
|
"providerType": "minimax",
|
|
6
7
|
"apiUrl": "https://api.minimaxi.com/v1/chat/completions",
|
|
7
8
|
"apiKeyEnv": "MINIMAX_API_KEY",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
"defaultModel": "default",
|
|
10
|
+
"models": {
|
|
11
|
+
"default": {
|
|
12
|
+
"modelId": "MiniMax-M3",
|
|
13
|
+
"extraBody": {
|
|
14
|
+
"thinking": {
|
|
15
|
+
"type": "disabled"
|
|
16
|
+
},
|
|
17
|
+
"reasoning_split": true
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
"deepseek": {
|
|
17
23
|
"providerType": "deepseek",
|
|
18
24
|
"apiUrl": "https://api.deepseek.com/v1/chat/completions",
|
|
19
25
|
"apiKeyEnv": "DEEPSEEK_API_KEY",
|
|
20
|
-
"
|
|
26
|
+
"defaultModel": "chat",
|
|
27
|
+
"models": {
|
|
28
|
+
"chat": { "modelId": "deepseek-v4-flash" }
|
|
29
|
+
}
|
|
21
30
|
},
|
|
22
31
|
"openrouter": {
|
|
23
32
|
"providerType": "openrouter",
|
|
24
33
|
"apiUrl": "https://openrouter.ai/api/v1/chat/completions",
|
|
25
34
|
"apiKeyEnv": "OPENROUTER_API_KEY",
|
|
26
|
-
"
|
|
35
|
+
"defaultModel": "fast",
|
|
36
|
+
"models": {
|
|
37
|
+
"fast": { "modelId": "openai/gpt-4o-mini" },
|
|
38
|
+
"quality": { "modelId": "openai/gpt-4o" }
|
|
39
|
+
}
|
|
27
40
|
},
|
|
28
41
|
"kimi-code": {
|
|
29
42
|
"providerType": "custom",
|
|
30
43
|
"apiUrl": "https://api.kimi.com/coding/v1/chat/completions",
|
|
31
44
|
"apiKeyEnv": "KIMI_API_KEY",
|
|
32
|
-
"
|
|
45
|
+
"defaultModel": "default",
|
|
46
|
+
"models": {
|
|
47
|
+
"default": { "modelId": "kimi-for-coding" }
|
|
48
|
+
}
|
|
33
49
|
},
|
|
34
50
|
"ollama": {
|
|
35
51
|
"providerType": "ollama",
|
|
36
52
|
"apiUrl": "http://127.0.0.1:11434/api/chat",
|
|
37
|
-
"
|
|
53
|
+
"defaultModel": "qwen",
|
|
54
|
+
"models": {
|
|
55
|
+
"qwen": { "modelId": "qwen3:8b" },
|
|
56
|
+
"deepseek": { "modelId": "deepseek-r1:14b" }
|
|
57
|
+
}
|
|
38
58
|
}
|
|
39
59
|
},
|
|
40
60
|
"language": "en",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,131 +1,132 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This file lists notable user-facing changes. Internal refactors, test-only changes, release mechanics, and documentation-only edits are omitted.
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [2.0.0] - 2026-08-27
|
|
8
|
+
|
|
7
9
|
### Added
|
|
8
10
|
|
|
9
|
-
-
|
|
11
|
+
- Added named model profiles per provider, with model selection available in setup and through `--model`.
|
|
10
12
|
|
|
11
13
|
### Changed
|
|
12
14
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
- **Breaking:** user configuration now requires `schemaVersion: 1`, an explicit `defaultProvider`, and provider-level `defaultModel`/`models` maps; legacy flat and provider-level `modelId` configurations must be migrated with `aicommit setup`.
|
|
16
|
+
- Provider preset manifests now use schema version 2 with named model maps and explicit default models.
|
|
17
|
+
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
- Removed the Homebrew distribution channel; install and upgrade AICommit through npm.
|
|
21
|
+
|
|
22
|
+
## [1.5.1] - 2026-08-27
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Normalized Windows 8.3 path aliases before validating split plan destinations, so repository-local output is rejected before any provider request.
|
|
27
|
+
|
|
28
|
+
## [1.5.0] - 2026-08-27
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Added a built-in Kimi Code provider preset and an environment-variable configuration example.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- `aicommit split` now starts the interactive split flow directly; `aicommit split run` remains available as an alias.
|
|
37
|
+
- Repository policies can enforce their configured language without CLI overrides.
|
|
38
|
+
- Provider preset compatibility now follows SemVer rules for prerelease and build versions.
|
|
39
|
+
- Split commands detect unfinished checkpoints early and provide safe resume or abort actions.
|
|
17
40
|
|
|
18
41
|
### Security
|
|
19
42
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
43
|
+
- Sensitive URL components are redacted from configuration, diagnostics, debug output, extension input, and credential-helper errors.
|
|
44
|
+
- Provider extensions reject credential-like configuration fields and excessively deep nested input.
|
|
22
45
|
|
|
23
|
-
##
|
|
46
|
+
## 1.4.0 - 2026-08-24
|
|
24
47
|
|
|
25
48
|
### Added
|
|
26
49
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- Automated npm/Homebrew installation smoke paths plus bilingual distribution, troubleshooting, privacy, and provider-compatibility guides.
|
|
50
|
+
- Added credential-free `config show`, `config validate`, and `config path` commands.
|
|
51
|
+
- Added generated shell completion for Bash, Zsh, and Fish.
|
|
52
|
+
- Added repository-owned team policies with deterministic local and CI checks.
|
|
53
|
+
- Added independently updateable provider presets with install, repair, and rollback support.
|
|
54
|
+
- Added an isolated extension API for context providers, message validators, and provider adapters.
|
|
33
55
|
|
|
34
56
|
### Changed
|
|
35
57
|
|
|
36
|
-
- Interactive setup now
|
|
37
|
-
- Provider request orchestration accepts asynchronous built-in or extension adapters without changing the Git and interaction flows.
|
|
58
|
+
- Interactive setup now reads providers from the active preset manifest.
|
|
38
59
|
|
|
39
60
|
### Security
|
|
40
61
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
62
|
+
- Extension processes run with explicit permissions, a sanitized environment, and no provider credentials.
|
|
63
|
+
- Project configuration cannot enable extensions or weaken credential boundaries.
|
|
43
64
|
|
|
44
|
-
##
|
|
65
|
+
## 1.3.0 - 2026-08-24
|
|
45
66
|
|
|
46
67
|
### Added
|
|
47
68
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- Opt-in `--split-hunks` support for tracked multi-hunk text modifications, with hunk IDs/ranges/hashes in plans and machine output.
|
|
52
|
-
- A shared end-to-end split fault matrix for SIGINT, process crashes, concurrent edits, hook failures, renames, deletions, binary files, and submodules.
|
|
69
|
+
- Added explicit staged/all split scopes and reusable `split plan` / `split apply` artifacts.
|
|
70
|
+
- Added resumable split checkpoints for interrupted or failed multi-commit operations.
|
|
71
|
+
- Added optional same-file hunk splitting for tracked text files.
|
|
53
72
|
|
|
54
73
|
### Changed
|
|
55
74
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
- Split apply and resume run without loading provider configuration or credentials.
|
|
75
|
+
- Split commits are built from captured snapshots so later worktree edits cannot enter pending commits.
|
|
76
|
+
- Split apply and resume no longer require provider configuration or credentials.
|
|
59
77
|
|
|
60
78
|
### Security
|
|
61
79
|
|
|
62
|
-
- Split
|
|
63
|
-
- Experimental hunk execution validates selected patches entirely in temporary indexes and requires the final tree to reproduce every captured target blob exactly; otherwise planning falls back to file-level groups before the first commit.
|
|
80
|
+
- Split plans, checkpoints, paths, and hunk operations are validated before Git state is changed.
|
|
64
81
|
|
|
65
|
-
##
|
|
82
|
+
## 1.2.0 - 2026-08-24
|
|
66
83
|
|
|
67
84
|
### Added
|
|
68
85
|
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
- Anonymous local eval coverage for single/mixed changes, renames, generated files, long diffs, Chinese/English output, and malformed weak-model candidates, enforced in CI at 99% or better.
|
|
86
|
+
- Added versioned commit policies for type, scope, subject, body, breaking changes, and language.
|
|
87
|
+
- Added bounded repository context from recent commits, package boundaries, trusted convention files, and recognized commitlint rules.
|
|
88
|
+
- Added local-only quality statistics with enable, disable, and clear controls.
|
|
73
89
|
|
|
74
90
|
### Changed
|
|
75
91
|
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
- Candidate responses are validated locally for policy compliance and diff/path alignment; hard policy failures receive at most one low-cost correction without re-sending the diff.
|
|
79
|
-
- Automatic policy corrections now contribute to the anonymous local rewrite metric.
|
|
92
|
+
- Commit generation now uses an authoritative structured policy and locally validates candidate messages.
|
|
93
|
+
- Repository context categories and budgets can be configured without allowing project settings to expand user-owned limits.
|
|
80
94
|
|
|
81
95
|
### Security
|
|
82
96
|
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
- Trusted convention reads reject paths outside the repository, symbolic links, and non-regular files; commitlint configuration is parsed as data and never executed.
|
|
97
|
+
- Repository and diff inputs are isolated as untrusted structured data.
|
|
98
|
+
- Trusted convention files cannot escape the repository or execute commitlint configuration code.
|
|
86
99
|
|
|
87
|
-
##
|
|
100
|
+
## 1.1.0 - 2026-08-24
|
|
88
101
|
|
|
89
102
|
### Added
|
|
90
103
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
- Bounded retries for rate limits, recoverable server failures, and interrupted network responses, including `Retry-After` support.
|
|
97
|
-
- Stable error categories and process exit codes for config, Git state, network, provider, response-format, sensitive-data, and concurrent-modification failures.
|
|
98
|
-
- `--output=text|json` with a published JSON schema and decoration-free stdout for automation.
|
|
99
|
-
- `aicommit doctor` diagnostics for runtime, configuration, endpoint security, provider capabilities, credentials, and connectivity.
|
|
100
|
-
- Optional Git credential-helper integration for OS-backed credential storage.
|
|
101
|
-
- Minimal local-only metrics with status, clear, enable, and disable commands.
|
|
104
|
+
- Added unified support for OpenAI, OpenRouter, DeepSeek, MiniMax, Ollama, and custom compatible endpoints.
|
|
105
|
+
- Added bounded retries for rate limits, recoverable server failures, and interrupted responses.
|
|
106
|
+
- Added stable error categories, process exit codes, and JSON output for automation.
|
|
107
|
+
- Added `aicommit doctor` diagnostics.
|
|
108
|
+
- Added optional Git credential-helper integration.
|
|
102
109
|
|
|
103
110
|
### Changed
|
|
104
111
|
|
|
105
|
-
- Constrained interactive prompt dependencies to releases that support Node.js 18.
|
|
106
|
-
- Normalized provider usage as input, output, and total tokens and exposed finish reasons through one internal response contract.
|
|
107
112
|
- Environment credentials now take priority over credential helpers and legacy plaintext configuration.
|
|
108
|
-
-
|
|
113
|
+
- Provider usage is normalized as input, output, and total tokens.
|
|
109
114
|
|
|
110
|
-
###
|
|
115
|
+
### Security
|
|
111
116
|
|
|
112
|
-
-
|
|
113
|
-
- Split
|
|
114
|
-
- Non-interactive split mode fails closed before auto-staging detected sensitive files.
|
|
115
|
-
- Split-plan messages are sanitized before terminal display and commit execution.
|
|
117
|
+
- Sensitive untracked files are detected before non-interactive staging.
|
|
118
|
+
- Split previews avoid symbolic links and sanitize generated messages before display or commit.
|
|
116
119
|
|
|
117
|
-
##
|
|
120
|
+
## 1.0.0 - 2026-08-24
|
|
118
121
|
|
|
119
122
|
### Added
|
|
120
123
|
|
|
121
|
-
- Conventional
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
[Unreleased]: https://github.com/hi-fullmoon/AICommit/compare/
|
|
127
|
-
[
|
|
128
|
-
[1.
|
|
129
|
-
[1.
|
|
130
|
-
[1.1.0]: https://github.com/hi-fullmoon/AICommit/compare/v1.0.0...v1.1.0
|
|
131
|
-
[1.0.0]: https://github.com/hi-fullmoon/AICommit/releases/tag/v1.0.0
|
|
124
|
+
- Added Conventional Commit generation in Chinese or English through OpenAI-compatible providers.
|
|
125
|
+
- Added interactive staging, editing, regeneration, dry-run, reasoning display, and connection checks.
|
|
126
|
+
- Added file-level split planning and execution with Git-state concurrency checks.
|
|
127
|
+
- Added provider presets and user/project configuration boundaries.
|
|
128
|
+
|
|
129
|
+
[Unreleased]: https://github.com/hi-fullmoon/AICommit/compare/v2.0.0...HEAD
|
|
130
|
+
[2.0.0]: https://github.com/hi-fullmoon/AICommit/releases/tag/v2.0.0
|
|
131
|
+
[1.5.1]: https://github.com/hi-fullmoon/AICommit/releases/tag/v1.5.1
|
|
132
|
+
[1.5.0]: https://github.com/hi-fullmoon/AICommit/releases/tag/v1.5.0
|
package/README.md
CHANGED
|
@@ -4,22 +4,35 @@
|
|
|
4
4
|
|
|
5
5
|
AI-powered git commit message generator: reads your diff, asks an AI model for a conventional commit message, and commits after your confirmation.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Usage preview
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
These screenshots were captured from real interactive terminal sessions in this repository. Provider, model, paths, and timings reflect the environment at capture time.
|
|
10
|
+
|
|
11
|
+
### Configure a provider interactively
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
### Diagnose configuration and connectivity
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
### Generate a commit message
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
### Review the generated commit message
|
|
24
|
+
|
|
25
|
+

|
|
12
26
|
|
|
13
|
-
|
|
27
|
+
## Install
|
|
14
28
|
|
|
15
29
|
```bash
|
|
16
|
-
|
|
17
|
-
brew install hi-fullmoon/aicommit/aicommit
|
|
30
|
+
npm install --global @hifullmoon/aicommit
|
|
18
31
|
```
|
|
19
32
|
|
|
20
33
|
Requires Node.js >= 18.
|
|
21
34
|
|
|
22
|
-
See the bilingual [installation, upgrade, signature-verification, and rollback guide](docs/distribution.md).
|
|
35
|
+
See the bilingual [installation, upgrade, signature-verification, and rollback guide](docs/distribution.md). The npm package has an automated installation smoke test.
|
|
23
36
|
|
|
24
37
|
To install a source checkout instead, run `npm install --global .` from the repository root.
|
|
25
38
|
|
|
@@ -31,7 +44,7 @@ The fastest way is the interactive wizard:
|
|
|
31
44
|
aicommit setup
|
|
32
45
|
```
|
|
33
46
|
|
|
34
|
-
It walks you through picking a provider from the active versioned preset manifest (bundled presets include OpenAI, DeepSeek, OpenRouter, MiniMax, Kimi Code, and Ollama) or entering a custom OpenAI-compatible endpoint, then entering your API key
|
|
47
|
+
It walks you through picking a provider from the active versioned preset manifest (bundled presets include OpenAI, DeepSeek, OpenRouter, MiniMax, Kimi Code, and Ollama) or entering a custom OpenAI-compatible endpoint, then entering your API key and one or more models, choosing a default model and commit language, and optionally testing the connection. Configuration is written atomically to the user config (`~/.aicommit.config.json`); a malformed or old-format existing file is backed up before replacement.
|
|
35
48
|
|
|
36
49
|
To configure by hand, start from [.aicommit.config.example.json](.aicommit.config.example.json). User config is loaded first, then allow-listed generation preferences from `./.aicommit.config.json` are deep-merged over it. Project config may set `language`, `commitPolicy`, `stripFiles`, `temperature`, and lower diff/token/timeout or repository-context ceilings. A project-owned `prompt` is ignored unless the user config explicitly sets `allowProjectPrompt: true`. Connection/provider fields (including `apiKeyEnv`), reasoning request controls, unknown keys, and attempts to raise a ceiling are ignored with a warning. This prevents a cloned repository from redirecting an authenticated request or silently increasing its cost/data scope.
|
|
37
50
|
|
|
@@ -39,56 +52,59 @@ To keep a key out of the JSON file, set `"apiKeyEnv": "OPENAI_API_KEY"` (and lea
|
|
|
39
52
|
|
|
40
53
|
AICommit can also read from the Git credential helper already configured on your OS. Enable `credentialHelper.enabled`, store the provider credential through your normal Git/OS credential workflow, and AICommit will call `git credential fill` without prompting. The lookup username defaults to `aicommit` and can be changed with `credentialHelper.username`. Credential resolution order is environment variable → Git credential helper → plaintext user config → keyless localhost. A project config cannot enable a helper or select a credential source.
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
Each provider owns one or more named model profiles. Switch providers with `-p` / `--provider` and models within that provider with `-m` / `--model`:
|
|
43
56
|
|
|
44
57
|
```json
|
|
45
58
|
{
|
|
59
|
+
"schemaVersion": 1,
|
|
46
60
|
"defaultProvider": "minimax",
|
|
47
|
-
|
|
48
61
|
"providers": {
|
|
49
62
|
"minimax": {
|
|
50
63
|
"providerType": "minimax",
|
|
51
64
|
"apiUrl": "https://api.minimaxi.com/v1/chat/completions",
|
|
52
65
|
"apiKeyEnv": "MINIMAX_API_KEY",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
66
|
+
"defaultModel": "default",
|
|
67
|
+
"models": {
|
|
68
|
+
"default": {
|
|
69
|
+
"label": "MiniMax M3",
|
|
70
|
+
"modelId": "MiniMax-M3",
|
|
71
|
+
"extraBody": {
|
|
72
|
+
"thinking": { "type": "disabled" },
|
|
73
|
+
"reasoning_split": true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
57
76
|
}
|
|
58
77
|
},
|
|
59
78
|
"deepseek": {
|
|
60
79
|
"providerType": "deepseek",
|
|
61
80
|
"apiUrl": "https://api.deepseek.com/v1/chat/completions",
|
|
62
81
|
"apiKeyEnv": "DEEPSEEK_API_KEY",
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"apiKeyEnv": "OPENROUTER_API_KEY",
|
|
69
|
-
"modelId": "openai/gpt-4o-mini"
|
|
70
|
-
},
|
|
71
|
-
"kimi-code": {
|
|
72
|
-
"providerType": "custom",
|
|
73
|
-
"apiUrl": "https://api.kimi.com/coding/v1/chat/completions",
|
|
74
|
-
"apiKeyEnv": "KIMI_API_KEY",
|
|
75
|
-
"modelId": "kimi-for-coding"
|
|
82
|
+
"defaultModel": "chat",
|
|
83
|
+
"models": {
|
|
84
|
+
"chat": { "modelId": "deepseek-v4-flash" },
|
|
85
|
+
"reasoner": { "modelId": "deepseek-v4-pro" }
|
|
86
|
+
}
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
```
|
|
80
91
|
|
|
81
|
-
|
|
92
|
+
`schemaVersion`, `defaultProvider`, `providers`, and every provider's `providerType`, `apiUrl`, `defaultModel`, and non-empty `models` map are required. Without `-p`, AICommit selects `defaultProvider`; without `-m`, it selects that provider's `defaultModel`. Model profiles inherit global generation settings and provider connection settings, then may override `temperature`, `maxTokens`, `timeoutMs`, `reasoning`, and `extraBody`. Provider and model names are stable local aliases; `modelId` is the identifier sent to the API.
|
|
93
|
+
|
|
94
|
+
This is the only supported user-config shape. Earlier flat or provider-level `modelId` configurations are rejected; run `aicommit setup` or migrate them explicitly.
|
|
82
95
|
|
|
83
96
|
| Key | Description |
|
|
84
97
|
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
98
|
+
| `schemaVersion` | Required user-config schema version; currently `1` |
|
|
99
|
+
| `providers` | Named provider configs; each contains connection settings, `defaultModel`, and a non-empty `models` map |
|
|
100
|
+
| `defaultProvider` | Required provider alias used when `-p` is not given |
|
|
87
101
|
| `apiUrl` | OpenAI-compatible chat completions endpoint |
|
|
88
102
|
| `apiKey` | API key (empty string allowed for local models) |
|
|
89
103
|
| `apiKeyEnv` | Environment variable containing the API key; takes precedence over `apiKey` (default: empty) |
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
104
|
+
| `providerType` | Required adapter: `openai`, `openrouter`, `deepseek`, `minimax`, `ollama`, `custom`, or a user-installed `extension:<id>` |
|
|
105
|
+
| `defaultModel` | Required model alias used when `-m` is not given |
|
|
106
|
+
| `models` | Named model profiles under one provider |
|
|
107
|
+
| `modelId` | Required API model identifier inside each model profile |
|
|
92
108
|
| `commitPolicy` | Versioned commit rules for types, scope, subject length, body, breaking changes, and language |
|
|
93
109
|
| `prompt` | Optional user-approved guidance appended to the authoritative structured policy (default: empty) |
|
|
94
110
|
| `allowProjectPrompt` | User-owned opt-in for accepting `prompt` from project config (default: `false`) |
|
|
@@ -108,8 +124,8 @@ The selected provider's values are deep-merged over the top-level keys, so share
|
|
|
108
124
|
| `diffContextLines` | Context lines around each diff hunk (`git diff --unified=<n>`); lower values mean fewer tokens (default: `1`) |
|
|
109
125
|
| `stripFiles` | Extra files to stub out of the diff like lock files, matched by basename with `*`/`?` wildcards, e.g. `["*.min.js", "*.map", "*.snap"]` (default: `[]`; project-level entries are merged with user-level ones, not replaced) |
|
|
110
126
|
| `regenerateWithDiff` | `true` re-sends the full diff on every regenerate for more varied rewrites; `false` (default) only asks the model to reword its previous message, which is far cheaper |
|
|
111
|
-
| `extraBody` |
|
|
112
|
-
| `reasoning` |
|
|
127
|
+
| `extraBody` | Model-profile JSON fields merged into the request body, except `model`/`messages` (default: `{}`) |
|
|
128
|
+
| `reasoning` | Global or model-profile reasoning controls: `mode`, `effort`, `maxTokens`, and `maxDisplayChars`; defaults to `mode: "on"` and streams reasoning automatically |
|
|
113
129
|
|
|
114
130
|
Works with OpenAI, DeepSeek, [OpenRouter](https://openrouter.ai), MiniMax, [Kimi Code](https://www.kimi.com/code/docs/), Ollama (native `/api/chat` or OpenAI-compatible `/v1/chat/completions`), LiteLLM, and other compatible endpoints. HTTPS is required for remote endpoints; plaintext HTTP is accepted only for localhost/loopback.
|
|
115
131
|
|
|
@@ -123,13 +139,17 @@ export KIMI_API_KEY='your-kimi-code-api-key'
|
|
|
123
139
|
|
|
124
140
|
```json
|
|
125
141
|
{
|
|
142
|
+
"schemaVersion": 1,
|
|
126
143
|
"defaultProvider": "kimi-code",
|
|
127
144
|
"providers": {
|
|
128
145
|
"kimi-code": {
|
|
129
146
|
"providerType": "custom",
|
|
130
147
|
"apiUrl": "https://api.kimi.com/coding/v1/chat/completions",
|
|
131
148
|
"apiKeyEnv": "KIMI_API_KEY",
|
|
132
|
-
"
|
|
149
|
+
"defaultModel": "default",
|
|
150
|
+
"models": {
|
|
151
|
+
"default": { "modelId": "kimi-for-coding" }
|
|
152
|
+
}
|
|
133
153
|
}
|
|
134
154
|
}
|
|
135
155
|
}
|
|
@@ -259,15 +279,15 @@ aicommit stats # show local quality, latency, and token trends
|
|
|
259
279
|
aicommit stats clear # permanently clear local metric history
|
|
260
280
|
aicommit # generate & commit in current directory
|
|
261
281
|
aicommit /path/to/repo # or a target directory
|
|
262
|
-
aicommit split
|
|
263
|
-
aicommit split
|
|
264
|
-
aicommit split
|
|
265
|
-
aicommit split
|
|
282
|
+
aicommit split # choose staged/all scope, then split logical commits
|
|
283
|
+
aicommit split --scope=staged # split only the reviewed index snapshot
|
|
284
|
+
aicommit split --scope=all # split the complete working-tree snapshot
|
|
285
|
+
aicommit split --scope=staged --split-hunks # experimental same-file hunk splitting
|
|
266
286
|
aicommit --dry-run # generate and review without creating a commit
|
|
267
|
-
aicommit split
|
|
287
|
+
aicommit split --dry-run # review a split plan without creating commits
|
|
268
288
|
aicommit --yes # non-interactively commit already staged changes
|
|
269
289
|
aicommit --yes --dry-run # non-interactively preview all changes; restores staging
|
|
270
|
-
aicommit split
|
|
290
|
+
aicommit split --scope=all --yes # non-interactively plan and commit all working-tree changes
|
|
271
291
|
aicommit split plan --scope=staged --file=/tmp/split-plan.json --yes
|
|
272
292
|
aicommit split apply --file=/tmp/split-plan.json --yes
|
|
273
293
|
aicommit split resume --yes # resume an interrupted split transaction
|
|
@@ -276,6 +296,7 @@ aicommit --reasoning=low # stream low-effort reasoning; Ctrl+O expands/collapses
|
|
|
276
296
|
aicommit --no-reasoning # explicitly disable reasoning when supported
|
|
277
297
|
aicommit -l zh # commit message language
|
|
278
298
|
aicommit -p deepseek # switch to the "deepseek" provider
|
|
299
|
+
aicommit -p deepseek -m reasoner # use its "reasoner" model profile
|
|
279
300
|
aicommit --yes --output=json # emit one schema-validated JSON result on stdout
|
|
280
301
|
aicommit -h # help
|
|
281
302
|
```
|
|
@@ -284,8 +305,9 @@ aicommit -h # help
|
|
|
284
305
|
| ------------------ | ---------------------------------------------------------------------------- |
|
|
285
306
|
| `-l`, `--lang` | Commit message language (`zh` or `en`) |
|
|
286
307
|
| `-p`, `--provider` | Use the named provider from `providers` |
|
|
308
|
+
| `-m`, `--model` | Use a named model profile from the selected provider |
|
|
287
309
|
| `--split-hunks` | Opt in to experimental same-file text-hunk planning; disabled by default |
|
|
288
|
-
| `--scope` | `staged` or `all` scope for `aicommit split
|
|
310
|
+
| `--scope` | `staged` or `all` scope for `aicommit split` and `aicommit split plan` |
|
|
289
311
|
| `--file` | JSON plan path for `aicommit split plan` and `aicommit split apply` |
|
|
290
312
|
| `--dry-run` | Generate and review a message or split plan without creating commits |
|
|
291
313
|
| `-y`, `--yes` | Accept without prompts; normal mode requires explicitly staged changes |
|
|
@@ -297,7 +319,7 @@ aicommit -h # help
|
|
|
297
319
|
|
|
298
320
|
### Configuration inspection
|
|
299
321
|
|
|
300
|
-
`aicommit config show|validate|path` can run outside a repository and accepts an optional target directory. `show` applies the same user/project/team-policy trust filtering and provider selection as commit generation, but recursively masks secrets. `validate` parses, merges, and validates configuration without reading environment credentials or invoking Git credential helpers, making `aicommit config validate --output=json` safe for CI. `path` reports user config, project config, and team-policy locations even when a config file is malformed. `show` and `validate` accept `--provider=<name>`.
|
|
322
|
+
`aicommit config show|validate|path` can run outside a repository and accepts an optional target directory. `show` applies the same user/project/team-policy trust filtering and provider/model selection as commit generation, but recursively masks secrets. `validate` parses, merges, and validates configuration without reading environment credentials or invoking Git credential helpers, making `aicommit config validate --output=json` safe for CI. `path` reports user config, project config, and team-policy locations even when a config file is malformed. `show` and `validate` accept `--provider=<name>` and `--model=<name>`.
|
|
301
323
|
|
|
302
324
|
### Shell completion
|
|
303
325
|
|
|
@@ -358,11 +380,11 @@ Stable process exits are shared by text and JSON modes:
|
|
|
358
380
|
|
|
359
381
|
### Diagnostics
|
|
360
382
|
|
|
361
|
-
`aicommit doctor` checks the running Node.js and Git versions, loaded config sources, endpoint security, selected adapter capabilities, redacted credential source, and a live provider connection. It prints source labels such as `env:OPENAI_API_KEY`, `git credential helper`, or `keyless localhost`, never the credential value. Endpoint userinfo, credential-like query parameters, and fragments are also redacted from normal output and credential-resolution errors. Use `aicommit doctor -p <
|
|
383
|
+
`aicommit doctor` checks the running Node.js and Git versions, loaded config sources, endpoint security, selected adapter capabilities, redacted credential source, and a live provider connection. It prints source labels such as `env:OPENAI_API_KEY`, `git credential helper`, or `keyless localhost`, never the credential value. Endpoint userinfo, credential-like query parameters, and fragments are also redacted from normal output and credential-resolution errors. Use `aicommit doctor -p <provider> -m <model>` to select a configured provider/model pair or `aicommit doctor --output=json` in automation.
|
|
362
384
|
|
|
363
|
-
For stable error categories,
|
|
385
|
+
For stable error categories, npm verification failures, split recovery, preset compatibility, and extension isolation failures, use the bilingual [troubleshooting matrix](docs/troubleshooting.md).
|
|
364
386
|
|
|
365
|
-
Flow: reads the staged diff, sends it to the AI, then lets you **accept** (Enter), **edit** (`e`), or **cancel** (`n`). If nothing is staged but the working tree has unstaged or untracked changes, aicommit offers to stage them for you — all at once (`git add -A`) or file by file — before continuing. Once anything is staged, that index snapshot is authoritative; other working-tree changes are left untouched.
|
|
387
|
+
Flow: reads the staged diff, sends it to the AI, then lets you **accept** (Enter), **edit** (`e`), or **cancel** (`n`). In interactive selection prompts, `q` exits immediately. If nothing is staged but the working tree has unstaged or untracked changes, aicommit offers to stage them for you — all at once (`git add -A`) or file by file — before continuing. Once anything is staged, that index snapshot is authoritative; other working-tree changes are left untouched.
|
|
366
388
|
|
|
367
389
|
`--dry-run` follows the same review flow but stops before `git commit`. Any staging performed by aicommit is restored before it exits. Cancellation and failures use the same index transaction; if another process changed the index concurrently, aicommit leaves it untouched instead of overwriting that work.
|
|
368
390
|
|
|
@@ -389,7 +411,7 @@ When reasoning mode is `on` (including via `--reasoning=<level>`), aicommit requ
|
|
|
389
411
|
|
|
390
412
|
### Split mode
|
|
391
413
|
|
|
392
|
-
`aicommit split run` asks whether to group the staged index snapshot or all staged, unstaged, and untracked changes into logical commits. Use `--scope=staged` or `--scope=all` when the boundary must be explicit, including every non-interactive run. You can review the plan, regenerate messages for selected groups, or edit the plan as JSON before committing. Extension validation errors are shown with the plan and must be corrected by editing or regenerating before commit. Sensitive-content detection fails closed before a non-interactive provider request or automatic staging.
|
|
414
|
+
`aicommit split` (also available as the explicit `aicommit split run`) asks whether to group the staged index snapshot or all staged, unstaged, and untracked changes into logical commits. Use `--scope=staged` or `--scope=all` when the boundary must be explicit, including every non-interactive run. You can review the plan, regenerate messages for selected groups, or edit the plan as JSON before committing. Extension validation errors are shown with the plan and must be corrected by editing or regenerating before commit. Sensitive-content detection fails closed before a non-interactive provider request or automatic staging.
|
|
393
415
|
|
|
394
416
|
For an auditable two-step flow, `aicommit split plan --scope=staged|all --file=<path>` exports a versioned JSON artifact, and `aicommit split apply --file=<path>` rechecks its base commit, change set, and content fingerprint before touching the index. Keep plan files outside the worktree or under `.git` so they cannot become part of their own plan.
|
|
395
417
|
|
|
@@ -399,7 +421,7 @@ Split remains file-level by default. `--split-hunks` opts in to experimental sam
|
|
|
399
421
|
|
|
400
422
|
## Development and releases
|
|
401
423
|
|
|
402
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for local development and pull-request checks, [SECURITY.md](SECURITY.md) for private vulnerability reporting, [RELEASING.md](RELEASING.md) for the
|
|
424
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local development and pull-request checks, [SECURITY.md](SECURITY.md) for private vulnerability reporting, [RELEASING.md](RELEASING.md) for the maintainer process, and the bilingual [distribution guide](docs/distribution.md) for npm installation and rollback. Releases use npm Trusted Publishing with provenance and publish the exact verified package tarball. `npm run eval` runs the anonymous local quality corpus covering single and mixed changes, renames, generated files, long diffs, Chinese/English output, and malformed weak-model candidates; it is also part of `npm run ci`.
|
|
403
425
|
|
|
404
426
|
## License
|
|
405
427
|
|