gdx 0.2.0 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +56 -26
  2. package/dist/index.js +589 -400
  3. package/package.json +13 -10
package/README.md CHANGED
@@ -100,14 +100,14 @@ To add shell integration, add the following line to the **End** of your shell pr
100
100
  #### For bash and zsh:
101
101
 
102
102
  ```bash
103
- eval "$(gdx --init --shell bash)" # for bash
104
- eval "$(gdx --init --shell zsh)" # for zsh
103
+ eval "$(gdx --init bash)" # for bash
104
+ eval "$(gdx --init zsh)" # for zsh
105
105
  ```
106
106
 
107
107
  #### For fish:
108
108
 
109
109
  ```fish
110
- gdx --init --shell fish | source
110
+ gdx --init fish | source
111
111
  ```
112
112
 
113
113
  #### For PowerShell:
@@ -115,12 +115,12 @@ gdx --init --shell fish | source
115
115
  To find your profile path, run `$PROFILE` in PowerShell.
116
116
 
117
117
  ```powershell
118
- Invoke-Expression (& { (gdx --init --shell pwsh | Out-String) })
118
+ Invoke-Expression (& { (gdx --init pwsh | Out-String) })
119
119
  ```
120
120
 
121
121
  > [!TIP]
122
122
  > You can add `--cmd` to the `gdx --init` command to create custom aliases.
123
- > For example, `gdx --init --shell zsh --cmd g` will create `g` as an alias for `gdx`.
123
+ > For example, `gdx --init zsh --cmd g` will create `g` as an alias for `gdx`.
124
124
 
125
125
  ## Core Features
126
126
 
@@ -139,6 +139,8 @@ gdx reset ~2 # -> git reset HEAD~2
139
139
 
140
140
  > [!NOTE]
141
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.
142
144
 
143
145
  ### 2. Smart Linting
144
146
 
@@ -171,18 +173,41 @@ gdx parallel open # Open any fork in your default editor
171
173
  gdx parallel join # Merge changes from a fork back to main
172
174
  ```
173
175
 
174
- ### 5. Advanced Stash Management
176
+ Additionally, `gdx parallel fork` can auto-initialize submodules and
177
+ install dependencies using detected package managers (currently supports npm, pnpm, bun, and uv)
178
+ if configured (see `parallel.init` config for options),
179
+ getting the fork ready for work in no time.
180
+
181
+ ### 5. Git Output for Human (Experimental)
182
+
183
+ Admit it, Git's default output isn't exactly designed for readability.
184
+ `gdx` enhances the output of some commands with better formatting to make it more enjoyable and less "git" to read.
185
+
186
+ Currently, we only support enhanced formatting for `gdx diff` and `gdx show`,
187
+ but more commands will be added in the future. (feel free to request what commands you'd like to see enhanced!)
188
+
189
+ #### Example: `gdx diff`
190
+
191
+ ![diff example](https://github.com/Type-Delta/gdx/raw/main/resources/images/gdx-diff-enhance.png)
192
+
193
+ > [!NOTE]
194
+ > 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`).
195
+ > If you pipe the output to a file or another command, it will fall back to the standard Git output.
196
+ >
197
+ > If you want to disable the enhanced output altogether, you can set `enhancedOutput` to `false` in the config.
198
+
199
+ ### 6. Advanced Stash Management
175
200
 
176
201
  Git stash is great until you need to clean it up.
177
202
 
178
203
  ```bash
179
204
  gdx sta l # git stash list
180
- gdx sta d 2..6 # Drops stashes 2 through 6.
205
+ gdx sta drop 2..6 # Drops stashes 2 through 6.
181
206
  # (Drops high->low to prevent index shifting)
182
- gdx sta d pardon # Restores the last dropped stash.
207
+ gdx stash d pardon # Restores the last dropped stash.
183
208
  ```
184
209
 
185
- ### 6. AI-Powered Commits
210
+ ### 7. Commits Message Generation
186
211
 
187
212
  Struggling to come up with a commit message? Let `gdx` do it for you.
188
213
 
@@ -191,11 +216,11 @@ gdx commit auto # Generates a commit message based on staged changes, then com
191
216
  # or
192
217
  # Generates a commit message based on staged changes, but does not commit them.
193
218
  # `--copy` also copies the message to clipboard.
194
- gdx commit auto --no-commit --copy
219
+ gdx cmi auto --no-commit --copy
195
220
  # You can also configure which LLM to use with `gdx-config`
