Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5357cbf683 | ||
|
|
593421d9a3 | ||
|
|
56d1631e95 | ||
|
|
9f7522039e | ||
|
|
12021869a9 | ||
|
|
14e5dfa754 | ||
|
|
ffade4e0ab | ||
|
|
bf9b8a010b | ||
|
|
bc10b3a074 | ||
|
|
90559c15a1 |
No files matched your search
@@ -1,6 +1,10 @@
|
||||
<div align="center">
|
||||
|
||||
# 🚀 GIMS - Git Made Simple
|
||||
<!--
|
||||
# GIMS - Git Made Simple
|
||||
-->
|
||||
|
||||
<img width="1658" height="609" alt="gims" src="https://github.com/user-attachments/assets/fd4ae515-9674-4cc2-8ea0-39d21e82e274" />
|
||||
|
||||
[](https://npmjs.org/package/gims)
|
||||
[](https://npmjs.org/package/gims)
|
||||
@@ -77,6 +81,8 @@ g o # That's it. AI handles the rest.
|
||||
| `g oneshot` | `g o` | Stage all → AI commit → Push (full workflow) |
|
||||
| `g local` | `g l` | Stage all → AI commit (no push) |
|
||||
| `g suggest` | `g sg` | Get AI commit message suggestions |
|
||||
| `g version` | `g v` | Manage project version (S4 system) |
|
||||
| `g whoami` | — | Show system identity & version |
|
||||
| `g wip` | — | Quick work-in-progress commit |
|
||||
|
||||
### 📊 Analytics & Review
|
||||
@@ -112,6 +118,25 @@ g o # That's it. AI handles the rest.
|
||||
| `g undo` | `g u` | Undo last commit (keep changes) |
|
||||
| `g delete-branch` | `g del` | Delete branch locally and remotely |
|
||||
|
||||
### 🔢 S4 Versioning (New)
|
||||
|
||||
GIMS now uses the **[S4 Versioning System](https://github.com/s41r4j/s4vs)**, a forensic-grade versioning standard stored entirely in **Git Tags**.
|
||||
|
||||
`MAJOR.MINOR.PATCH-STAGE.BUILD+DATE.TIME.COMMIT.BRANCH`
|
||||
*(e.g., `0.8.2-dev.1+20250129.1305.af8d9c.main`)*
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `g v` | Smart bump (resets build on new day) + Create Tag |
|
||||
| `g v -n` | Dry run (preview next version) |
|
||||
| `g v major` | Force major bump (`1.0.0` → `2.0.0`) |
|
||||
| `g v --list` | List stable releases (hides dev tags) |
|
||||
| `g v --prune` | Delete old `dev` tags (keeps last 10) |
|
||||
| `g v -i` | Version analysis with timestamp |
|
||||
| `g whoami` | Dynamic identity & version banner |
|
||||
|
||||
> **Note:** S4 uses Git Tags as the Single Source of Truth. No `VERSION` file is created. It updates your `.env` version variables if they exist.
|
||||
|
||||
### 🔧 Setup & Config
|
||||
|
||||
| Command | Description |
|
||||
@@ -315,4 +340,4 @@ MIT © [S41R4J](https://github.com/s41r4j)
|
||||
|
||||
Made with ❤️ for developers who'd rather code than write commit messages
|
||||
|
||||
</div>
|
||||
</div>
|
||||
+63
-32
@@ -801,7 +801,7 @@ program.command('version').alias('v')
|
||||
}
|
||||
});
|
||||
|
||||
program.command('whoami')
|
||||
program.command('whoami').alias('w')
|
||||
.description('Show system and tool identity status')
|
||||
.action(async () => {
|
||||
try {
|
||||
@@ -1654,42 +1654,73 @@ program.command('fix')
|
||||
|
||||
// AI recommendation
|
||||
if (cmdOptions.ai) {
|
||||
Progress.info('Analyzing best approach...');
|
||||
let recommendation = '';
|
||||
Progress.start('🤖 Asking AI for the best strategy...');
|
||||
|
||||
if (situation === 'ahead') {
|
||||
recommendation = `Your local is ${ahead} commits ahead. Simply push to sync.`;
|
||||
console.log(`\n${color.bold('🤖 AI Recommendation:')}`);
|
||||
console.log(` ${recommendation}`);
|
||||
console.log(`\n Run: ${color.cyan('g push')}`);
|
||||
} else if (situation === 'behind') {
|
||||
recommendation = `Remote has ${behind} new commits. Pull to get them.`;
|
||||
console.log(`\n${color.bold('🤖 AI Recommendation:')}`);
|
||||
console.log(` ${recommendation}`);
|
||||
console.log(`\n Run: ${color.cyan('g pull')} or ${color.cyan('g sp')} (if you have changes)`);
|
||||
} else {
|
||||
// Diverged - more complex
|
||||
if (ahead <= 2 && behind > ahead) {
|
||||
recommendation = `Small local changes (${ahead}), larger remote (${behind}). Rebase recommended for clean history.`;
|
||||
console.log(`\n${color.bold('🤖 AI Recommendation:')}`);
|
||||
console.log(` ${recommendation}`);
|
||||
console.log(`\n Run: ${color.cyan('g fix --rebase')}`);
|
||||
} else if (behind <= 2 && ahead > behind) {
|
||||
recommendation = `Large local changes (${ahead}), small remote (${behind}). Merge is safe.`;
|
||||
console.log(`\n${color.bold('🤖 AI Recommendation:')}`);
|
||||
console.log(` ${recommendation}`);
|
||||
console.log(`\n Run: ${color.cyan('g fix --merge')}`);
|
||||
} else {
|
||||
recommendation = `Significant divergence. Review changes first, then choose merge or rebase.`;
|
||||
console.log(`\n${color.bold('🤖 AI Recommendation:')}`);
|
||||
console.log(` ${recommendation}`);
|
||||
console.log(`\n View remote changes: ${color.cyan(`git log ${branch}..${remoteBranch} --oneline`)}`);
|
||||
console.log(` View local changes: ${color.cyan(`git log ${remoteBranch}..${branch} --oneline`)}`);
|
||||
}
|
||||
// Gather rich context for the AI
|
||||
let aiContext = `Situation: I am on branch '${branch}'.\n`;
|
||||
aiContext += `Remote '${remoteBranch}' exists.\n`;
|
||||
aiContext += `Status: ${ahead} commits ahead, ${behind} commits behind.\n`;
|
||||
aiContext += `Uncommitted changes: ${hasLocalChanges ? 'Yes' : 'No'}.\n\n`;
|
||||
|
||||
if (behind > 0) {
|
||||
try {
|
||||
const behindLog = await git.log({ from: branch, to: remoteBranch, maxCount: 5 });
|
||||
aiContext += `Incoming commits (latest 5):\n${behindLog.all.map(c => `- ${c.message}`).join('\n')}\n\n`;
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
if (ahead > 0) {
|
||||
try {
|
||||
const aheadLog = await git.log({ from: remoteBranch, to: branch, maxCount: 5 });
|
||||
aiContext += `My outgoing commits (latest 5):\n${aheadLog.all.map(c => `- ${c.message}`).join('\n')}\n`;
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
const prompt = `
|
||||
As a Git expert, analyze this situation and recommend the best command to sync my repo.
|
||||
|
||||
${aiContext}
|
||||
|
||||
Explain "Why" briefly, then provide the exact command to run.
|
||||
Output format:
|
||||
Reasoning: <brief explanation>
|
||||
Recommended Command: <command>
|
||||
`;
|
||||
|
||||
// Use preferred provider or auto-resolve
|
||||
const provider = aiProvider.resolveProvider(opts.provider);
|
||||
if (provider === 'none') {
|
||||
Progress.stop('');
|
||||
console.log(color.yellow('No AI provider configured. Falling back to simple heuristics.'));
|
||||
// ... heuristic fallback ...
|
||||
let rec = '';
|
||||
if (ahead > 0 && behind === 0) rec = 'Push (g push)';
|
||||
else if (behind > 0 && ahead === 0) rec = 'Pull (g pull)';
|
||||
else rec = 'Rebase (g fix --rebase)';
|
||||
console.log(`Recommendation: ${rec}`);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await aiProvider.generateWithProvider(provider, prompt, { temperature: 0.3 }); // Use generic provider method
|
||||
|
||||
Progress.stop('');
|
||||
console.log(`\n${color.bold('🤖 AI Analysis:')}`);
|
||||
console.log(response.trim());
|
||||
} catch (e) {
|
||||
Progress.stop('');
|
||||
console.log(color.yellow('AI Analysis failed, falling back to heuristics.'));
|
||||
// ... heuristic fallback code ...
|
||||
let rec = '';
|
||||
if (ahead > 0 && behind === 0) rec = 'Push (g push)';
|
||||
else if (behind > 0 && ahead === 0) rec = 'Pull (g pull)';
|
||||
else rec = 'Rebase (g fix --rebase)';
|
||||
console.log(`Recommendation: ${rec}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Show interactive menu
|
||||
console.log(color.bold('🔧 Fix Options:\n'));
|
||||
|
||||
|
||||
@@ -203,13 +203,29 @@ class VersionCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
// Format date/time
|
||||
const y = parsed.date.substring(0, 4);
|
||||
const m = parsed.date.substring(4, 6);
|
||||
const d = parsed.date.substring(6, 8);
|
||||
const H = parsed.time.substring(0, 2);
|
||||
const M = parsed.time.substring(2, 4);
|
||||
const dateObj = new Date(`${y}-${m}-${d}T${H}:${M}:00`);
|
||||
|
||||
// 12-hour format logic
|
||||
let hour = parseInt(H);
|
||||
const ampm = hour >= 12 ? 'PM' : 'AM';
|
||||
hour = hour % 12;
|
||||
hour = hour ? hour : 12; // the hour '0' should be '12'
|
||||
const time12 = `${hour}:${M} ${ampm}`;
|
||||
|
||||
console.log(color.bold('\nS4 Version Analysis:'));
|
||||
console.log(`Major: ${parsed.major}`);
|
||||
console.log(`Minor: ${parsed.minor}`);
|
||||
console.log(`Patch: ${parsed.patch}`);
|
||||
console.log(`Stage: ${color.magenta(parsed.stage)}`);
|
||||
console.log(`Build: ${parsed.build}`);
|
||||
console.log(`Time: ${parsed.date} @ ${parsed.time}`);
|
||||
console.log(`Date: ${dateObj.toDateString()}`);
|
||||
console.log(`Time: ${time12} (${H}:${M})`);
|
||||
console.log(`Git: ${parsed.branch} (${parsed.commit})`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,12 @@ class WhoAmICommand {
|
||||
|
||||
async run() {
|
||||
const pkg = require('../../../package.json');
|
||||
|
||||
// Get SSOT version from S4 (Tags)
|
||||
const { S4Versioning } = require('../utils/s4');
|
||||
const s4 = new S4Versioning(this.git);
|
||||
const version = (await s4.getCurrentVersion()) || pkg.version;
|
||||
|
||||
const user = os.userInfo().username;
|
||||
const hostname = os.hostname();
|
||||
const platform = os.platform();
|
||||
@@ -32,7 +38,7 @@ class WhoAmICommand {
|
||||
console.log(`└─ Email: ${color.cyan(gitEmail)}`);
|
||||
|
||||
console.log(`\n${color.green('TOOL_METRICS')}`);
|
||||
console.log(`├─ Version: ${color.magenta(pkg.version)}`);
|
||||
console.log(`├─ Version: ${color.magenta(version)}`);
|
||||
console.log(`├─ Engine: Node ${process.version}`);
|
||||
console.log(`└─ Author: ${pkg.author}`);
|
||||
|
||||
|
||||
Reference in new issue
Block a user