diff --git a/QUICK_REFERENCE.md b/QUICK_REFERENCE.md index ffb3cca..2f9b7aa 100644 --- a/QUICK_REFERENCE.md +++ b/QUICK_REFERENCE.md @@ -8,7 +8,9 @@ g i # Interactive - Guided commit wizard g p # Preview - See what will be committed g l # Local - AI commit locally g o # Online - AI commit + push -g h # History - Numbered commit log +g ls # List - Short commit history +g ll # Large List - Detailed commit history +g h # History - Alias for list g a # Amend - Smart amend with AI g u # Undo - Undo last commit ``` @@ -37,8 +39,9 @@ g o # One-command: commit + push g l # Local commit only # 3. View history -g h # Recent commits -g h --detailed --limit 10 # Detailed view +g ls # Recent commits (short) +g ll # Recent commits (detailed) +g h # Same as g ls ``` ## Default AI Models diff --git a/README.md b/README.md index 39ed304..dbd8946 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ g o # AI commit + push | `g i` | Interactive commit wizard | | `g o` | AI commit + push | | `g l` | AI commit locally | -| `g h` | Commit history | +| `g ls` | Commit history (short) | +| `g ll` | Commit history (detailed) | +| `g h` | Commit history (alias for ls) | | `g a` | Smart amend | ## 🤖 AI Models @@ -51,7 +53,7 @@ g o # Quick commit + push # Advanced g sg --multiple # Get 3 AI suggestions -g h --detailed # Detailed history +g ll # Detailed history g sync --rebase # Smart sync ``` diff --git a/bin/gims.js b/bin/gims.js index 9ce7674..bacc885 100755 --- a/bin/gims.js +++ b/bin/gims.js @@ -308,7 +308,9 @@ program.command('help-quick').alias('q') console.log(` ${color.cyan('g p')} Preview - See what will be committed`); console.log(` ${color.cyan('g l')} Local - AI commit locally`); console.log(` ${color.cyan('g o')} Online - AI commit + push`); - console.log(` ${color.cyan('g h')} History - Numbered commit log`); + console.log(` ${color.cyan('g ls')} List - Short commit history`); + console.log(` ${color.cyan('g ll')} Large List - Detailed commit history`); + console.log(` ${color.cyan('g h')} History - Alias for list`); console.log(` ${color.cyan('g a')} Amend - Smart amend with AI`); console.log(` ${color.cyan('g u')} Undo - Undo last commit\n`); @@ -320,7 +322,7 @@ program.command('help-quick').alias('q') console.log(color.bold('Essential Workflow:')); console.log(` ${color.cyan('g s')} Check what's changed`); console.log(` ${color.cyan('g i')} or ${color.cyan('g o')} Commit with AI`); - console.log(` ${color.cyan('g h')} View history\n`); + console.log(` ${color.cyan('g ls')} or ${color.cyan('g h')} View history\n`); console.log(`For full help: ${color.cyan('g --help')}`); console.log(`For detailed docs: See README.md`); @@ -736,9 +738,8 @@ program.command('amend').alias('a') } }); -program.command('list').alias('h') - .description('Numbered git log (oldest → newest)') - .option('--detailed', 'Show detailed information') +program.command('list').alias('ls') + .description('Short numbered git log (oldest → newest)') .option('--limit ', 'Limit number of commits', '20') .action(async (cmdOptions) => { await ensureRepo(); @@ -753,12 +754,7 @@ program.command('list').alias('h') } commits.forEach((c, i) => { - if (cmdOptions.detailed) { - const date = new Date(c.date).toLocaleString(); - console.log(`${color.cyan((i+1).toString())}. ${color.yellow(c.hash.slice(0,7))} | ${color.dim(date)} | ${color.green(c.author_name)} → ${c.message}`); - } else { - console.log(`${color.cyan((i+1).toString())}. ${color.yellow(c.hash.slice(0,7))} ${c.message}`); - } + console.log(`${color.cyan((i+1).toString())}. ${color.yellow(c.hash.slice(0,7))} ${c.message}`); }); if (log.all.length >= limit) { @@ -769,6 +765,61 @@ program.command('list').alias('h') } }); +program.command('largelist').alias('ll') + .description('Detailed numbered git log (oldest → newest)') + .option('--limit ', 'Limit number of commits', '20') + .action(async (cmdOptions) => { + await ensureRepo(); + try { + const limit = parseInt(cmdOptions.limit) || 20; + const log = await git.log({ maxCount: limit }); + const commits = [...log.all].reverse(); + + if (commits.length === 0) { + Progress.info('No commits found'); + return; + } + + commits.forEach((c, i) => { + const date = new Date(c.date).toLocaleString(); + console.log(`${color.cyan((i+1).toString())}. ${color.yellow(c.hash.slice(0,7))} | ${color.dim(date)} | ${color.green(c.author_name)} → ${c.message}`); + }); + + if (log.all.length >= limit) { + console.log(color.dim(`\n... showing last ${limit} commits (use --limit to see more)`)); + } + } catch (e) { + handleError('Largelist error', e); + } + }); + +program.command('history').alias('h') + .description('Numbered git log (alias for list)') + .option('--limit ', 'Limit number of commits', '20') + .action(async (cmdOptions) => { + await ensureRepo(); + try { + const limit = parseInt(cmdOptions.limit) || 20; + const log = await git.log({ maxCount: limit }); + const commits = [...log.all].reverse(); + + if (commits.length === 0) { + Progress.info('No commits found'); + return; + } + + commits.forEach((c, i) => { + console.log(`${color.cyan((i+1).toString())}. ${color.yellow(c.hash.slice(0,7))} ${c.message}`); + }); + + if (log.all.length >= limit) { + console.log(color.dim(`\n... showing last ${limit} commits (use --limit to see more)`)); + } + } catch (e) { + handleError('History error', e); + } + }); + program.command('branch [name]').alias('b') .description('Branch from commit/index') .action(async (c, name) => { diff --git a/package.json b/package.json index 3897467..494fbc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gims", - "version": "0.6.2", + "version": "0.6.3", "description": "Git Made Simple – AI‑powered git helper using Gemini / OpenAI", "author": "S41R4J", "license": "MIT",