196
221
  ```
197
222
 
198
- ### 7. Fun & Analytics
223
+ ### 8. Fun & Analytics
199
224
 
200
225
  Tools to help you feel productive without leaving the terminal.
201
226
 
@@ -203,19 +228,25 @@ Tools to help you feel productive without leaving the terminal.
203
228
  - **`gdx graph`**: Renders a GitHub-style contribution heatmap in your terminal using TrueColor.
204
229
  - **`gdx nocap`**: Uses AI to roast your latest commit message.
205
230
 
231
+ #### Example: `gdx stats`
232
+
233
+ ![stats example](https://github.com/Type-Delta/gdx/raw/main/resources/images/gdx-stats.png)
234
+
206
235
  ## Command Reference
207
236
 
208
- | Command | Expansion / Function |
209
- | :----------- | :-------------------------------------------------- |
210
- | `s`, `stat` | `git status` |
211
- | `lg`, `lo` | `git log --oneline --graph --all --decorate` |
212
- | `sw`, `swit` | `git switch` |
213
- | `br`, `bra` | `git branch` |
214
- | `cmi`, `com` | `git commit` (Try `gdx cmi auto` for AI messages!) |
215
- | `res` | `git reset` (supports `res ~3`, `res -h` expansion) |
216
- | `sta`, `st` | `git stash` |
217
- | `lint` | Run pre-push checks (spelling, secrets, etc.) |
218
- | `gdx-config` | Manage gdx configuration |
237
+ | Command | Expansion / Function |
238
+ | :----------- | :----------------------------------------------------------------- |
239
+ | `s`, `stat` | `git status` (use `-r` recursively run "status" on all submodules) |
240
+ | `lg`, `lo` | `git log --oneline --graph --all --decorate` |
241
+ | `sw`, `swit` | `git switch` |
242
+ | `br`, `bra` | `git branch` |
243
+ | `cmi`, `com` | `git commit` (Try `gdx cmi auto` for AI messages!) |
244
+ | `res` | `git reset` (supports `res ~3`, `res -h` expansion) |
245
+ | `dif` | `git diff` (supports `dif ~3`, `dif origin ~2` expansion) |
246
+ | `sho` | `git show` (supports `sho ~3`, `sho origin ~2` expansion) |
247
+ | `sta`, `st` | `git stash` |
248
+ | `lint` | Run pre-push checks (spelling, secrets, etc.) |
249
+ | `gdx-config` | Manage gdx configuration |
219
250
 
220
251
  _Run `gdx ghelp` to see the full list of expansions._
221
252
 
@@ -241,10 +272,8 @@ This project uses **Bun** for development because it's fast and the developer ex
241
272
 
242
273
  Since this is currently a solo "scratch your own itch" project, the roadmap is fluid, but here is what is on the horizon:
243
274
 
244
- - [x] **Configurability:** Allow users to define their own shorthands in a `.gdxrc.toml` file.
275
+ - [x] **Configurability:** Allow users to define their own shorthands in a `.gdxrc.toml` file (default: `~/.gdx/.gdxrc.toml`).
245
276
  - [x] **Shell Integration:** Auto-completion scripts for Zsh/Bash/Fish/Powershell with git fallback.
246
- - [ ] **Commit with specified editor:** like, `gdx commit --vim` to open Vim for commit messages.
247
- - [ ] **Quick commit:** `add`, `commit`, and `push` in one command like `gdx qc -pa` (`git add . && gdx commit auto && git push`)
248
277
  - [x] **Quick linting before push:** `gdx lint` to run following checks before pushing:
249
278
  - commit message spelling
250
279
  - env or sensitive content scanning
@@ -252,13 +281,14 @@ Since this is currently a solo "scratch your own itch" project, the roadmap is f
252
281
  - abnormal file sizes
253
282
  with an option to automatically run lint before every push (bypass with `gdx push --no-lint`)
254
283
  - [x] **Undoable stash drop**
255
- - [x] **Parallel worktree switching** `gdx parallel switch` Jump between forks (auto-cd) (requires shell integration with `gdx --init --shell`)
284
+ - [x] **Parallel worktree switching** `gdx parallel switch` Jump between forks (auto-cd) (requires shell integration with `gdx --init`)
256
285
  - [ ] **Seamless Integration with fzf and cloc**
257
286
  automatically detect and use fzf and/or cloc if installed for:
258
287
  - Interactive fuzzy search for branches, commits, stash, log and files instead of `less`
259
288
  - Code line statistics in `gdx stats` using `cloc`
260
289
  - [x] **gdx clear Untracked files support**: `gdx clear` now automatically backs up untracked files in the patch.
261
290
  - [ ] **gdx migrate**: move dirty changes to another branch/worktree without committing.
291
+ - [x] **Recursive status for submodules** with `gdx status --recursive` or `gdx s -r`
262
292
 
263
293
  ## License
264
294