youmna-git-glance 2.2.1 → 2.2.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 +6 -1
- package/index.js +23 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,11 +62,16 @@ To use the AI features (Commit, Review, Chat), you need to get a free API Key fr
|
|
|
62
62
|
|
|
63
63
|
Simply type `ygit` to launch the main dashboard, or use these commands:
|
|
64
64
|
|
|
65
|
-
⭐ **
|
|
65
|
+
⭐ **View all available commands**
|
|
66
66
|
```bash
|
|
67
67
|
ygit
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
⭐ **Launch the Hacker Mode Dashboard**
|
|
71
|
+
```bash
|
|
72
|
+
ygit -d
|
|
73
|
+
```
|
|
74
|
+
|
|
70
75
|
⭐ **Generate an AI commit message for staged changes**
|
|
71
76
|
```bash
|
|
72
77
|
ygit commit
|
package/index.js
CHANGED
|
@@ -3,8 +3,9 @@ import { program } from 'commander';
|
|
|
3
3
|
import { simpleGit } from 'simple-git';
|
|
4
4
|
import { GoogleGenerativeAI } from '@google/generative-ai';
|
|
5
5
|
import 'dotenv/config';
|
|
6
|
-
import { primary, success, accent, error, text, createSpinner, createBox,
|
|
6
|
+
import { primary, success, accent, error, text, createSpinner, createBox, log, logError } from './utils/ui.js';
|
|
7
7
|
import fs from 'fs';
|
|
8
|
+
import { readFile } from 'fs/promises';
|
|
8
9
|
|
|
9
10
|
const git = simpleGit();
|
|
10
11
|
|
|
@@ -36,14 +37,20 @@ ${primary.bold('Status:')} ${text(status.files.length + ' files modified')}
|
|
|
36
37
|
${primary.bold('Remote:')} ${text(remote[0]?.refs.fetch || 'None')}
|
|
37
38
|
`;
|
|
38
39
|
|
|
39
|
-
log(createBox(stats, { title: '🚀 Youmna Git Dashboard (Hacker Mode)', borderColor:
|
|
40
|
+
log(createBox(stats, { title: '🚀 Youmna Git Dashboard (Hacker Mode)', borderColor: 'cyan' }));
|
|
40
41
|
} catch (err) {
|
|
41
42
|
spinner.fail(error('Failed to load dashboard.'));
|
|
42
43
|
logError(err.message);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
const pkg = JSON.parse(await readFile(new URL('./package.json', import.meta.url)));
|
|
48
|
+
|
|
49
|
+
program
|
|
50
|
+
.name('ygit')
|
|
51
|
+
.version(pkg.version, '-v, --version')
|
|
52
|
+
.description(pkg.description)
|
|
53
|
+
.option('-d, --dashboard', 'Show the graphical git dashboard');
|
|
47
54
|
|
|
48
55
|
// 1. AI Commit Suggestion
|
|
49
56
|
program
|
|
@@ -95,10 +102,10 @@ program
|
|
|
95
102
|
|
|
96
103
|
spinner.stop();
|
|
97
104
|
|
|
98
|
-
log(createBox(text(result.response.text()), {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}));
|
|
105
|
+
log(createBox(text(result.response.text()), {
|
|
106
|
+
title: '🔍 AI Code Review',
|
|
107
|
+
borderColor: 'magenta'
|
|
108
|
+
}));
|
|
102
109
|
} catch (err) { spinner.fail(error('Review failed.')); logError(err.message); }
|
|
103
110
|
});
|
|
104
111
|
|
|
@@ -184,8 +191,14 @@ program
|
|
|
184
191
|
}
|
|
185
192
|
});
|
|
186
193
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
194
|
+
|
|
195
|
+
program.action(() => {
|
|
196
|
+
const options = program.opts();
|
|
197
|
+
if (options.dashboard) {
|
|
198
|
+
showDashboard();
|
|
199
|
+
} else {
|
|
200
|
+
program.help();
|
|
201
|
+
}
|
|
202
|
+
});
|
|
190
203
|
|
|
191
204
|
program.parse(process.argv);
|