@jerryshell/aicommits 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +62 -0
  3. package/dist/cli.mjs +338 -0
  4. package/package.json +47 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) Hassan El Mghari
4
+ Copyright (c) 2026-present Jerry
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @jerryshell/aicommits
2
+
3
+ AI-powered git commit message generator. Fork of [nutlope/aicommits](https://github.com/nutlope/aicommits).
4
+
5
+ ## What's different from upstream
6
+
7
+ - **Structured output** — Uses Zod schemas + `Output.object()` to enforce JSON responses, eliminating parsing fragility from free-text LLM output.
8
+ - **No reasoning tokens** — All LLM calls set `reasoning: "none"` to skip thinking/reasoning tokens, saving costs on models that support it.
9
+ - **Large-diff summarization** — Diffs over 30 KB are condensed locally into a per-file skeleton (stat + key declarations) instead of sending truncated raw diff text, cutting tokens ~10× on big commits. Small diffs are sent verbatim.
10
+ - **Bun for dev, Node for prod** — Dev tooling uses Bun (faster builds, oxfmt, oxlint). Production binary targets Node.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm add -g @jerryshell/aicommits
16
+ ```
17
+
18
+ ## Quick start
19
+
20
+ ```bash
21
+ aicommits setup # configure your API endpoint and key, pick a model
22
+ aicommits # generate a commit message from staged changes
23
+ # tip: `aic` works too — same thing, shorter
24
+ ```
25
+
26
+ ## Development
27
+
28
+ ```bash
29
+ git clone https://github.com/jerryshell/aicommits.git
30
+ cd aicommits
31
+ bun install
32
+ bun run build
33
+ bun link
34
+ ```
35
+
36
+ ## Commands
37
+
38
+ | Command | Description |
39
+ | ------------------ | ------------------------------------------- |
40
+ | `aicommits` | Generate commit message from staged changes |
41
+ | `aicommits setup` | Configure API endpoint and key |
42
+ | `aicommits model` | Select or change AI model |
43
+ | `aicommits pr` | Generate PR from branch diff |
44
+ | `aicommits config` | View/edit config |
45
+ | `aicommits hook` | Install git hooks |
46
+
47
+ ## Flags
48
+
49
+ | Flag | Description |
50
+ | ----------------------- | ------------------------------------------------------------------------------- |
51
+ | `-g, --generate <n>` | Number of messages to generate |
52
+ | `-t, --type <format>` | Format: `plain`, `conventional`, `conventional+body`, `gitmoji`, `subject+body` |
53
+ | `-a, --all` | Auto-stage all tracked changes |
54
+ | `-y, --yes` | Skip confirmation |
55
+ | `-c, --clipboard` | Copy message to clipboard instead of committing |
56
+ | `-n, --no-verify` | Bypass pre-commit hooks |
57
+ | `-p, --prompt <text>` | Custom prompt for the LLM |
58
+ | `-x, --exclude <files>` | Files to exclude from AI analysis |
59
+
60
+ ## Providers
61
+
62
+ Any OpenAI-compatible endpoint works — OpenAI, Groq, xAI, Together, Ollama, LM Studio, vLLM, or a custom server. `aicommits setup` asks for the base URL and API key; no per-provider presets or hardcoded defaults. Local endpoints (e.g. Ollama) can use an empty API key.