@rafaeelricco/commit-tools 0.1.2 → 0.1.4
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 +112 -53
- package/dist/index.js +239 -239
- package/dist/index.js.map +10 -10
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,110 +1,169 @@
|
|
|
1
1
|
# commit-tools
|
|
2
2
|
|
|
3
|
-
[](#)
|
|
3
|
+
[](#)
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
Writing good commit messages _can_ have a high cognitive cost, especially when you make dozens of commits a day. That energy should be directed toward solving hard problems and shipping features, not summarizing them.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
into your terminal to generate high-quality git commit messages. It provides
|
|
10
|
-
lightweight access to Gemini, giving you the most direct path from your staged
|
|
11
|
-
changes to a meaningful, well-formatted commit message.
|
|
7
|
+
Because of this exhaustion, most commits end up lacking context or good names. This makes it incredibly painful to find out _why_ a change was made months later if you don't have a perfect memory.
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
While built-in IDE tools (like Cursor, VSCode, or Windsurf) offer basic AI commit generation, they are often inconsistent, lack deep customization, and lock you into their ecosystem.
|
|
14
10
|
|
|
15
|
-
-
|
|
16
|
-
- **Flexible Conventions**: Choose between conventional commits (`feat:`, `fix:`), imperative style (`add`, `fix`), or create your own custom template.
|
|
17
|
-
- **Multiple Authentication Options**: Sign in with your Google account via OAuth, or use a Gemini API key.
|
|
18
|
-
- **Built-in System Checks**: Easily verify your installation, environment, and authentication token validity using the `doctor` command.
|
|
19
|
-
- **Terminal-first**: Designed for developers who live in the command line and prefer rapid, keyboard-driven workflows.
|
|
11
|
+
**commit-tools** is different. We built the only commit assistant that truly understands your workflow needs:
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
- **Maximum control**: Fine-tune your commits. Demand detailed descriptions, specific formatting, or keep it perfectly brief.
|
|
14
|
+
- **Provider freedom**: Bring your own API keys or use your existing subscriptions. We support exactly the LLM you want to use.
|
|
15
|
+
- **Universal access**: Works seamlessly anywhere you use the terminal, regardless of what IDE you happen to be in.
|
|
16
|
+
- **Crystal-clear history**: Never lose context again. A readable, well-documented commit tree makes it effortless to track down past decisions.
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
## Quick Install
|
|
19
|
+
|
|
20
|
+
**Prerequisites:** commit-tools requires the [Bun](https://bun.sh) runtime.
|
|
24
21
|
|
|
25
22
|
```bash
|
|
26
|
-
|
|
27
|
-
bun link
|
|
23
|
+
curl -fsSL https://bun.sh/install | bash
|
|
28
24
|
```
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
```bash
|
|
27
|
+
bun install -g @rafaeelricco/commit-tools
|
|
28
|
+
# or
|
|
29
|
+
npm install -g @rafaeelricco/commit-tools
|
|
30
|
+
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
## Commit Convention Examples
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**Conventional Commits**
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
```
|
|
37
|
+
feat: add model command for selecting AI model
|
|
38
|
+
```
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
```
|
|
41
|
+
refactor(config): decouple storage and auth logic
|
|
39
42
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
+
- Separate authentication credentials from configuration storage.
|
|
44
|
+
- Introduce `AuthCredentials` type to replace raw API key passing.
|
|
45
|
+
- Update `loadConfig` and setup flow to accept a `Dependencies` object.
|
|
46
|
+
```
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
**Imperative Style**
|
|
45
49
|
|
|
46
|
-
```
|
|
47
|
-
|
|
50
|
+
```
|
|
51
|
+
Add fuzzy search to model selector
|
|
48
52
|
```
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
```
|
|
55
|
+
Refactor commit flow into a class structure
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
- Extract `CommitFlow` class with dedicated methods for each step.
|
|
58
|
+
- Move loading spinner logic to a separate module.
|
|
59
|
+
- Update `interactionLoop` to use structured context.
|
|
60
|
+
```
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
**Custom Template**
|
|
63
|
+
|
|
64
|
+
Define your own format during `commit setup` to match your team's guidelines:
|
|
65
|
+
|
|
66
|
+
_Template:_
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
[JIRA-<ticket_number>] <gitmoji> <type>(<scope>): <subject>
|
|
70
|
+
|
|
71
|
+
<optional body>
|
|
72
|
+
|
|
73
|
+
Co-authored-by: <team_name>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
_Output:_
|
|
55
77
|
|
|
56
|
-
```
|
|
57
|
-
|
|
78
|
+
```
|
|
79
|
+
[JIRA-402] ✨ feat(ui): add model selection command
|
|
80
|
+
|
|
81
|
+
- Implemented fuzzy search for easier discovery.
|
|
82
|
+
- Added a fallback when no models are available.
|
|
83
|
+
|
|
84
|
+
Co-authored-by: frontend-team
|
|
58
85
|
```
|
|
59
86
|
|
|
60
87
|
## Getting Started
|
|
61
88
|
|
|
62
|
-
###
|
|
89
|
+
### 1. Setup
|
|
63
90
|
|
|
64
|
-
Configure your
|
|
91
|
+
Configure your provider, authentication method, and commit convention:
|
|
65
92
|
|
|
66
93
|
```bash
|
|
67
|
-
commit
|
|
94
|
+
commit setup
|
|
68
95
|
```
|
|
69
96
|
|
|
70
|
-
|
|
97
|
+
You will be prompted to choose:
|
|
98
|
+
|
|
99
|
+
- **Auth method**: OAuth (sign in with your account) or BYOK (paste your own API key)
|
|
100
|
+
- **Commit convention**: Conventional, Imperative, or Custom
|
|
71
101
|
|
|
72
|
-
|
|
102
|
+
To re-authenticate at any time:
|
|
73
103
|
|
|
74
104
|
```bash
|
|
75
|
-
|
|
105
|
+
commit login
|
|
76
106
|
```
|
|
77
107
|
|
|
78
|
-
|
|
108
|
+
### 2. Select a Model
|
|
109
|
+
|
|
110
|
+
After setup, you can switch AI models from your configured provider at any time:
|
|
79
111
|
|
|
80
112
|
```bash
|
|
81
|
-
commit
|
|
113
|
+
commit model
|
|
82
114
|
```
|
|
83
115
|
|
|
84
|
-
|
|
116
|
+
### 3. Generate a Commit
|
|
117
|
+
|
|
118
|
+
Stage your changes, then run:
|
|
85
119
|
|
|
86
120
|
```bash
|
|
87
|
-
|
|
121
|
+
git add <files> # soon: we will be able to add files using the tool
|
|
122
|
+
commit
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Or explicitly:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
commit generate
|
|
88
129
|
```
|
|
89
130
|
|
|
90
131
|
### System Checks
|
|
91
132
|
|
|
92
|
-
|
|
133
|
+
Verify your installation, environment, and configuration:
|
|
93
134
|
|
|
94
135
|
```bash
|
|
95
|
-
commit
|
|
136
|
+
commit doctor
|
|
96
137
|
```
|
|
97
138
|
|
|
98
|
-
##
|
|
139
|
+
## Commands
|
|
140
|
+
|
|
141
|
+
To see all available commands at any time, run:
|
|
99
142
|
|
|
100
|
-
|
|
143
|
+
```bash
|
|
144
|
+
commit --help
|
|
145
|
+
```
|
|
101
146
|
|
|
102
|
-
|
|
147
|
+
| Command | Description |
|
|
148
|
+
| ------------------------ | ---------------------------------------- |
|
|
149
|
+
| `commit` | Generate a commit message (default) |
|
|
150
|
+
| `commit generate` | Generate a commit message |
|
|
151
|
+
| `commit setup` | Configure authentication and conventions |
|
|
152
|
+
| `commit login` | Alias for setup — re-authenticate |
|
|
153
|
+
| `commit doctor` | Check installation and environment |
|
|
154
|
+
| `commit model` | Select a different AI model |
|
|
155
|
+
| `commit --version`, `-v` | Show version |
|
|
156
|
+
| `commit --help`, `-h` | Show help |
|
|
103
157
|
|
|
104
|
-
|
|
158
|
+
## Providers
|
|
105
159
|
|
|
106
|
-
|
|
160
|
+
Currently powered by **Google Gemini**. More providers are coming soon:
|
|
161
|
+
|
|
162
|
+
- **OpenAI** (GPT-4o, o1, o3, etc.)
|
|
163
|
+
- **Anthropic** (Claude)
|
|
164
|
+
|
|
165
|
+
Contributions and feedback are welcome!
|
|
166
|
+
|
|
167
|
+
## Contributing
|
|
107
168
|
|
|
108
|
-
|
|
109
|
-
Built by the open source community
|
|
110
|
-
</p>
|
|
169
|
+
We welcome contributions! Feel free to report bugs, suggest features, or submit pull requests.
|