gitxplain 0.1.3 → 0.1.6
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/.github/workflows/ci.yml +28 -0
- package/.github/workflows/release.yml +27 -0
- package/IMPLEMENTATION.md +10 -10
- package/README.md +47 -0
- package/cli/index.js +283 -44
- package/cli/services/chatService.js +28 -8
- package/cli/services/gitService.js +45 -3
- package/cli/services/mergeService.js +273 -56
- package/cli/services/outputFormatter.js +2 -36
- package/cli/services/pipelineService.js +721 -0
- package/package.json +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
verify:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
- name: Setup Node.js
|
|
15
|
+
uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: '20'
|
|
18
|
+
cache: npm
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: npm ci
|
|
21
|
+
- name: Lint
|
|
22
|
+
run: npm run lint
|
|
23
|
+
- name: Test
|
|
24
|
+
run: npm test
|
|
25
|
+
- name: Verify package
|
|
26
|
+
env:
|
|
27
|
+
npm_config_cache: ${{ runner.temp }}/npm-cache
|
|
28
|
+
run: npm pack --dry-run
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- 'v*.*.*'
|
|
6
|
+
jobs:
|
|
7
|
+
publish:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
- name: Setup Node.js
|
|
15
|
+
uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: '20'
|
|
18
|
+
cache: npm
|
|
19
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: npm ci
|
|
22
|
+
- name: Test
|
|
23
|
+
run: npm test
|
|
24
|
+
- name: Publish to npm
|
|
25
|
+
env:
|
|
26
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
27
|
+
run: npm publish
|
package/IMPLEMENTATION.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
Successfully implemented two major new features for gitxplain:
|
|
5
|
-
1. **
|
|
5
|
+
1. **GitHub Connection** (`--connect-github`) - Connect GitHub account with Personal Access Token
|
|
6
6
|
2. **Interactive Chat Interface** (`--boot`) - Start a chat session with repository context
|
|
7
7
|
|
|
8
8
|
## New Features
|
|
9
9
|
|
|
10
|
-
### 1.
|
|
10
|
+
### 1. GitHub Connection Feature (`--connect-github`)
|
|
11
11
|
|
|
12
12
|
**Command:**
|
|
13
13
|
```bash
|
|
14
|
-
gitxplain --connect-
|
|
14
|
+
gitxplain --connect-github
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
**Functionality:**
|
|
@@ -39,7 +39,7 @@ gitxplain --boot --provider groq --model llama-3.3-70b-versatile
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
**Functionality:**
|
|
42
|
-
- Requires prior git connection (`gitxplain --connect-
|
|
42
|
+
- Requires prior git connection (`gitxplain --connect-github`)
|
|
43
43
|
- Initializes repository context (commits, branches, status)
|
|
44
44
|
- Launches interactive readline interface
|
|
45
45
|
- Maintains conversation history with LLM
|
|
@@ -75,11 +75,11 @@ gitxplain --boot --provider groq --model llama-3.3-70b-versatile
|
|
|
75
75
|
### 3. Updated CLI (`cli/index.js`)
|
|
76
76
|
|
|
77
77
|
**New Flags:**
|
|
78
|
-
- `--connect-
|
|
78
|
+
- `--connect-github` - Initialize GitHub connection
|
|
79
79
|
- `--boot` - Start interactive chat session
|
|
80
80
|
|
|
81
81
|
**Updated Features:**
|
|
82
|
-
- `parseArgs()` - Now detects `
|
|
82
|
+
- `parseArgs()` - Now detects `connectGitHub` and `boot` flags
|
|
83
83
|
- `handleConnectGit()` - Manages connection workflow
|
|
84
84
|
- `handleBoot()` - Manages chat initialization
|
|
85
85
|
- `printHelp()` - Updated documentation
|
|
@@ -103,7 +103,7 @@ gitxplain --boot --provider groq --model llama-3.3-70b-versatile
|
|
|
103
103
|
|
|
104
104
|
### `README.md`
|
|
105
105
|
- Added new features documentation
|
|
106
|
-
- Added usage examples for `--connect-
|
|
106
|
+
- Added usage examples for `--connect-github` and `--boot`
|
|
107
107
|
- Added section explaining chat commands
|
|
108
108
|
|
|
109
109
|
## Connection Storage
|
|
@@ -127,7 +127,7 @@ gitxplain --boot --provider groq --model llama-3.3-70b-versatile
|
|
|
127
127
|
## Testing
|
|
128
128
|
|
|
129
129
|
✅ All features tested and working:
|
|
130
|
-
1. `--connect-
|
|
130
|
+
1. `--connect-github` successfully saves PAT
|
|
131
131
|
2. Connection file created at correct location
|
|
132
132
|
3. `--boot` checks for existing connection
|
|
133
133
|
4. Help text updated with new commands
|
|
@@ -137,7 +137,7 @@ gitxplain --boot --provider groq --model llama-3.3-70b-versatile
|
|
|
137
137
|
|
|
138
138
|
### Connect to GitHub
|
|
139
139
|
```bash
|
|
140
|
-
gitxplain --connect-
|
|
140
|
+
gitxplain --connect-github
|
|
141
141
|
# Enter your PAT when prompted
|
|
142
142
|
# Output: Git Connected Successfully
|
|
143
143
|
```
|
|
@@ -172,7 +172,7 @@ You: exit
|
|
|
172
172
|
|
|
173
173
|
```
|
|
174
174
|
CLI (index.js)
|
|
175
|
-
├── parseArgs() → detects --connect-
|
|
175
|
+
├── parseArgs() → detects --connect-github, --boot
|
|
176
176
|
├── handleConnectGit()
|
|
177
177
|
│ └── gitConnectionService.js
|
|
178
178
|
│ ├── saveGitConnection()
|
package/README.md
CHANGED
|
@@ -18,8 +18,10 @@ Supported providers:
|
|
|
18
18
|
- Supports AI-assisted commit splitting plans, with optional execution for the latest commit
|
|
19
19
|
- Supports release-branch merge previews driven by detected version bumps in diffs
|
|
20
20
|
- Supports automatic release tagging driven by the same version-bump detection used for release merges
|
|
21
|
+
- Supports release health status checks that show missing tags, unmerged version bumps, branch drift, and next steps
|
|
21
22
|
- Supports AI-assisted commit planning for uncommitted working tree changes
|
|
22
23
|
- Supports quick repository log output for full history inspection
|
|
24
|
+
- Supports repository-aware CI/CD workflow generation for the repo you are currently in
|
|
23
25
|
- Supports single commits, commit ranges, and branch-vs-base comparisons
|
|
24
26
|
- Truncates oversized diffs before sending them to the model and reports that truncation
|
|
25
27
|
- Streams output for supported providers
|
|
@@ -65,22 +67,32 @@ cp .env.example .env
|
|
|
65
67
|
|
|
66
68
|
```bash
|
|
67
69
|
gitxplain help
|
|
70
|
+
gitxplain branch -a
|
|
71
|
+
gitxplain checkout -b feature/demo
|
|
68
72
|
gitxplain commit
|
|
69
73
|
gitxplain --commit
|
|
70
74
|
gitxplain merge
|
|
71
75
|
gitxplain --merge
|
|
72
76
|
gitxplain tag
|
|
73
77
|
gitxplain --tag
|
|
78
|
+
gitxplain release
|
|
79
|
+
gitxplain release status
|
|
74
80
|
gitxplore tag
|
|
75
81
|
gitxplore --tag
|
|
76
82
|
gitxplain log --log
|
|
77
83
|
gitxplain status
|
|
78
84
|
gitxplain --status
|
|
85
|
+
gitxplain pipeline
|
|
86
|
+
gitxplain --pipeline
|
|
79
87
|
gitxplain add README.md
|
|
80
88
|
gitxplain remove README.md
|
|
89
|
+
gitxplain remove hard
|
|
81
90
|
gitxplain del scratch.txt
|
|
91
|
+
gitxplain bin
|
|
82
92
|
gitxplain pop
|
|
83
93
|
gitxplain pop 2
|
|
94
|
+
gitxplain pull
|
|
95
|
+
gitxplain pull origin main
|
|
84
96
|
gitxplain push
|
|
85
97
|
gitxplain push origin main
|
|
86
98
|
gitxplain <commit-id>
|
|
@@ -146,6 +158,8 @@ Then from any Git repository:
|
|
|
146
158
|
|
|
147
159
|
```bash
|
|
148
160
|
gitxplain help
|
|
161
|
+
gitxplain --connect-github <token>
|
|
162
|
+
gitxplain --boot
|
|
149
163
|
gitxplain HEAD~1 --full
|
|
150
164
|
gitxplain a1b2c3d --summary
|
|
151
165
|
gitxplain HEAD~1 --lines
|
|
@@ -153,6 +167,16 @@ gitxplain HEAD~5..HEAD --markdown
|
|
|
153
167
|
gitxplain --branch main --review
|
|
154
168
|
```
|
|
155
169
|
|
|
170
|
+
Inside `gitxplain --boot`, the session now prints the available interactive commands on startup. You can also type `help` at any time to re-display:
|
|
171
|
+
|
|
172
|
+
- `help`
|
|
173
|
+
- `repos`
|
|
174
|
+
- `issues`
|
|
175
|
+
- `status`
|
|
176
|
+
- `download`
|
|
177
|
+
- `clear`
|
|
178
|
+
- `exit`
|
|
179
|
+
|
|
156
180
|
The `gitxplain help` command also prints quick API-key setup examples for:
|
|
157
181
|
|
|
158
182
|
- OpenAI
|
|
@@ -181,9 +205,11 @@ node /home/guru/Dev/gitxplain/cli/index.js HEAD~1 --full
|
|
|
181
205
|
- `--split`: propose how to split a commit into multiple atomic commits
|
|
182
206
|
- `--merge`: preview or execute a merge into the `release` branch based on detected version bumps
|
|
183
207
|
- `--tag`: preview or create release tags from the same detected version windows
|
|
208
|
+
- `release status`: inspect release branch health, missing tags, source-vs-release drift, and the next recommended action
|
|
184
209
|
- `--commit`: propose commits for current uncommitted changes
|
|
185
210
|
- `--log`: print Git log entries for the current repository
|
|
186
211
|
- `--status`: print Git working tree status for the current repository
|
|
212
|
+
- `pipeline` or `--pipeline`: inspect the current repository and generate GitHub Actions CI/CD workflows
|
|
187
213
|
- `--execute`: apply a proposed split by rewriting history
|
|
188
214
|
- `--dry-run`: preview the split or commit plan without applying it
|
|
189
215
|
- `--json`: return structured JSON instead of formatted text
|
|
@@ -211,13 +237,34 @@ Run a few common Git actions directly through `gitxplain`:
|
|
|
211
237
|
gitxplain status
|
|
212
238
|
gitxplain add README.md
|
|
213
239
|
gitxplain remove README.md
|
|
240
|
+
gitxplain remove hard
|
|
214
241
|
gitxplain del scratch.txt
|
|
242
|
+
gitxplain bin
|
|
215
243
|
gitxplain pop
|
|
216
244
|
gitxplain pop 2
|
|
245
|
+
gitxplain pull
|
|
246
|
+
gitxplain pull origin main
|
|
217
247
|
gitxplain push
|
|
218
248
|
gitxplain push origin main
|
|
219
249
|
```
|
|
220
250
|
|
|
251
|
+
For native Git commands that do not have a custom `gitxplain` workflow, use them directly:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
gitxplain branch -a
|
|
255
|
+
gitxplain checkout -b feature/demo
|
|
256
|
+
gitxplain rebase origin/main
|
|
257
|
+
gitxplain worktree list
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
If you want to force native Git for a reserved custom command name, use the `git` wrapper:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
gitxplain git commit -m "native commit message"
|
|
264
|
+
gitxplain git merge feature/demo
|
|
265
|
+
gitxplain git tag -a v1.2.3 -m "release"
|
|
266
|
+
```
|
|
267
|
+
|
|
221
268
|
## Comparison Modes
|
|
222
269
|
|
|
223
270
|
Single commit:
|