gims 0.5.2 → 0.5.4
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 +25 -1
- package/bin/gims.js +26 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -60,12 +60,35 @@ g o # AI analyzes changes, commits with perfect message, and pushes!
|
|
|
60
60
|
|
|
61
61
|
## 🚀 Quick Start
|
|
62
62
|
|
|
63
|
+
### Prerequisites
|
|
64
|
+
|
|
65
|
+
- Node.js >= 18.18.0 (Node 20+ recommended)
|
|
66
|
+
- npm >= 9
|
|
67
|
+
|
|
68
|
+
Tip: Use nvm to manage Node versions per-user without sudo:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
72
|
+
export NVM_DIR="$HOME/.nvm" && . "$NVM_DIR/nvm.sh"
|
|
73
|
+
nvm install 20 && nvm alias default 20
|
|
74
|
+
```
|
|
75
|
+
|
|
63
76
|
### Installation
|
|
64
77
|
|
|
65
78
|
```bash
|
|
66
79
|
npm install -g gims
|
|
67
80
|
```
|
|
68
81
|
|
|
82
|
+
If you get EACCES permission errors on Linux when installing globally, set a user prefix:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
mkdir -p ~/.npm-global
|
|
86
|
+
npm config set prefix '~/.npm-global'
|
|
87
|
+
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
|
|
88
|
+
source ~/.bashrc
|
|
89
|
+
npm install -g gims
|
|
90
|
+
```
|
|
91
|
+
|
|
69
92
|
### Setup AI (Choose One)
|
|
70
93
|
|
|
71
94
|
**Option 1: OpenAI**
|
|
@@ -109,6 +132,7 @@ g o
|
|
|
109
132
|
| `gims online` | `g o` | AI commit + push (use `--set-upstream` on first push) | `g o --set-upstream` |
|
|
110
133
|
| `gims commit <message...>` | `g m` | Commit with a custom message (no AI) | `g m "fix: handle empty input"` |
|
|
111
134
|
| `gims pull` | `g p` | Pull latest changes | `g p` |
|
|
135
|
+
| `gims amend` | `g a` | Stage all changes and amend the last commit (reuse message) | `g a` |
|
|
112
136
|
| `gims list` | `g ls` | Show numbered commit history | `g ls` |
|
|
113
137
|
| `gims largelist` | `g ll` | Detailed commit history | `g ll` |
|
|
114
138
|
| `gims branch <n>` | `g b` | Branch from commit #n | `g b 3 feature-x` |
|
|
@@ -301,4 +325,4 @@ MIT © [Your Name](https://github.com/yourusername)
|
|
|
301
325
|
|
|
302
326
|
*Made with ❤️ by developers who hate writing commit messages*
|
|
303
327
|
|
|
304
|
-
</div>
|
|
328
|
+
</div>
|
package/bin/gims.js
CHANGED
|
@@ -542,6 +542,32 @@ program.command('pull').alias('p')
|
|
|
542
542
|
catch (e) { handleError('Pull error', e); }
|
|
543
543
|
});
|
|
544
544
|
|
|
545
|
+
program.command('amend').alias('a')
|
|
546
|
+
.description('Stage all changes and amend last commit (no message edit)')
|
|
547
|
+
.action(async () => {
|
|
548
|
+
await ensureRepo();
|
|
549
|
+
try {
|
|
550
|
+
const { all } = await safeLog();
|
|
551
|
+
if (!all || all.length === 0) {
|
|
552
|
+
console.log('No commits to amend. Make an initial commit first.');
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
await git.add('.');
|
|
557
|
+
|
|
558
|
+
const rawDiff = await git.diff(['--cached', '--no-ext-diff']);
|
|
559
|
+
if (!rawDiff.trim()) {
|
|
560
|
+
console.log('No staged changes to amend.');
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
await git.raw(['commit', '--amend', '--no-edit']);
|
|
565
|
+
console.log('Amended last commit with staged changes.');
|
|
566
|
+
} catch (e) {
|
|
567
|
+
handleError('Amend error', e);
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
|
|
545
571
|
program.command('list').alias('ls')
|
|
546
572
|
.description('Short numbered git log (oldest → newest)')
|
|
547
573
|
.action(async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gims",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Git Made Simple – AI‑powered git helper using Gemini / OpenAI",
|
|
5
5
|
"author": "S41R4J",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"homepage": "https://github.com/s41r4j/gims#readme",
|
|
30
30
|
"main": "bin/gims.js",
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
32
|
+
"node": ">=18.18.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@google/genai": "
|
|
35
|
+
"@google/genai": "1.5.1",
|
|
36
36
|
"clipboardy": "^3.0.0",
|
|
37
37
|
"commander": "^11.1.0",
|
|
38
38
|
"openai": "^4.0.0",
|