gdx 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Type-Delta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,254 @@
1
+ # gdx (Git Developer Experience)
2
+
3
+ **The git CLI wrapper that treats you like a human, not a compiler.**
4
+
5
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg) ![Status](https://img.shields.io/badge/status-experimental-orange.svg)
6
+
7
+ > [!WARNING]
8
+ > **⚠️ PRE-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/gdx` (or `./dist/gdx.exe` on Windows).
85
+
86
+ </details>
87
+
88
+ ### Optional: Shell Integration
89
+
90
+ To enable features like `gdx parallel switch` (auto-cd into worktrees), you need to add shell integration.
91
+
92
+ To do this add the following line to the **End** of your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
93
+
94
+ #### For bash and zsh:
95
+
96
+ ```bash
97
+ eval "$(gdx --init --shell bash)" # for bash
98
+ eval "$(gdx --init --shell zsh)" # for zsh
99
+ ```
100
+
101
+ #### For fish:
102
+
103
+ ```fish
104
+ gdx --init --shell fish | source
105
+ ```
106
+
107
+ #### For PowerShell:
108
+
109
+ To find your profile path, run `$PROFILE` in PowerShell.
110
+
111
+ ```powershell
112
+ Invoke-Expression (& { (gdx --init --shell pwsh | Out-String) })
113
+ ```
114
+
115
+ ## Core Features
116
+
117
+ ### 1. Intelligent Shorthands
118
+
119
+ `gdx` isn't just a list of static aliases. It understands partial commands and expands them smartly.
120
+
121
+ ```bash
122
+ gdx s # -> git status
123
+ gdx lg # -> git log --oneline --graph --all --decorate
124
+ gdx lg export # -> Exports git log to a markdown file
125
+ gdx pl -au # -> git pull --allow-unrelated-histories
126
+ gdx ps -fl # -> git push --force-with-lease
127
+ gdx reset ~2 # -> git reset HEAD~2
128
+ ```
129
+
130
+ > [!NOTE]
131
+ > This wrapper forwards unrecognized commands directly to `git`, so you can use it as a full git replacement.
132
+
133
+ ### 2. Smart Linting
134
+
135
+ Catch issues before they reach the remote. `gdx lint` checks for:
136
+
137
+ - Spelling errors in commit messages
138
+ - Conflict markers left in code
139
+ - Sensitive content (keys, tokens)
140
+ - Large files
141
+
142
+ You can configure `gdx` to run this automatically before every push.
143
+
144
+ ### 3. The Safety Net: `clear` vs `reset`
145
+
146
+ We've all accidentally reset files we meant to keep. `gdx clear` is the solution.
147
+
148
+ - **`gdx clear`**: Creates a timestamped patch backup in a temp folder, then effectively runs `reset --hard` & `clean -fd`.
149
+ - **`gdx clear pardon`**: "Wait, I didn't mean to do that." Applies the backup patch and restores your changes.
150
+
151
+ ### 4. Parallel Worktrees (Experimental)
152
+
153
+ Need to work on the **same branch** in multiple isolated environments without checking out new branches?
154
+
155
+ ```bash
156
+ # Manage forked worktrees for the current branch
157
+ gdx parallel fork # Create a new temp-backed fork
158
+ gdx parallel list # See where your forks are
159
+ gdx parallel switch # Switch between forks (requires shell integration)
160
+ gdx parallel open # Open any fork in your default editor
161
+ gdx parallel join # Merge changes from a fork back to main
162
+ ```
163
+
164
+ ### 5. Advanced Stash Management
165
+
166
+ Git stash is great until you need to clean it up.
167
+
168
+ ```bash
169
+ gdx sta l # git stash list
170
+ gdx sta d 2..6 # Drops stashes 2 through 6.
171
+ # (Drops high->low to prevent index shifting)
172
+ ```
173
+
174
+ ### 6. AI-Powered Commits
175
+
176
+ Struggling to come up with a commit message? Let `gdx` do it for you.
177
+
178
+ ```bash
179
+ gdx commit auto # Generates a commit message based on staged changes, then commits them.
180
+ # or
181
+ # Generates a commit message based on staged changes, but does not commit them.
182
+ # `--copy` also copies the message to clipboard.
183
+ gdx commit auto --no-commit --copy
184
+ # You can also configure which LLM to use with `gdx-config`
185
+ ```
186
+
187
+ ### 7. Fun & Analytics
188
+
189
+ Tools to help you feel productive without leaving the terminal.
190
+
191
+ - **`gdx stats`**: Shows fun contribution statistics and metrics for your current repo.
192
+ - **`gdx graph`**: Renders a GitHub-style contribution heatmap in your terminal using TrueColor.
193
+ - **`gdx nocap`**: Uses AI to roast your latest commit message.
194
+
195
+ ## Command Reference
196
+
197
+ | Command | Expansion / Function |
198
+ | :----------- | :-------------------------------------------------- |
199
+ | `s`, `stat` | `git status` |
200
+ | `lg`, `lo` | `git log --oneline --graph --all --decorate` |
201
+ | `sw`, `swit` | `git switch` |
202
+ | `br`, `bra` | `git branch` |
203
+ | `cmi`, `com` | `git commit` (Try `gdx cmi auto` for AI messages!) |
204
+ | `res` | `git reset` (supports `res ~3`, `res -h` expansion) |
205
+ | `sta`, `st` | `git stash` |
206
+ | `lint` | Run pre-push checks (spelling, secrets, etc.) |
207
+ | `gdx-config` | Manage gdx configuration |
208
+
209
+ _Run `gdx ghelp` to see the full list of expansions._
210
+
211
+ ## Development
212
+
213
+ This project uses **Bun** for development because it's fast and the developer experience is great.
214
+
215
+ 1. Clone the repo
216
+ 2. Prepare the development environment:
217
+ ```bash
218
+ bun run prepare-dev
219
+ ```
220
+ 3. Run in dev mode:
221
+
222
+ ```bash
223
+ bun start -- # your gdx commands here
224
+
225
+ # for example:
226
+ bun start -- s # runs `gdx s` (git status)
227
+ ```
228
+
229
+ ## Roadmap
230
+
231
+ Since this is currently a solo "scratch your own itch" project, the roadmap is fluid, but here is what is on the horizon:
232
+
233
+ - [x] **Configurability:** Allow users to define their own shorthands in a `.gdxrc.toml` file.
234
+ - [ ] **Shell Integration:** Auto-completion scripts for Zsh/Bash/Fish/Powershell.
235
+ - [ ] **Commit with specified editor:** like, `gdx commit --vim` to open Vim for commit messages.
236
+ - [ ] **Quick commit:** `add`, `commit`, and `push` in one command like `gdx qc -pa` (`git add . && gdx commit auto && git push`)
237
+ - [x] **Quick linting before push:** `gdx lint` to run following checks before pushing:
238
+ - commit message spelling
239
+ - env or sensitive content scanning
240
+ - conflict markers
241
+ - abnormal file sizes
242
+ with an option to automatically run lint before every push (bypass with `gdx push --no-lint`)
243
+ - [ ] **Undoable stash drop**
244
+ - [x] **Parallel worktree switching** `gdx parallel switch` Jump between forks (auto-cd) (requires shell integration with `gdx --init --shell`)
245
+ - [ ] **Seamless Integration with fzf and cloc**
246
+ automatically detect and use fzf and/or cloc if installed for:
247
+ - Interactive fuzzy search for branches, commits, stash, log and files instead of `less`
248
+ - Code line statistics in `gdx stats` using `cloc`
249
+ - [ ] **gdx clear Untracked files support**: `gdx clear` currently only saves changes to tracked files. Add an option to back up untracked files as well.
250
+ - [ ] **gdx migrate**: move dirty changes to another branch/worktree without committing.
251
+
252
+ ## License
253
+
254
+ MIT © Type-Delta