@snapcommit/cli 2.2.0 → 2.2.1
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.
|
@@ -53,16 +53,17 @@ async function executeCursorStyle(userInput) {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
const input = userInput.toLowerCase().trim();
|
|
56
|
-
//
|
|
56
|
+
// COMMIT/PUSH: Always use AI for commit messages (like Cursor!)
|
|
57
57
|
if (input.includes('commit') || input.includes('push') || input.includes('save')) {
|
|
58
58
|
await handleCommitAndPush();
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
//
|
|
61
|
+
// OTHER OPERATIONS: Branch, merge, rebase, GitHub, etc.
|
|
62
62
|
await handleComplexCommand(userInput);
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Commit and push - ALWAYS uses AI for commit messages (like Cursor!)
|
|
66
|
+
* Fast, clean, no prompts - just generates and commits
|
|
66
67
|
*/
|
|
67
68
|
async function handleCommitAndPush() {
|
|
68
69
|
const status = (0, git_1.getGitStatus)();
|
|
@@ -79,10 +80,10 @@ async function handleCommitAndPush() {
|
|
|
79
80
|
console.log(chalk_1.default.red(`❌ ${error.message}\n`));
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
|
-
// Generate AI commit message
|
|
83
|
+
// Generate AI commit message (THE CORE FEATURE!)
|
|
83
84
|
const diff = (0, git_1.getGitDiff)(true);
|
|
84
85
|
const commitMessage = await generateCommitMessage(diff);
|
|
85
|
-
// Commit
|
|
86
|
+
// Commit with AI-generated message
|
|
86
87
|
try {
|
|
87
88
|
(0, child_process_1.execSync)(`git commit -m "${commitMessage.replace(/"/g, '\\"')}"`, { encoding: 'utf-8', stdio: 'pipe' });
|
|
88
89
|
console.log(chalk_1.default.green(`✓ ${commitMessage.split('\n')[0]}`));
|
|
@@ -91,7 +92,7 @@ async function handleCommitAndPush() {
|
|
|
91
92
|
console.log(chalk_1.default.red(`❌ Commit failed\n`));
|
|
92
93
|
return;
|
|
93
94
|
}
|
|
94
|
-
// Push
|
|
95
|
+
// Push to remote
|
|
95
96
|
try {
|
|
96
97
|
(0, child_process_1.execSync)('git push', { encoding: 'utf-8', stdio: 'pipe' });
|
|
97
98
|
console.log(chalk_1.default.green('✓ Pushed\n'));
|