@mehmetsagir/git-ai 0.0.18 → 0.0.19

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 (2) hide show
  1. package/README.md +137 -71
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,14 +1,13 @@
1
- # Git AI
1
+ # git-ai
2
2
 
3
- AI-powered git commit tool. Analyzes changes, groups them logically, and creates commits in Conventional Commits format.
3
+ AI-powered git commit tool that analyzes your changes, groups them logically, and creates meaningful commits following the Conventional Commits standard.
4
4
 
5
5
  ## Features
6
6
 
7
- - **Smart Grouping**: Groups related files together by feature
8
- - **Conventional Commits**: Uses standard commit message format (feat, fix, refactor, etc.)
9
- - **All Changes Included**: Handles tracked, untracked, new, and deleted files
10
- - **Safe**: Shows commit plan for approval before committing
11
- - **Stash Viewer**: Browse git stashes in a web UI with syntax highlighting
7
+ - **Smart Commit Grouping** - AI analyzes your changes and groups related files together by feature or purpose
8
+ - **Conventional Commits** - Automatically generates commit messages in standard format (`feat`, `fix`, `refactor`, `chore`, etc.)
9
+ - **Stash Viewer** - Browse and manage git stashes in a beautiful web UI with diff viewer
10
+ - **Safe Workflow** - Always shows a commit plan for your approval before making any changes
12
11
 
13
12
  ## Installation
14
13
 
@@ -18,26 +17,33 @@ npm install -g @mehmetsagir/git-ai
18
17
 
19
18
  ## Setup
20
19
 
20
+ Before using git-ai, you need to configure your OpenAI API key:
21
+
21
22
  ```bash
22
23
  git-ai setup
23
24
  ```
24
25
 
25
- Enter your OpenAI API key when prompted.
26
+ You'll be prompted to enter your OpenAI API key. Get one from [OpenAI Platform](https://platform.openai.com/api-keys).
27
+
28
+ ## Commands
26
29
 
27
- ## Usage
30
+ ### `git-ai commit`
31
+
32
+ Analyze all changes in your repository and create intelligent commits.
28
33
 
29
34
  ```bash
30
35
  git-ai commit
31
36
  ```
32
37
 
33
- The tool will:
34
- 1. Analyze all changes (staged, unstaged, and untracked)
35
- 2. Group related files by feature
36
- 3. Show commit plan for approval
37
- 4. Create commits
38
-
39
- ### Example
38
+ **What it does:**
39
+ 1. Scans all changes (staged, unstaged, and untracked files)
40
+ 2. Sends diff to AI for analysis
41
+ 3. Groups related files together
42
+ 4. Generates commit messages for each group
43
+ 5. Shows you the commit plan for approval
44
+ 6. Creates commits after your confirmation
40
45
 
46
+ **Example output:**
41
47
  ```
42
48
  🤖 Git AI
43
49
 
@@ -73,29 +79,41 @@ Changes:
73
79
  ⚠ Don't forget to push: git push
74
80
  ```
75
81
 
76
- ## Commands
77
-
78
- | Command | Description |
79
- |---------|-------------|
80
- | `git-ai setup` | Configure OpenAI API key |
81
- | `git-ai commit` | Analyze and create commits |
82
- | `git-ai stash` | View git stashes in browser |
83
- | `git-ai reset` | Reset configuration |
82
+ ### `git-ai stash`
84
83
 
85
- ### Stash Viewer
84
+ Open a web-based UI to browse and manage your git stashes.
86
85
 
87
86
  ```bash
88
87
  git-ai stash
89
88
  ```
90
89
 
91
- Opens a browser with a visual interface to view all your git stashes:
92
- - See all stashes with branch, message, and date
93
- - Click to expand and view the full diff
90
+ **Features:**
91
+ - View all stashes in a clean list
92
+ - Click to see changed files and full diff
93
+ - VS Code-style split diff view (Original | Modified)
94
+ - Apply stash to your working directory
95
+ - Delete stashes you no longer need
94
96
  - Syntax highlighting for code changes
95
97
 
98
+ ### `git-ai setup`
99
+
100
+ Configure or update your OpenAI API key.
101
+
102
+ ```bash
103
+ git-ai setup
104
+ ```
105
+
106
+ ### `git-ai reset`
107
+
108
+ Reset all configuration (removes stored API key).
109
+
110
+ ```bash
111
+ git-ai reset
112
+ ```
113
+
96
114
  ## Configuration
97
115
 
98
- Config file: `~/.git-ai/config.json`
116
+ Configuration is stored in `~/.git-ai/config.json`:
99
117
 
