UNPKG

bodhi-commit-genius-js

Version:

🚀 Smart commit message generator with AI - supports local LLMs and cloud APIs

32 lines (31 loc) • 968 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GitService = void 0; const simple_git_1 = __importDefault(require("simple-git")); class GitService { constructor() { this.git = (0, simple_git_1.default)(); } async stageFiles(files) { await this.git.add(files); } async getStagedDiff() { const diff = await this.git.diff(['--staged']); if (!diff) { throw new Error('No staged changes found'); } return diff; } async commit(message) { await this.git.commit(message); } async installHooks() { // TODO: Implement git hooks installation // This will be used to automatically run commit-genius-js // when the user tries to commit } } exports.GitService = GitService;