chore: bump version to 0.9.1 - CLI UX refinements (branch list, aliases)
This commit is contained in:
+49
-29
@@ -341,22 +341,22 @@ program.command('help', { isDefault: true })
|
|||||||
{
|
{
|
||||||
title: '🤖 AI & Core Workflow',
|
title: '🤖 AI & Core Workflow',
|
||||||
cmds: [
|
cmds: [
|
||||||
{ name: 'g s', desc: 'Status with AI insights' },
|
{ name: 'g s | status', desc: 'Status with AI insights' },
|
||||||
{ name: 'g o', desc: 'Auto-stage + AI commit + Push' },
|
{ name: 'g o | online', desc: 'Auto-stage + AI commit + Push' },
|
||||||
{ name: 'g l', desc: 'Auto-stage + AI commit (local)' },
|
{ name: 'g l | local', desc: 'Auto-stage + AI commit (local)' },
|
||||||
{ name: 'g r', desc: 'AI Code Review detected changes' },
|
{ name: 'g r | review', desc: 'AI Code Review detected changes' },
|
||||||
{ name: 'g sg', desc: 'Get AI message suggestions' },
|
{ name: 'g sg | suggest', desc: 'Get AI message suggestions' },
|
||||||
{ name: 'g int', desc: 'Interactive commit wizard' }
|
{ name: 'g int | interactive', desc: 'Interactive commit wizard' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '🔄 Sync & Maintenance',
|
title: '🔄 Sync & Maintenance',
|
||||||
cmds: [
|
cmds: [
|
||||||
{ name: 'g sp', desc: 'Safe pull (stash -> pull -> pop)' },
|
{ name: 'g sp | safe-pull', desc: 'Safe pull (stash -> pull -> pop)' },
|
||||||
{ name: 'g sync', desc: 'Smart sync (pull + rebase/merge)' },
|
{ name: 'g sync', desc: 'Smart sync (pull + rebase/merge)' },
|
||||||
{ name: 'g fix', desc: 'Fix branch sync issues' },
|
{ name: 'g f | fix', desc: 'Fix branch sync issues' },
|
||||||
{ name: 'g main', desc: 'Switch to main & pull latest' },
|
{ name: 'g main', desc: 'Switch to main & pull latest' },
|
||||||
{ name: 'g clean', desc: 'Remove dead local branches' },
|
{ name: 'g clean | cleanup', desc: 'Remove dead local branches' },
|
||||||
{ name: 'g del', desc: 'Delete branch (local + remote)' },
|
{ name: 'g del', desc: 'Delete branch (local + remote)' },
|
||||||
{ name: 'g pull', desc: 'Standard git pull' },
|
{ name: 'g pull', desc: 'Standard git pull' },
|
||||||
{ name: 'g push', desc: 'Standard git push' }
|
{ name: 'g push', desc: 'Standard git push' }
|
||||||
@@ -365,47 +365,47 @@ program.command('help', { isDefault: true })
|
|||||||
{
|
{
|
||||||
title: '📜 History & Inspection',
|
title: '📜 History & Inspection',
|
||||||
cmds: [
|
cmds: [
|
||||||
{ name: 'g ls', desc: 'Compact commit history' },
|
{ name: 'g ls | list', desc: 'Compact commit history' },
|
||||||
{ name: 'g ll', desc: 'Detailed commit history' },
|
{ name: 'g ll | largelist', desc: 'Detailed commit history' },
|
||||||
{ name: 'g last', desc: 'Show last commit diff' },
|
{ name: 'g last', desc: 'Show last commit diff' },
|
||||||
{ name: 'g t', desc: 'Show commits made today' },
|
{ name: 'g t | today', desc: 'Show commits made today' },
|
||||||
{ name: 'g stats', desc: 'Personal commit statistics' },
|
{ name: 'g stats', desc: 'Personal commit statistics' },
|
||||||
{ name: 'g w', desc: 'Show system identity (whoami)' },
|
{ name: 'g w | whoami', desc: 'Show system identity' },
|
||||||
{ name: 'g p', desc: 'Preview commit message' }
|
{ name: 'g p | preview', desc: 'Preview commit message' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '📦 Stashing & Work-in-Progress',
|
title: '📦 Stashing & Work-in-Progress',
|
||||||
cmds: [
|
cmds: [
|
||||||
{ name: 'g ss', desc: 'Quick stash save' },
|
{ name: 'g ss | stash-save', desc: 'Quick stash save' },
|
||||||
{ name: 'g pop', desc: 'Pop latest stash' },
|
{ name: 'g pop | stash-pop', desc: 'Pop latest stash' },
|
||||||
{ name: 'g stash', desc: 'Enhanced stash management' },
|
{ name: 'g stash', desc: 'Enhanced stash management' },
|
||||||
{ name: 'g wip', desc: 'Quick work-in-progress commit' },
|
{ name: 'g wip', desc: 'Quick work-in-progress commit' },
|
||||||
{ name: 'g split', desc: 'Split large changesets' },
|
{ name: 'g split', desc: 'Split large changesets' },
|
||||||
{ name: 'g us', desc: 'Unstage all files' },
|
{ name: 'g us | unstage', desc: 'Unstage all files' },
|
||||||
{ name: 'g x', desc: 'Discard all changes' }
|
{ name: 'g x | discard', desc: 'Discard all changes' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '🌿 Branching & Undo',
|
title: '🌿 Branching & Undo',
|
||||||
cmds: [
|
cmds: [
|
||||||
{ name: 'g b', desc: 'Create branch from commit' },
|
{ name: 'g b | branch', desc: 'List or create branches' },
|
||||||
{ name: 'g u', desc: 'Undo last commit' },
|
{ name: 'g u | undo', desc: 'Undo last commit' },
|
||||||
{ name: 'g a', desc: 'Amend last commit' },
|
{ name: 'g a | amend', desc: 'Amend last commit' },
|
||||||
{ name: 'g rs', desc: 'Reset branch to commit' },
|
{ name: 'g rs | reset', desc: 'Reset branch to commit' },
|
||||||
{ name: 'g rv', desc: 'Revert commit safely' },
|
{ name: 'g rv | revert', desc: 'Revert commit safely' },
|
||||||
{ name: 'g conflicts', desc: 'Resolve merge conflicts' }
|
{ name: 'g conflicts', desc: 'Resolve merge conflicts' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '🔧 Config & Utilities',
|
title: '🔧 Config & Utilities',
|
||||||
cmds: [
|
cmds: [
|
||||||
{ name: 'g v', desc: 'S4 Version management' },
|
{ name: 'g v | version', desc: 'S4 Version management' },
|
||||||
{ name: 'g setup', desc: 'Run setup wizard' },
|
{ name: 'g setup', desc: 'Run setup wizard' },
|
||||||
{ name: 'g config', desc: 'Manage configuration' },
|
{ name: 'g config', desc: 'Manage configuration' },
|
||||||
{ name: 'g init', desc: 'Initialize new repo' },
|
{ name: 'g init', desc: 'Initialize new repo' },
|
||||||
{ name: 'g clone', desc: 'Clone a repository' },
|
{ name: 'g clone', desc: 'Clone a repository' },
|
||||||
{ name: 'g m', desc: 'Commit with custom message' }
|
{ name: 'g m | commit', desc: 'Commit with custom message' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -1005,11 +1005,31 @@ program.command('history').alias('h')
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
program.command('branch <c> [name]').alias('b')
|
program.command('branch [c] [name]').alias('b')
|
||||||
.description('Branch from commit/index')
|
.description('List branches or branch from commit/index')
|
||||||
.action(async (c, name) => {
|
.action(async (c, name) => {
|
||||||
await ensureRepo();
|
await ensureRepo();
|
||||||
try { const sha = await resolveCommit(c); const br = name || `branch-${sha.slice(0, 7)}`; await git.checkout(['-b', br, sha]); console.log(`Switched to branch ${br} at ${sha}`); }
|
try {
|
||||||
|
if (!c) {
|
||||||
|
// List branches
|
||||||
|
const branches = await git.branchLocal();
|
||||||
|
console.log(color.bold('\n🌿 Local Branches:\n'));
|
||||||
|
branches.all.forEach(b => {
|
||||||
|
if (b === branches.current) {
|
||||||
|
console.log(` ${color.green('* ' + b)}`);
|
||||||
|
} else {
|
||||||
|
console.log(` ${b}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log('');
|
||||||
|
} else {
|
||||||
|
// Create branch
|
||||||
|
const sha = await resolveCommit(c);
|
||||||
|
const br = name || `branch-${sha.slice(0, 7)}`;
|
||||||
|
await git.checkout(['-b', br, sha]);
|
||||||
|
console.log(`Switched to branch ${br} at ${sha}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (e) { handleError('Branch error', e); }
|
catch (e) { handleError('Branch error', e); }
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1589,7 +1609,7 @@ program.command('last')
|
|||||||
|
|
||||||
// ===== SMART SYNC FIX COMMAND =====
|
// ===== SMART SYNC FIX COMMAND =====
|
||||||
|
|
||||||
program.command('fix')
|
program.command('fix').alias('f')
|
||||||
.description('Smart fix for branch sync issues (diverged, behind, ahead)')
|
.description('Smart fix for branch sync issues (diverged, behind, ahead)')
|
||||||
.option('--local', 'Keep local changes, force push to remote')
|
.option('--local', 'Keep local changes, force push to remote')
|
||||||
.option('--remote', 'Keep remote changes, discard local')
|
.option('--remote', 'Keep remote changes, discard local')
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gims",
|
"name": "gims",
|
||||||
"version": "0.9.0",
|
"version": "0.9.1",
|
||||||
"description": "Git Made Simple – AI‑powered git helper with smart insights, stats & code review",
|
"description": "Git Made Simple – AI‑powered git helper with smart insights, stats & code review",
|
||||||
"author": "S41R4J",
|
"author": "S41R4J",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
Reference in New Issue
Block a user