100
118
  ```json
101
119
  {
@@ -106,63 +124,111 @@ Config file: `~/.git-ai/config.json`
106
124
  ## Requirements
107
125
 
108
126
  - Node.js >= 14.0.0
109
- - OpenAI API key
110
127
  - Git repository
128
+ - OpenAI API key
111
129
 
112
- ## Changelog
130
+ ## Contributing
113
131
 
114
- ### v0.0.18
115
- **Stash Viewer Improvements**
132
+ Contributions are welcome! Here's how you can help:
116
133
 
117
- - Redesigned UI with navigation pattern (click stash to view details, back button to return)
118
- - VS Code-style split diff view (Original | Modified)
119
- - Added Apply and Delete stash actions
120
- - Toast notifications for action feedback
121
- - Added git-ai branding footer with GitHub link
134
+ ### Development Setup
135
+
136
+ 1. **Clone the repository**
137
+ ```bash
138
+ git clone https://github.com/mehmetsagir/git-ai.git
139
+ cd git-ai
140
+ ```
122
141
 
123
- ### v0.0.16
124
- **Stash Viewer**
142
+ 2. **Install dependencies**
143
+ ```bash
144
+ npm install
145
+ ```
125
146
 
126
- - New `git-ai stash` command
127
- - Browse stashes in a web UI
128
- - View diffs with syntax highlighting
129
- - Click to expand/collapse each stash
147
+ 3. **Build the project**
148
+ ```bash
149
+ npm run build
150
+ ```
130
151
 
131
- ### v0.0.15
132
- **Code Cleanup**
152
+ 4. **Test locally**
153
+ ```bash
154
+ # Run directly
155
+ node bin/git-ai [command]
133
156
 
134
- - Removed 7 unused functions from git.ts (54% smaller)
135
- - Removed unused `createPatch` from hunk-parser.ts
136
- - Cleaned up package.json metadata
137
- - Added `bugs` and `homepage` fields
157
+ # Or link globally
158
+ npm link
159
+ git-ai [command]
160
+ ```
161
+
162
+ ### Project Structure
163
+
164
+ ```
165
+ src/
166
+ ├── index.ts # CLI entry point and command routing
167
+ ├── git.ts # Git operations (using simple-git)
168
+ ├── openai.ts # OpenAI API integration
169
+ ├── commit.ts # Commit workflow logic
170
+ ├── stash.ts # Stash viewer web UI
171
+ ├── config.ts # Configuration management
172
+ ├── setup.ts # Setup wizard
173
+ ├── reset.ts # Reset configuration
174
+ ├── prompts.ts # AI prompts for commit analysis
175
+ ├── types.ts # TypeScript type definitions
176
+ └── utils/
177
+ ├── errors.ts # Error handling utilities
178
+ └── hunk-parser.ts # Diff parsing utilities
179
+ ```
138
180
 
139
- ### v0.0.14
140
- **Major Refactor - Stability Release**
181
+ ### Making Changes
141
182
 
142
- **Added:**
143
- - Catch-all group for files missed by AI grouping
144
- - Support for untracked (new) files in commit analysis
145
- - Robust diff parser with file path validation
183
+ 1. Create a new branch for your feature
184
+ ```bash
185
+ git checkout -b feature/your-feature-name
186
+ ```
146
187
 
147
- **Changed:**
148
- - Simplified to file-based grouping (more reliable than hunk-based)
149
- - Improved error handling throughout
188
+ 2. Make your changes and test them locally
150
189
 
151
- **Removed:**
152
- - User management features (add, list, remove users)
153
- - Editor-based commit message editing
154
- - Update notifier
155
- - Hunk-level commit splitting (caused file corruption issues)
156
- - Summary command
190
+ 3. Build and verify there are no TypeScript errors
191
+ ```bash
192
+ npm run build
193
+ ```
157
194
 
158
- **Fixed:**
159
- - Parser no longer misinterprets diff content as file names
160
- - All changed files now included in commits (no orphaned files)
161
- - No more "corrupt patch" errors
195
+ 4. Commit your changes using conventional commits format
196
+ ```bash
197
+ git commit -m "feat: add new feature"
198
+ ```
162
199
 
163
- ### v0.0.13 and earlier
164
- - Initial releases with experimental hunk-based commit splitting
200
+ 5. Push and create a pull request
201
+ ```bash
202
+ git push origin feature/your-feature-name
203
+ ```
204
+
205
+ ### Commit Message Guidelines
206
+
207
+ We follow [Conventional Commits](https://www.conventionalcommits.org/):
208
+
209
+ - `feat:` - New features
210
+ - `fix:` - Bug fixes
211
+ - `refactor:` - Code changes that neither fix bugs nor add features
212
+ - `chore:` - Maintenance tasks
213
+ - `docs:` - Documentation changes
214
+ - `style:` - Code style changes (formatting, etc.)
215
+ - `test:` - Adding or updating tests
216
+
217
+ ### Reporting Issues
218
+
219
+ Found a bug or have a suggestion? [Open an issue](https://github.com/mehmetsagir/git-ai/issues) with:
220
+
221
+ - Clear description of the problem or suggestion
222
+ - Steps to reproduce (for bugs)
223
+ - Expected vs actual behavior
224
+ - Your environment (Node.js version, OS, etc.)
165
225
 
166
226
  ## License
167
227
 
168
228
  MIT
229
+
230
+ ## Links
231
+
232
+ - [GitHub Repository](https://github.com/mehmetsagir/git-ai)
233
+ - [npm Package](https://www.npmjs.com/package/@mehmetsagir/git-ai)
234
+ - [Report Issues](https://github.com/mehmetsagir/git-ai/issues)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mehmetsagir/git-ai",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "AI-powered git commit tool that analyzes diffs and creates conventional commit messages",
5
5
  "main": "dist/index.js",
6
6
  "bin": {