@jerryshell/aicommits 0.1.6 → 0.2.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 (3) hide show
  1. package/README.md +64 -38
  2. package/dist/cli.mjs +254 -291
  3. package/package.json +29 -20
package/README.md CHANGED
@@ -1,14 +1,8 @@
1
1
  # @jerryshell/aicommits
2
2
 
3
- AI-powered git commit message generator. Fork of [nutlope/aicommits](https://github.com/nutlope/aicommits).
3
+ AI-powered git commit messages. Fork of [nutlope/aicommits](https://github.com/nutlope/aicommits).
4
4
 
5
- ## Features and changes
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 disable reasoning (`reasoning: "none"`, sent as `reasoning_effort: "none"` on OpenAI-compatible endpoints), skipping thinking tokens 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
- - **Interactive editing**: After generation, use the arrow keys to choose `Yes`, `Edit`, or `No`; `Edit` lets you revise the message before committing.
11
- - **Bun for dev, Node for prod**: Dev tooling uses Bun (faster builds, oxfmt, oxlint). Production binary targets Node.
5
+ Requires Node.js 22 or later.
12
6
 
13
7
  ## Install
14
8
 
@@ -19,45 +13,77 @@ npm add -g @jerryshell/aicommits
19
13
  ## Quick start
20
14
 
21
15
  ```bash
22
- aicommits setup # configure your API endpoint and key, pick a model
23
- aicommits # generate a commit message from staged changes
24
- # tip: `aic` works too (same thing, shorter)
16
+ aicommits setup
17
+ git add <files>
18
+ aicommits
25
19
  ```
26
20
 
27
- ## Development
21
+ `aic` is the short alias. `setup` lists the provider presets, fetches models when the endpoint supports it, and writes the endpoint, key when needed, and model to `~/.aicommits`. Ollama and LM Studio need no key.
28
22
 
29
- ```bash
30
- git clone https://github.com/jerryshell/aicommits.git
31
- cd aicommits
32
- bun install
33
- bun run build
34
- bun link
35
- ```
23
+ ## What this fork changes
24
+
25
+ | Area | This fork | Upstream v5 |
26
+ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
27
+ | Generation | Structured-output calls with Zod validation. | Agent loop with file inspection and tool calls. |
28
+ | Large diffs | Condensed into a per-file skeleton before the call. | Chunked diffs with agent inspection. |
29
+ | Providers | URL-based presets: Command Code, OpenAI, Anthropic, Together AI, Groq, xAI, OpenRouter, Ollama, LM Studio, Custom. | Provider config plus Claude Code, Codex, and OpenCode Go subscriptions. |
30
+ | Command Code | Claude models use Anthropic Messages. Other models use chat completions with `json_schema`. Requests omit `reasoning_effort`, and `CMD_ZDR=1` adds the zero-data-retention header. | Not included. |
31
+ | Tooling | Bun, oxlint, oxfmt, Fallow. | pnpm, pkgroll, manten, semantic-release. |
32
+
33
+ This fork does not include upstream's subscription providers, automatic updater, or VS Code extension.
36
34
 
37
35
  ## Commands
38
36
 
39
- | Command | Description |
40
- | ------------------ | ------------------------------------------- |
41
- | `aicommits` | Generate commit message from staged changes |
42
- | `aicommits setup` | Configure API endpoint and key |
43
- | `aicommits model` | Select or change AI model |
44
- | `aicommits pr` | Generate PR from branch diff |
45
- | `aicommits config` | View/edit config |
46
- | `aicommits hook` | Install git hooks |
37
+ | Command | Purpose |
38
+ | ------------------ | ----------------------------------------------------- |
39
+ | `aicommits` | Generate a message from staged changes. |
40
+ | `aicommits setup` | Choose a provider, endpoint, key, model, and format. |
41
+ | `aicommits model` | Change the model. |
42
+ | `aicommits pr` | Generate a pull request title and body from the diff. |
43
+ | `aicommits config` | Read or write config values. |
44
+ | `aicommits hook` | Install or remove the Git hook. |
45
+ | `aicommits update` | Update the global install. |
47
46
 
48
47
  ## Flags
49
48
 
50
- | Flag | Description |
51
- | ----------------------- | ------------------------------------------------------------------------------- |
52
- | `-g, --generate <n>` | Number of messages to generate |
53
- | `-t, --type <format>` | Format: `plain`, `conventional`, `conventional+body`, `gitmoji`, `subject+body` |
54
- | `-a, --all` | Auto-stage all tracked changes |
55
- | `-y, --yes` | Skip confirmation |
56
- | `-c, --clipboard` | Copy message to clipboard instead of committing |
57
- | `-n, --no-verify` | Bypass pre-commit hooks |
58
- | `-p, --prompt <text>` | Custom prompt for the LLM |
59
- | `-x, --exclude <files>` | Files to exclude from AI analysis |
49
+ | Flag | Purpose |
50
+ | ----------------------- | --------------------------------------------------------------------------- |
51
+ | `-g, --generate <n>` | Number of messages to generate. |
52
+ | `-t, --type <format>` | `plain`, `conventional`, `conventional+body`, `gitmoji`, or `subject+body`. |
53
+ | `--description` | Add a body to plain or conventional messages. |
54
+ | `-a, --all` | Stage tracked changes. |
55
+ | `-y, --yes` | Skip confirmation. |
56
+ | `-c, --clipboard` | Copy the result instead of committing. |
57
+ | `-n, --no-verify` | Bypass pre-commit hooks. |
58
+ | `-p, --prompt <text>` | Add instructions for the model. |
59
+ | `-x, --exclude <files>` | Exclude files from the diff. |
60
+ | `-v, --version` | Print the version. |
61
+
62
+ Unknown flags pass to `git commit`.
63
+
64
+ ## Configuration
65
+
66
+ `aicommits config` prints configured values. `aicommits config set key=value` writes them to `~/.aicommits`.
67
+
68
+ Keys: `OPENAI_BASE_URL`, `OPENAI_API_KEY`, `OPENAI_MODEL`, `type`, `locale`, `max-length`, `max-output-tokens`, `timeout`.
69
+
70
+ The base URL selects the provider preset. There is no separate provider key.
60
71
 
61
72
  ## Providers
62
73
 
63
- 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.
74
+ `aicommits setup` offers presets for Command Code, OpenAI, Anthropic, Together AI, Groq, xAI, OpenRouter, Ollama, LM Studio, and Custom. Preset definitions live in `src/utils/providers.ts`.
75
+
76
+ Command Code routes Claude models to Anthropic Messages. Other models use chat completions with `response_format: json_schema`. Requests omit `reasoning_effort`, and `CMD_ZDR=1` adds the zero-data-retention header.
77
+
78
+ ## Development
79
+
80
+ ```bash
81
+ bun install
82
+ bun run verify
83
+ ```
84
+
85
+ `verify` runs format check, lint, type check, and tests. Integration tests skip when their API key is missing. `bun run build` writes `dist/cli.mjs`.
86
+
87
+ ## License
88
+
89
+ MIT