@rafaeelricco/commit-tools 0.1.2 → 0.1.3

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 CHANGED
@@ -1,110 +1,169 @@
1
1
  # commit-tools
2
2
 
3
- [![Version](https://img.shields.io/badge/version-0.1.0-blue.svg)](#)
4
- [![Built with Bun](https://img.shields.io/badge/Bun-%23000000.svg?logo=bun&logoColor=white)](#)
3
+ [![Version](https://img.shields.io/badge/version-0.1.2-blue.svg)](#)
5
4
 
6
- ![commit-tools Screenshot](./docs/assets/screenshot.png)
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
- commit-tools is an open-source AI assistant that brings the power of Gemini directly
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
- ## Why commit-tools?
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
- - **Interactive Refinement**: Generate, review, adjust, or regenerate commit messages interactively before committing.
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
- ## Installation
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
- ### Install globally with bun
18
+ ## Quick Install
19
+
20
+ **Prerequisites:** commit-tools requires the [Bun](https://bun.sh) runtime.
24
21
 
25
22
  ```bash
26
- # From the project directory
27
- bun link
23
+ curl -fsSL https://bun.sh/install | bash
28
24
  ```
29
25
 
30
- ## Authentication Options
26
+ ```bash
27
+ bun install -g @rafaeelricco/commit-tools
28
+ # or
29
+ npm install -g @rafaeelricco/commit-tools
30
+ ```
31
31
 
32
- Choose the authentication method that best fits your needs:
32
+ ## Commit Convention Examples
33
33
 
34
- ### Option 1: Login with Google (OAuth)
34
+ **Conventional Commits**
35
35
 
36
- **Best for:** Individual developers.
36
+ ```
37
+ feat: add model command for selecting AI model
38
+ ```
37
39
 
38
- **Benefits:**
40
+ ```
41
+ refactor(config): decouple storage and auth logic
39
42
 
40
- - Free tier execution relying on Gemini APIs.
41
- - No API key management - just sign in with your Google account.
42
- - Automatic token refresh handled by the tool.
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
- Run the tool and choose _Google OAuth (recommended)_ when prompted during setup:
48
+ **Imperative Style**
45
49
 
46
- ```bash
47
- commit-tools setup
50
+ ```
51
+ Add fuzzy search to model selector
48
52
  ```
49
53
 
50
- ### Option 2: Gemini API Key
54
+ ```
55
+ Refactor commit flow into a class structure
51
56
 
52
- **Best for:** Developers who prefer API keys or have specific limits.
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
- Run the setup and choose _API Key_, then paste your Gemini API key from Google AI Studio:
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
- ```bash
57
- commit-tools setup
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
- ### Initial Setup
89
+ ### 1. Setup
63
90
 
64
- Configure your preferred authentication and commit convention:
91
+ Configure your provider, authentication method, and commit convention:
65
92
 
66
93
  ```bash
67
- commit-tools setup
94
+ commit setup
68
95
  ```
69
96
 
70
- ### Basic Usage
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
- Stage your changes in your git repository:
102
+ To re-authenticate at any time:
73
103
 
74
104
  ```bash
75
- git add <files>
105
+ commit login
76
106
  ```
77
107
 
78
- Generate a commit message based on your staged changes:
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-tools generate
113
+ commit model
82
114
  ```
83
115
 
84
- Or simply use the default command:
116
+ ### 3. Generate a Commit
117
+
118
+ Stage your changes, then run:
85
119
 
86
120
  ```bash
87
- commit-tools
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
- Check your installation, environment, and configuration status:
133
+ Verify your installation, environment, and configuration:
93
134
 
94
135
  ```bash
95
- commit-tools doctor
136
+ commit doctor
96
137
  ```
97
138
 
98
- ## Contributing
139
+ ## Commands
140
+
141
+ To see all available commands at any time, run:
99
142
 
100
- We welcome contributions! Feel free to report bugs, suggest features, or submit pull requests to help improve the tool.
143
+ ```bash
144
+ commit --help
145
+ ```
101
146
 
102
- ## Legal
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
- - **License**: Open Source.
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
- <p align="center">
109
- Built by the open source community
110
- </p>
169
+ We welcome contributions! Feel free to report bugs, suggest features, or submit pull requests.