@snapcommit/cli 1.0.7 → 1.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.
@@ -181,17 +181,11 @@ async function naturalCommand(userInput) {
181
181
  await handleGitHubOperation(intent);
182
182
  return;
183
183
  }
184
- // Show intent (for Git operations)
185
- console.log(chalk_1.default.green(`✨ I understand: ${chalk_1.default.white.bold(intent.action)}\n`));
186
- console.log(chalk_1.default.white('This will:'));
187
- console.log(chalk_1.default.gray(`• ${intent.explanation}\n`));
188
- // Show educational tip
189
- if (intent.educationalTip) {
190
- console.log(chalk_1.default.yellow(`💡 ${intent.educationalTip}\n`));
191
- }
184
+ // Show intent (for Git operations) - simplified
185
+ console.log(chalk_1.default.cyan(`✨ ${intent.explanation}`));
192
186
  // Risk warning
193
187
  if (intent.riskLevel === 'high') {
194
- console.log(chalk_1.default.red('⚠️ Warning: This operation is destructive!\n'));
188
+ console.log(chalk_1.default.red('⚠️ Destructive operation!'));
195
189
  }
196
190
  // Confirmation
197
191
  if (intent.needsConfirmation) {
@@ -206,26 +200,10 @@ async function naturalCommand(userInput) {
206
200
  await handleCommitWithAI();
207
201
  return;
208
202
  }
209
- // Execute git commands with visualization
210
- console.log(chalk_1.default.blue('📟 Running Git commands:\n'));
211
- const result = executeGitCommands(intent.gitCommands, true);
212
- console.log();
203
+ // Execute git commands
204
+ const result = executeGitCommands(intent.gitCommands, false);
213
205
  if (result.success) {
214
- console.log(chalk_1.default.green.bold(`✅ Success! ${intent.action} completed\n`));
215
- // Dopamine hit - show stats/streaks
216
- await showDopamineStats();
217
- // Suggest next actions
218
- const suggestions = (0, git_interpreter_1.suggestNextActions)(intent.action, {
219
- currentBranch,
220
- hasUncommittedChanges,
221
- });
222
- if (suggestions.length > 0) {
223
- console.log(chalk_1.default.white('💡 What\'s next?'));
224
- suggestions.forEach((suggestion) => {
225
- console.log(chalk_1.default.gray(` • ${suggestion}`));
226
- });
227
- console.log();
228
- }
206
+ console.log(chalk_1.default.green(`✅ Done!\n`));
229
207
  (0, analytics_1.trackEvent)({ event: analytics_1.EVENTS.NATURAL_COMMAND_SUCCESS });
230
208
  }
231
209
  else {
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
@@ -97,11 +64,9 @@ async function quickCommand() {
97
64
  console.log(chalk_1.default.red('❌ Not a git repository'));
98
65
  process.exit(1);
99
66
  }
100
- console.log(chalk_1.default.blue('⚡ Quick commit mode...\n'));
101
67
  // Stage all changes
102
68
  try {
103
69
  (0, git_1.stageAllChanges)();
104
- console.log(chalk_1.default.gray('✓ Staged all changes'));
105
70
  }
106
71
  catch (error) {
107
72
  console.log(chalk_1.default.red('❌ Failed to stage changes'));
@@ -125,27 +90,28 @@ async function quickCommand() {
125
90
  diff = diff.substring(0, 40000);
126
91
  }
127
92
  // Generate message
128
- console.log(chalk_1.default.gray(' Generating commit message...'));
93
+ process.stdout.write(chalk_1.default.cyan(' Generating commit... '));
129
94
  let message;
130
95
  let usage;
131
96
  try {
132
97
  const result = await generateCommitMessageAPI(diff, token);
133
98
  message = result.message;
134
99
  usage = result.usage;
100
+ process.stdout.write(chalk_1.default.green('✓\n'));
135
101
  }
136
102
  catch (error) {
103
+ process.stdout.write(chalk_1.default.red('✗\n'));
137
104
  (0, analytics_1.trackEvent)({ event: 'commit_error' });
138
- console.log(chalk_1.default.red(`\n❌ ${error.message}\n`));
105
+ console.log(chalk_1.default.red(`❌ ${error.message}\n`));
139
106
  process.exit(1);
140
107
  }
141
108
  // Show message
142
- console.log(chalk_1.default.green(`✓ ${message.split('\n')[0]}`));
109
+ console.log(chalk_1.default.white(`📝 ${chalk_1.default.bold(message.split('\n')[0])}`));
143
110
  // Commit
144
111
  try {
145
112
  const hash = (0, git_1.commitWithMessage)(message);
146
113
  const stats = (0, git_1.getCommitStats)(hash);
147
- console.log(chalk_1.default.green(`✓ Committed ${hash.substring(0, 7)}`));
148
- console.log(chalk_1.default.gray(` +${stats.insertions} -${stats.deletions} across ${stats.files} files\n`));
114
+ console.log(chalk_1.default.green(`✅ ${hash.substring(0, 7)}`), chalk_1.default.gray(`+${stats.insertions} -${stats.deletions} • ${stats.files} ${stats.files === 1 ? 'file' : 'files'}\n`));
149
115
  // Track event
150
116
  (0, analytics_1.trackEvent)({ event: 'commit_success' });
151
117
  // Log to database
@@ -157,17 +123,9 @@ async function quickCommand() {
157
123
  deletions: stats.deletions,
158
124
  timestamp: Date.now(),
159
125
  });
160
- // Show dopamine stats
161
- try {
162
- const { displayQuickDopamine } = await Promise.resolve().then(() => __importStar(require('../utils/dopamine')));
163
- displayQuickDopamine();
164
- }
165
- catch (error) {
166
- // Optional feature - don't fail if it doesn't work
167
- }
168
126
  }
169
127
  catch (error) {
170
- console.log(chalk_1.default.red('❌ Commit failed'));
128
+ console.log(chalk_1.default.red('\n❌ Commit failed\n'));
171
129
  process.exit(1);
172
130
  }
173
131
  }
package/dist/repl.js CHANGED
@@ -59,12 +59,16 @@ async function startREPL() {
59
59
  console.log(chalk_1.default.gray(' • ') + chalk_1.default.white('Exit SnapCommit: ') + chalk_1.default.cyan('exit') + chalk_1.default.gray(' or ') + chalk_1.default.cyan('quit\n'));
60
60
  // Show GitHub setup reminder if not connected
61
61
  if (!githubConnected) {
62
- console.log(chalk_1.default.yellow('💡 Want GitHub features? (Create PRs, check CI, etc.)\n'));
63
- console.log(chalk_1.default.gray(' Run: ') + chalk_1.default.cyan('snap github connect'));
64
- console.log(chalk_1.default.gray(' You\'ll need a GitHub Personal Access Token (Classic)'));
65
- console.log(chalk_1.default.gray(' Get one at: ') + chalk_1.default.cyan('https://github.com/settings/tokens'));
66
- console.log(chalk_1.default.gray(' Scopes: ') + chalk_1.default.white('repo, workflow, read:user'));
67
- console.log(chalk_1.default.gray(' 💡 Set no expiration or remember to renew!\n'));
62
+ console.log(chalk_1.default.yellow.bold('┌─────────────────────────────────────────┐'));
63
+ console.log(chalk_1.default.yellow.bold('│ 💡 UNLOCK GITHUB FEATURES! │'));
64
+ console.log(chalk_1.default.yellow.bold('└─────────────────────────────────────────┘\n'));
65
+ console.log(chalk_1.default.white(' Create PRs, check CI, manage issues—all with natural language!\n'));
66
+ console.log(chalk_1.default.cyan.bold(' Quick Setup:'));
67
+ console.log(chalk_1.default.gray(' 1. Run: ') + chalk_1.default.cyan('snap github connect'));
68
+ console.log(chalk_1.default.gray(' 2. Get token: ') + chalk_1.default.cyan('https://github.com/settings/tokens'));
69
+ console.log(chalk_1.default.gray(' 3. Scopes needed: ') + chalk_1.default.white('repo, workflow, read:user'));
70
+ console.log(chalk_1.default.gray(' 4. Paste token when prompted'));
71
+ console.log(chalk_1.default.gray(' 💡 Tip: Set no expiration!\n'));
68
72
  }
69
73
  console.log(chalk_1.default.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
70
74
  console.log(chalk_1.default.bold.yellow('🎯 Try it now! Type what you want to do:\n'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcommit/cli",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "Instant AI commits. Beautiful progress tracking. Never write commit messages again.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {