diff --git a/lib.js b/lib.js index 03ae2aa..7df3cc3 100644 --- a/lib.js +++ b/lib.js @@ -1,9 +1,10 @@ #!/usr/bin/env node -const { execSync, spawn } = require("child_process"); -let OPENAI_API_KEY = process.env.OPENAI_API_KEY; -import inquirer from "inquirer"; -export async function main() { +import { execSync } from "child_process"; +import inquirer from "inquirer"; +let OPENAI_API_KEY = process.env.OPENAI_API_KEY; + +async function main() { console.log("Welcome to AICommit!"); if (!OPENAI_API_KEY) { console.error( @@ -91,3 +92,5 @@ async function generateCommitMessage(prompt) { return aiCommit.replace(/(\r\n|\n|\r)/gm, ""); } + +await main(); diff --git a/package.json b/package.json index 633e168..486125b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "aicommits", - "version": "0.0.5", + "version": "0.0.6", "description": "Writes your git commit messages for you with AI", "main": "cli.js", "bin": { "aicommits": "./cli.js" }, + "type": "module", "repository": "https://github.com/Nutlope/aicommits", "author": "Hassan El Mghari (@nutlope)", "license": "MIT",