Comparing version 1.0.2 to 1.0.3
@@ -1,2 +0,2 @@ | ||
import{execSync as n}from"child_process";import l from"consola";import h from"yargs/yargs";import{hideBin as y}from"yargs/helpers";var b=h(y(process.argv)).option("conventional-commits",{alias:"c",type:"boolean",description:"Use Conventional Commits",default:!1}).option("lite",{alias:"l",type:"boolean",description:"Only print the commit message",default:!1}).option("auto-add-all",{alias:"a",type:"boolean",description:"Automatically add all files to the commit",default:!1}).option("auto-push",{alias:"p",type:"boolean",description:"Automatically push the commit to the remote",default:!1}).option("reverse-proxy-url",{alias:"r",type:"string",description:"Reverse proxy URL",default:process.env.AIMMIT_REVERSE_PROXY_URL}).option("key",{alias:"k",type:"string",description:"API key",default:process.env.AIMMIT_API_KEY}).option("verbose",{alias:"v",type:"boolean",description:"Run with verbose logging",default:!1}).parse(),s=()=>b;var p=()=>{try{n("git rev-parse --is-inside-work-tree",{encoding:"utf8",stdio:"ignore"})}catch{l.error("This is not a git repository"),process.exit(1)}},g=()=>{let{autoAddAll:e}=s();e&&n("git add .",{encoding:"utf8"});let t=n("git diff --cached . ':(exclude)package-lock.json' ':(exclude)yarn.lock' ':(exclude)pnpm-lock.yaml'",{encoding:"utf8"});return t||(l.error("No staged changes found. Make sure there are changes and run `git add .`"),process.exit(1)),t.length>8e3&&(l.error(`The diff is too large (${t.length} > 8000 chars) to write a commit message. Please consider splitting your changes into multiple commits.`),process.exit(1)),t},f=e=>{let{lite:t}=s();n(`git commit -m "${e}"`,{stdio:t?"ignore":"inherit",encoding:"utf8"})},u=()=>{let{autoPush:e,lite:t}=s();e&&n("git push",{stdio:t?"ignore":"inherit",encoding:"utf8"})};import a from"consola";import x from"inquirer";import w from"boxen";var d=async e=>{let{conventionalCommits:t,lite:i}=s(),r=`I want you to act like a git commit message writer. | ||
import{execSync as n}from"child_process";import l from"consola";import h from"yargs/yargs";import{hideBin as y}from"yargs/helpers";var b=h(y(process.argv)).option("conventional-commits",{alias:"c",type:"boolean",description:"Use Conventional Commits",default:!1}).option("lite",{alias:"l",type:"boolean",description:"Only print the commit message",default:!1}).option("auto-add-all",{alias:"a",type:"boolean",description:"Automatically add all files to the commit",default:!1}).option("auto-push",{alias:"p",type:"boolean",description:"Automatically push the commit to the remote",default:!1}).option("reverse-proxy-url",{alias:"r",type:"string",description:"Reverse proxy URL",default:process.env.AIMMIT_REVERSE_PROXY_URL}).option("key",{alias:"k",type:"string",description:"API key",default:process.env.AIMMIT_API_KEY}).option("verbose",{alias:"v",type:"boolean",description:"Run with verbose logging",default:!1}).parse(),s=()=>b;var p=()=>{try{n("git rev-parse --is-inside-work-tree",{encoding:"utf8",stdio:"ignore"})}catch{l.error("This is not a git repository"),process.exit(1)}},g=()=>{let{autoAddAll:e}=s();e&&n("git add .",{encoding:"utf8"});let t=n("git diff --cached . ':(exclude)package-lock.json' ':(exclude)yarn.lock' ':(exclude)pnpm-lock.yaml'",{encoding:"utf8"});return t||(l.error("No staged changes found. Make sure there are changes and run `git add .` or use the `--auto-add-all`, `-a` option."),process.exit(1)),t.length>8e3&&(l.error(`The diff is too large (${t.length} > 8000 chars) to write a commit message. Please consider splitting your changes into multiple commits.`),process.exit(1)),t},f=e=>{let{lite:t}=s();n(`git commit -m "${e}"`,{stdio:t?"ignore":"inherit",encoding:"utf8"})},u=()=>{let{autoPush:e,lite:t}=s();e&&n("git push",{stdio:t?"ignore":"inherit",encoding:"utf8"})};import a from"consola";import x from"inquirer";import w from"boxen";var d=async e=>{let{conventionalCommits:t,lite:i}=s(),r=`I want you to act like a git commit message writer. | ||
I will input a git diff and your job is to convert it into a useful commit message. | ||
@@ -3,0 +3,0 @@ Return nothing else but only ONE commit message without quotes. |
{ | ||
"name": "aimmit", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Commit messages made easy with AI (ChatGPT)", | ||
"keywords": [ | ||
"git", | ||
"commit", | ||
@@ -7,0 +8,0 @@ "message", |
@@ -33,2 +33,4 @@ <!-- PROJECT SHIELDS --> | ||
</p> | ||
<img src="images/demo.gif" alt="Demo"> | ||
</div> | ||
@@ -40,2 +42,4 @@ | ||
> This library uses itself to generate the commit message. | ||
## Installation | ||
@@ -46,3 +50,3 @@ | ||
```bash | ||
npx aimmit@latest | ||
npx aimmit | ||
``` | ||
@@ -49,0 +53,0 @@ |
Sorry, the diff of this file is not supported yet
20925
166