gdx 0.4.0 → 0.4.2
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 +310 -295
- package/dist/index.js +986 -795
- package/dist/index_old.js +1337 -0
- package/package.json +82 -76
package/README.md
CHANGED
|
@@ -1,295 +1,310 @@
|
|
|
1
|
-
# gdx (Git Developer Experience)
|
|
2
|
-
|
|
3
|
-
**The git CLI wrapper that treats you like a human, not a compiler.**
|
|
4
|
-
|
|
5
|
-
 
|
|
6
|
-
|
|
7
|
-
> [!WARNING]
|
|
8
|
-
> **⚠️ ALPHA WARNING:** This project is currently in a "trial phase" (i.e., I'm dogfooding it daily). Expect breaking changes, missing features, and the occasional hiccup.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## What is gdx?
|
|
13
|
-
|
|
14
|
-
`gdx` is a drop-in wrapper for the Git CLI. It doesn't replace Git; it just makes it less... unpleasant.
|
|
15
|
-
|
|
16
|
-
It wraps standard git commands with intelligent shorthands and adds powerful new capabilities that Git is missing like safety rails for destructive actions (undoable `reset --hard`), introduces new workflows for parallel editing and local analytics.
|
|
17
|
-
|
|
18
|
-
**Why gdx?**
|
|
19
|
-
|
|
20
|
-
- **👍 Convenience:** Type less, do more. `git status`? how about `gdx s`?, `git reset HEAD~3`? why not `gdx res ~3`?
|
|
21
|
-
- **🛡️ Safety:** `gdx clear` wipes your directory but saves a backup patch. No more "oops" moments.
|
|
22
|
-
- **🧠 Logic:** Handles the things Git makes hard, like dropping a range of stashes (`drop 2..6`).
|
|
23
|
-
- **📊 Local-First Stats:** Beautiful TrueColor graphs and stats generated from your local history.
|
|
24
|
-
- **🤖 AI Integration:** Generate commit messages and roast your history with local or cloud LLMs.
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
<details expanded>
|
|
29
|
-
<summary><strong>With NPM</strong></summary>
|
|
30
|
-
|
|
31
|
-
### Default (Recommended)
|
|
32
|
-
|
|
33
|
-
Uses the bundled JS version. Works everywhere Node.js 18+ is installed.
|
|
34
|
-
This is the easiest way to get started and ensures maximum compatibility.
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm i -g gdx
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Prebuilt Binary
|
|
41
|
-
|
|
42
|
-
Downloads a precompiled native binary. No runtime dependency on Node/Bun for execution.
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
GDX_USE_PREBUILT=1 npm i -g gdx # bash / zsh
|
|
46
|
-
# or
|
|
47
|
-
$env:GDX_USE_PREBUILT='1'; npm i -g gdx # powershell / fish
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Build Locally
|
|
51
|
-
|
|
52
|
-
Compiles a native binary on your machine during install. Requires [Bun](https://bun.sh) to be installed.
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
GDX_BUILD_NATIVE=1 npm i -g gdx # bash / zsh
|
|
56
|
-
# or
|
|
57
|
-
$env:GDX_BUILD_NATIVE='1'; npm i -g gdx # powershell / fish
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
> [!NOTE] If your environment sets `ignore-scripts=true`, the installation will succeed but default to the Node.js fallback.
|
|
61
|
-
> Run `gdx doctor` to verify your installation status.
|
|
62
|
-
|
|
63
|
-
</details>
|
|
64
|
-
|
|
65
|
-
<details>
|
|
66
|
-
<summary><strong>Download Manually</strong></summary>
|
|
67
|
-
|
|
68
|
-
Prebuilt stand-alone binaries are available on the [Releases](https://github.com/Type-Delta/gdx/releases/download) page.
|
|
69
|
-
|
|
70
|
-
</details>
|
|
71
|
-
|
|
72
|
-
<details>
|
|
73
|
-
<summary><strong>Build it yourself</strong></summary>
|
|
74
|
-
|
|
75
|
-
Requires [Bun](https://bun.sh) to be installed.
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
git clone https://github.com/Type-Delta/gdx.git --depth 1
|
|
79
|
-
cd gdx
|
|
80
|
-
bun install
|
|
81
|
-
bun run build
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Your compiled binary will be in `./dist/` folder.
|
|
85
|
-
|
|
86
|
-
</details>
|
|
87
|
-
|
|
88
|
-
### Optional: Shell Integration
|
|
89
|
-
|
|
90
|
-
To enable features like `gdx parallel switch` (auto-cd into worktrees) and **tab completion**, you need to add shell integration.
|
|
91
|
-
|
|
92
|
-
Shell integration provides:
|
|
93
|
-
|
|
94
|
-
- **Auto-cd support**: Allows `gdx parallel switch` to change directories
|
|
95
|
-
- **Tab completion**: Intelligent completion for gdx commands, shorthands, and git subcommands
|
|
96
|
-
- **
|
|
97
|
-
|
|
98
|
-
To add shell integration, add the following line to the **End** of your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
|
|
99
|
-
|
|
100
|
-
#### For bash and zsh:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
eval "$(gdx --init bash)" # for bash
|
|
104
|
-
eval "$(gdx --init zsh)" # for zsh
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### For fish:
|
|
108
|
-
|
|
109
|
-
```fish
|
|
110
|
-
gdx --init fish | source
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
#### For PowerShell:
|
|
114
|
-
|
|
115
|
-
To find your profile path, run `$PROFILE` in PowerShell.
|
|
116
|
-
|
|
117
|
-
```powershell
|
|
118
|
-
Invoke-Expression (& { (gdx --init pwsh | Out-String) })
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
> [!TIP]
|
|
122
|
-
> You can add `--cmd` to the `gdx --init` command to create custom aliases.
|
|
123
|
-
> For example, `gdx --init zsh --cmd g` will create `g` as an alias for `gdx`.
|
|
124
|
-
|
|
125
|
-
## Core Features
|
|
126
|
-
|
|
127
|
-
### 1. Intelligent Shorthands
|
|
128
|
-
|
|
129
|
-
`gdx` isn't just a list of static aliases. It understands partial commands and expands them smartly.
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
gdx s # -> git status
|
|
133
|
-
gdx lg # -> git log --oneline --graph --all --decorate
|
|
134
|
-
gdx lg export # -> Exports git log to a markdown file
|
|
135
|
-
gdx pl -au # -> git pull --allow-unrelated-histories
|
|
136
|
-
gdx ps -fl # -> git push --force-with-lease
|
|
137
|
-
gdx reset ~2 # -> git reset HEAD~2
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
> [!NOTE]
|
|
141
|
-
> This wrapper forwards unrecognized commands directly to `git`, so you can use it as a full git replacement.
|
|
142
|
-
>
|
|
143
|
-
> If GDX still gets in your way, just run `gdx --bypass <git-commands>` to skip gdx intervention altogether.
|
|
144
|
-
|
|
145
|
-
### 2. Smart Linting
|
|
146
|
-
|
|
147
|
-
Catch issues before they reach the remote. `gdx lint` checks for:
|
|
148
|
-
|
|
149
|
-
- Spelling errors in commit messages
|
|
150
|
-
- Conflict markers left in code
|
|
151
|
-
- Sensitive content (keys, tokens)
|
|
152
|
-
- Large files
|
|
153
|
-
|
|
154
|
-
You can configure `gdx` to run this automatically before every push.
|
|
155
|
-
|
|
156
|
-
### 3. The Safety Net: `clear` vs `reset`
|
|
157
|
-
|
|
158
|
-
We've all accidentally reset files we meant to keep. `gdx clear` is the solution.
|
|
159
|
-
|
|
160
|
-
- **`gdx clear`**: Creates a timestamped patch backup in a temp folder, then effectively runs `reset --hard` & `clean -fd`.
|
|
161
|
-
- **`gdx clear pardon`**: "Wait, I didn't mean to do that." Applies the backup patch and restores your changes.
|
|
162
|
-
|
|
163
|
-
### 4. Parallel Worktrees (Experimental)
|
|
164
|
-
|
|
165
|
-
Need to work on the **same branch** in multiple isolated environments without checking out new branches?
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
# Manage forked worktrees for the current branch
|
|
169
|
-
gdx parallel fork # Create a new temp-backed fork
|
|
170
|
-
gdx parallel list # See where your forks are
|
|
171
|
-
gdx parallel switch # Switch between forks (requires shell integration)
|
|
172
|
-
gdx parallel open # Open any fork in your default editor
|
|
173
|
-
gdx parallel join # Merge changes from a fork back to main
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
>
|
|
197
|
-
>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
gdx
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
#
|
|
219
|
-
|
|
220
|
-
#
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
|
241
|
-
|
|
|
242
|
-
| `
|
|
243
|
-
| `
|
|
244
|
-
| `
|
|
245
|
-
| `
|
|
246
|
-
| `
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
- [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
1
|
+
# gdx (Git Developer Experience)
|
|
2
|
+
|
|
3
|
+
**The git CLI wrapper that treats you like a human, not a compiler.**
|
|
4
|
+
|
|
5
|
+
 
|
|
6
|
+
|
|
7
|
+
> [!WARNING]
|
|
8
|
+
> **⚠️ ALPHA WARNING:** This project is currently in a "trial phase" (i.e., I'm dogfooding it daily). Expect breaking changes, missing features, and the occasional hiccup.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What is gdx?
|
|
13
|
+
|
|
14
|
+
`gdx` is a drop-in wrapper for the Git CLI. It doesn't replace Git; it just makes it less... unpleasant.
|
|
15
|
+
|
|
16
|
+
It wraps standard git commands with intelligent shorthands and adds powerful new capabilities that Git is missing like safety rails for destructive actions (undoable `reset --hard`), introduces new workflows for parallel editing and local analytics.
|
|
17
|
+
|
|
18
|
+
**Why gdx?**
|
|
19
|
+
|
|
20
|
+
- **👍 Convenience:** Type less, do more. `git status`? how about `gdx s`?, `git reset HEAD~3`? why not `gdx res ~3`?
|
|
21
|
+
- **🛡️ Safety:** `gdx clear` wipes your directory but saves a backup patch. No more "oops" moments.
|
|
22
|
+
- **🧠 Logic:** Handles the things Git makes hard, like dropping a range of stashes (`drop 2..6`).
|
|
23
|
+
- **📊 Local-First Stats:** Beautiful TrueColor graphs and stats generated from your local history.
|
|
24
|
+
- **🤖 AI Integration:** Generate commit messages and roast your history with local or cloud LLMs.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
<details expanded>
|
|
29
|
+
<summary><strong>With NPM</strong></summary>
|
|
30
|
+
|
|
31
|
+
### Default (Recommended)
|
|
32
|
+
|
|
33
|
+
Uses the bundled JS version. Works everywhere Node.js 18+ is installed.
|
|
34
|
+
This is the easiest way to get started and ensures maximum compatibility.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm i -g gdx
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Prebuilt Binary
|
|
41
|
+
|
|
42
|
+
Downloads a precompiled native binary. No runtime dependency on Node/Bun for execution.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
GDX_USE_PREBUILT=1 npm i -g gdx # bash / zsh
|
|
46
|
+
# or
|
|
47
|
+
$env:GDX_USE_PREBUILT='1'; npm i -g gdx # powershell / fish
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Build Locally
|
|
51
|
+
|
|
52
|
+
Compiles a native binary on your machine during install. Requires [Bun](https://bun.sh) to be installed.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
GDX_BUILD_NATIVE=1 npm i -g gdx # bash / zsh
|
|
56
|
+
# or
|
|
57
|
+
$env:GDX_BUILD_NATIVE='1'; npm i -g gdx # powershell / fish
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> [!NOTE] If your environment sets `ignore-scripts=true`, the installation will succeed but default to the Node.js fallback.
|
|
61
|
+
> Run `gdx doctor` to verify your installation status.
|
|
62
|
+
|
|
63
|
+
</details>
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary><strong>Download Manually</strong></summary>
|
|
67
|
+
|
|
68
|
+
Prebuilt stand-alone binaries are available on the [Releases](https://github.com/Type-Delta/gdx/releases/download) page.
|
|
69
|
+
|
|
70
|
+
</details>
|
|
71
|
+
|
|
72
|
+
<details>
|
|
73
|
+
<summary><strong>Build it yourself</strong></summary>
|
|
74
|
+
|
|
75
|
+
Requires [Bun](https://bun.sh) to be installed.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
git clone https://github.com/Type-Delta/gdx.git --depth 1
|
|
79
|
+
cd gdx
|
|
80
|
+
bun install
|
|
81
|
+
bun run build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Your compiled binary will be in `./dist/` folder.
|
|
85
|
+
|
|
86
|
+
</details>
|
|
87
|
+
|
|
88
|
+
### Optional: Shell Integration
|
|
89
|
+
|
|
90
|
+
To enable features like `gdx parallel switch` (auto-cd into worktrees) and **tab completion**, you need to add shell integration.
|
|
91
|
+
|
|
92
|
+
Shell integration provides:
|
|
93
|
+
|
|
94
|
+
- **Auto-cd support**: Allows `gdx parallel switch` to change directories
|
|
95
|
+
- **Tab completion**: Intelligent completion for gdx commands, shorthands, and git subcommands
|
|
96
|
+
- **Completion fallback**: Falls back to native git completion when gdx has no suggestions (git fallback requires you to install git's completion scripts separately)
|
|
97
|
+
|
|
98
|
+
To add shell integration, add the following line to the **End** of your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
|
|
99
|
+
|
|
100
|
+
#### For bash and zsh:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
eval "$(gdx --init bash)" # for bash
|
|
104
|
+
eval "$(gdx --init zsh)" # for zsh
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### For fish:
|
|
108
|
+
|
|
109
|
+
```fish
|
|
110
|
+
gdx --init fish | source
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### For PowerShell:
|
|
114
|
+
|
|
115
|
+
To find your profile path, run `$PROFILE` in PowerShell.
|
|
116
|
+
|
|
117
|
+
```powershell
|
|
118
|
+
Invoke-Expression (& { (gdx --init pwsh | Out-String) })
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
> [!TIP]
|
|
122
|
+
> You can add `--cmd` to the `gdx --init` command to create custom aliases.
|
|
123
|
+
> For example, `gdx --init zsh --cmd g` will create `g` as an alias for `gdx`.
|
|
124
|
+
|
|
125
|
+
## Core Features
|
|
126
|
+
|
|
127
|
+
### 1. Intelligent Shorthands
|
|
128
|
+
|
|
129
|
+
`gdx` isn't just a list of static aliases. It understands partial commands and expands them smartly.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
gdx s # -> git status
|
|
133
|
+
gdx lg # -> git log --oneline --graph --all --decorate
|
|
134
|
+
gdx lg export # -> Exports git log to a markdown file
|
|
135
|
+
gdx pl -au # -> git pull --allow-unrelated-histories
|
|
136
|
+
gdx ps -fl # -> git push --force-with-lease
|
|
137
|
+
gdx reset ~2 # -> git reset HEAD~2
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
> [!NOTE]
|
|
141
|
+
> This wrapper forwards unrecognized commands directly to `git`, so you can use it as a full git replacement.
|
|
142
|
+
>
|
|
143
|
+
> If GDX still gets in your way, just run `gdx --bypass <git-commands>` to skip gdx intervention altogether.
|
|
144
|
+
|
|
145
|
+
### 2. Smart Linting
|
|
146
|
+
|
|
147
|
+
Catch issues before they reach the remote. `gdx lint` checks for:
|
|
148
|
+
|
|
149
|
+
- Spelling errors in commit messages
|
|
150
|
+
- Conflict markers left in code
|
|
151
|
+
- Sensitive content (keys, tokens)
|
|
152
|
+
- Large files
|
|
153
|
+
|
|
154
|
+
You can configure `gdx` to run this automatically before every push.
|
|
155
|
+
|
|
156
|
+
### 3. The Safety Net: `clear` vs `reset`
|
|
157
|
+
|
|
158
|
+
We've all accidentally reset files we meant to keep. `gdx clear` is the solution.
|
|
159
|
+
|
|
160
|
+
- **`gdx clear`**: Creates a timestamped patch backup in a temp folder, then effectively runs `reset --hard` & `clean -fd`.
|
|
161
|
+
- **`gdx clear pardon`**: "Wait, I didn't mean to do that." Applies the backup patch and restores your changes.
|
|
162
|
+
|
|
163
|
+
### 4. Parallel Worktrees (Experimental)
|
|
164
|
+
|
|
165
|
+
Need to work on the **same branch** in multiple isolated environments without checking out new branches?
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Manage forked worktrees for the current branch
|
|
169
|
+
gdx parallel fork # Create a new temp-backed fork
|
|
170
|
+
gdx parallel list # See where your forks are
|
|
171
|
+
gdx parallel switch # Switch between forks (requires shell integration)
|
|
172
|
+
gdx parallel open # Open any fork in your default editor
|
|
173
|
+
gdx parallel join # Merge changes from a fork back to main
|
|
174
|
+
gdx parallel sync # Sync forks with the main (origin worktree)
|
|
175
|
+
gdx parallel pick # Cherry-pick a commit from between forks
|
|
176
|
+
gdx parallel remove # Remove a fork when you're done
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Additionally, `gdx parallel fork` can auto-initialize submodules and
|
|
180
|
+
install dependencies using detected package managers (currently supports npm, pnpm, bun, and uv)
|
|
181
|
+
if configured (see `parallel.init` config for options),
|
|
182
|
+
getting the fork ready for work in no time.
|
|
183
|
+
|
|
184
|
+
### 5. Git Output for Human (Experimental)
|
|
185
|
+
|
|
186
|
+
Admit it, Git's default output isn't exactly designed for readability.
|
|
187
|
+
`gdx` enhances the output of some commands with better formatting to make it less "git" to read.
|
|
188
|
+
|
|
189
|
+
Currently, we only support enhanced formatting for `gdx diff` and `gdx show`,
|
|
190
|
+
but more commands will be added in the future. (feel free to request what commands you'd like to see enhanced!)
|
|
191
|
+
|
|
192
|
+
#### Example: `gdx diff`
|
|
193
|
+
|
|
194
|
+

|
|
195
|
+
|
|
196
|
+
> [!NOTE]
|
|
197
|
+
> The enhanced output is only enabled when the output is TTY (i.e., in the terminal) plus other conditions based on the command (e.g., `diff` must be run without `--name-only`).
|
|
198
|
+
> If you pipe the output to a file or another command, it will fall back to the standard Git output.
|
|
199
|
+
>
|
|
200
|
+
> If you want to disable the enhanced output altogether, you can set `enhancedOutput` to `false` in the config.
|
|
201
|
+
|
|
202
|
+
### 6. Advanced Stash Management
|
|
203
|
+
|
|
204
|
+
Git stash is great until you need to clean it up.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
gdx sta l # git stash list
|
|
208
|
+
gdx sta drop 2..6 # Drops stashes 2 through 6.
|
|
209
|
+
# (Drops high->low to prevent index shifting)
|
|
210
|
+
gdx stash d pardon # Restores the last dropped stash.
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 7. Commits Message Generation
|
|
214
|
+
|
|
215
|
+
Struggling to come up with a commit message? Let `gdx` do it for you.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
gdx commit auto # Generates a commit message based on staged changes, then commits them.
|
|
219
|
+
# or
|
|
220
|
+
# Generates a commit message based on staged changes, but does not commit them.
|
|
221
|
+
# `--copy` also copies the message to clipboard.
|
|
222
|
+
gdx cmi auto --no-commit --copy
|
|
223
|
+
# You can also configure which LLM to use with `gdx-config`
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 8. Fun & Analytics
|
|
227
|
+
|
|
228
|
+
Tools to help you feel productive without leaving the terminal.
|
|
229
|
+
|
|
230
|
+
- **`gdx stats`**: Shows fun contribution statistics and metrics for your current repo.
|
|
231
|
+
- **`gdx graph`**: Renders a GitHub-style contribution heatmap in your terminal using TrueColor.
|
|
232
|
+
- **`gdx nocap`**: Uses AI to roast your latest commit message.
|
|
233
|
+
|
|
234
|
+
#### Example: `gdx stats`
|
|
235
|
+
|
|
236
|
+

|
|
237
|
+
|
|
238
|
+
## Command Reference
|
|
239
|
+
|
|
240
|
+
| Command | Expansion / Function |
|
|
241
|
+
| :---------------- | :----------------------------------------------------------------- |
|
|
242
|
+
| `s`, `stat` | `git status` (use `-r` recursively run "status" on all submodules) |
|
|
243
|
+
| `lg`, `lo` | `git log --oneline --graph --all --decorate` |
|
|
244
|
+
| `sw`, `swit` | `git switch` |
|
|
245
|
+
| `br`, `bra` | `git branch` |
|
|
246
|
+
| `cmi`, `com` | `git commit` (Try `gdx cmi auto` for AI messages!) |
|
|
247
|
+
| `res` | `git reset` (supports `res ~3`, `res -h` expansion) |
|
|
248
|
+
| `dif` | `git diff` (supports `dif ~3`, `dif origin ~2` expansion) |
|
|
249
|
+
| `sho` | `git show` (supports `sho ~3`, `sho origin ~2` expansion) |
|
|
250
|
+
| `sta`, `st` | `git stash` |
|
|
251
|
+
| `lint` | Run pre-push checks (spelling, secrets, etc.) |
|
|
252
|
+
| `gdx-config` | Manage gdx configuration |
|
|
253
|
+
| `reword`, `rew` | Rewrite commit messages |
|
|
254
|
+
| `parallel`, `par` | Manage parallel worktrees for the current branch |
|
|
255
|
+
| `stats` | Show contribution statistics and metrics for the current repo |
|
|
256
|
+
| `graph` | Render a GitHub-style contribution heatmap in the terminal |
|
|
257
|
+
| `nocap` | Roast your latest commit message with AI |
|
|
258
|
+
| `clear` | Wipe changes in the working directory with a backup patch |
|
|
259
|
+
| `cache` | Manage gdx cache |
|
|
260
|
+
|
|
261
|
+
_Run `gdx ghelp` to see the full list of expansions._
|
|
262
|
+
|
|
263
|
+
## Development
|
|
264
|
+
|
|
265
|
+
This project uses **Bun** for development because it's fast and the developer experience is great.
|
|
266
|
+
|
|
267
|
+
1. Clone the repo
|
|
268
|
+
2. Prepare the development environment:
|
|
269
|
+
```bash
|
|
270
|
+
bun run prepare-dev
|
|
271
|
+
```
|
|
272
|
+
3. Run in dev mode:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
bun start -- # your gdx commands here
|
|
276
|
+
|
|
277
|
+
# for example:
|
|
278
|
+
bun start -- s # runs `gdx s` (git status)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Roadmap
|
|
282
|
+
|
|
283
|
+
Since this is currently a solo "scratch your own itch" project, the roadmap is fluid, but here is what is on the horizon:
|
|
284
|
+
|
|
285
|
+
- [x] **Configurability:** Allow users to define their own shorthands in a `.gdxrc.toml` file (default: `~/.gdx/.gdxrc.toml`).
|
|
286
|
+
- [x] **Shell Integration:** Auto-completion scripts for Zsh/Bash/Fish/Powershell with git fallback.
|
|
287
|
+
- [x] **Quick linting before push:** `gdx lint` to run following checks before pushing:
|
|
288
|
+
- commit message spelling
|
|
289
|
+
- env or sensitive content scanning
|
|
290
|
+
- conflict markers
|
|
291
|
+
- abnormal file sizes
|
|
292
|
+
with an option to automatically run lint before every push (bypass with `gdx push --no-lint`)
|
|
293
|
+
- [x] **Undoable stash drop**
|
|
294
|
+
- [x] **Parallel worktree switching** `gdx parallel switch` Jump between forks (auto-cd) (requires shell integration with `gdx --init`)
|
|
295
|
+
- [ ] **Seamless Integration with fzf and cloc**
|
|
296
|
+
automatically detect and use fzf and/or cloc if installed for:
|
|
297
|
+
- Interactive fuzzy search for branches, commits, stash, log and files instead of `less`
|
|
298
|
+
- Code line statistics in `gdx stats` using `cloc`
|
|
299
|
+
- [x] **gdx clear Untracked files support**: `gdx clear` now automatically backs up untracked files in the patch.
|
|
300
|
+
- [x] **Recursive status for submodules** with `gdx status --recursive` or `gdx s -r`
|
|
301
|
+
- [x] **Submodule dir switching**: extension of `git submodule`, `gdx submodule switch` to jump into a submodule's directory from the parent repo (requires shell integration)
|
|
302
|
+
- [ ] **Snapshot**: `gdx snap` to create snapshot of current state of your working directory (including uncommitted changes, untracked files) that can be easily switched back to later (similar to a lightweight, temporary branch that doesn't clutter your branch list)
|
|
303
|
+
- [ ] **Enhanced output for more commands**: Extend the "Git Output for Humans"
|
|
304
|
+
- [ ] **Undo and Redo**: `gdx undo` and `gdx redo` to step backward and forward through git actions (reset, commit, stash, etc.) with safety nets.
|
|
305
|
+
- [ ] **Edit commit history**: `gdx hist` for an intuitive interface to amend, reorder, squash commits without needing to remember complex rebase commands.
|
|
306
|
+
- [x] **Edit commit messages**: `gdx reword` to quickly reword the last commit message or a specific commit without needing to do an interactive rebase.
|
|
307
|
+
|
|
308
|
+
## License
|
|
309
|
+
|
|
310
|
+
MIT © Type-Delta
|