youmna-git-glance 2.2.0 → 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.
Files changed (3) hide show
  1. package/README.md +6 -1
  2. package/index.js +24 -10
  3. package/package.json +6 -5
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
- ⭐ **Launch the interactive dashboard**
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
@@ -1,9 +1,11 @@
1
+ #!/usr/bin/env node
1
2
  import { program } from 'commander';
2
3
  import { simpleGit } from 'simple-git';
3
4
  import { GoogleGenerativeAI } from '@google/generative-ai';
4
5
  import 'dotenv/config';
5
- import { primary, success, accent, error, text, createSpinner, createBox, createProgressBar, log, logError } from './utils/ui.js'; // Updated import
6
+ import { primary, success, accent, error, text, createSpinner, createBox, log, logError } from './utils/ui.js';
6
7
  import fs from 'fs';
8
+ import { readFile } from 'fs/promises';
7
9
 
8
10
  const git = simpleGit();
9
11
 
@@ -35,14 +37,20 @@ ${primary.bold('Status:')} ${text(status.files.length + ' files modified')}
35
37
  ${primary.bold('Remote:')} ${text(remote[0]?.refs.fetch || 'None')}
36
38
  `;
37
39
 
38
- log(createBox(stats, { title: '🚀 Youmna Git Dashboard (Hacker Mode)', borderColor: primary.toString() }));
40
+ log(createBox(stats, { title: '🚀 Youmna Git Dashboard (Hacker Mode)', borderColor: 'cyan' }));
39
41
  } catch (err) {
40
42
  spinner.fail(error('Failed to load dashboard.'));
41
43
  logError(err.message);
42
44
  }
43
45
  }
44
46
 
45
- program.name('ygit').version('2.2.0').description('Personal AI Git Assistant powered by Gemini');
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');
46
54
 
47
55
  // 1. AI Commit Suggestion
48
56
  program
@@ -94,10 +102,10 @@ program
94
102
 
95
103
  spinner.stop();
96
104
 
97
- log(createBox(text(result.response.text()), {
98
- title: '🔍 AI Code Review',
99
- borderColor: 'magenta'
100
- }));
105
+ log(createBox(text(result.response.text()), {
106
+ title: '🔍 AI Code Review',
107
+ borderColor: 'magenta'
108
+ }));
101
109
  } catch (err) { spinner.fail(error('Review failed.')); logError(err.message); }
102
110
  });
103
111
 
@@ -183,8 +191,14 @@ program
183
191
  }
184
192
  });
185
193
 
186
- if (!process.argv.slice(2).length) {
187
- showDashboard();
188
- }
194
+
195
+ program.action(() => {
196
+ const options = program.opts();
197
+ if (options.dashboard) {
198
+ showDashboard();
199
+ } else {
200
+ program.help();
201
+ }
202
+ });
189
203
 
190
204
  program.parse(process.argv);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "youmna-git-glance",
4
- "version": "2.2.0",
4
+ "version": "2.2.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/YoumnaSalloum/youmna-git-glance.git"
@@ -11,6 +11,10 @@
11
11
  }
12
12
 
13
13
  ,"description": "AI-powered Git assistant using Google Gemini with advanced features 🦋",
14
+ "type": "module",
15
+ "bin": {
16
+ "ygit": "./index.js"
17
+ },
14
18
  "keywords": [
15
19
  "git",
16
20
  "gemini",
@@ -20,10 +24,7 @@
20
24
  "commit-messages",
21
25
  "merge-conflicts"
22
26
  ],
23
- "type": "module",
24
- "bin": {
25
- "ygit": "./index.js"
26
- },
27
+ "author": "Youmna Salloum",
27
28
  "dependencies": {
28
29
  "@google/generative-ai": "^0.24.1",
29
30
  "boxen": "^7.1.1",