Comparing version 1.0.4 to 1.0.5
@@ -7,3 +7,3 @@ import{execSync as a}from"child_process";import r from"consola";import y from"yargs/yargs";import{hideBin as b}from"yargs/helpers";var k=y(b(process.argv)).option("conventional-commits",{alias:"c",type:"boolean",description:"Use Conventional Commits",default:!1}).option("emoji",{alias:"e",type:"boolean",description:"Use emoji in commit message",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=()=>k;var p=()=>{try{a("git rev-parse --is-inside-work-tree",{encoding:"utf8",stdio:"ignore"})}catch{r.error("This is not a git repository"),process.exit(1)}},f=()=>{let{autoAddAll:t}=s();t&&a("git add .",{encoding:"utf8"});let e=a("git diff --cached . ':(exclude)package-lock.json' ':(exclude)yarn.lock' ':(exclude)pnpm-lock.yaml'",{encoding:"utf8"});return e||(r.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)),e.length>8e3&&(r.error(`The diff is too large (${e.length} > 8000 chars) to write a commit message. Please consider splitting your changes into multiple commits.`),process.exit(1)),e},g=t=>{let{lite:e}=s();a(`git commit -m "${t}"`,{stdio:e?"ignore":"inherit",encoding:"utf8"}),e||r.success("Committed successfully")},u=()=>{let{autoPush:t,lite:e}=s();t&&(a("git push",{stdio:e?"ignore":"inherit",encoding:"utf8"}),e||r.success("Pushed successfully"))};import c from"consola";import w from"inquirer";import x from"boxen";var d=async t=>{let{conventionalCommits:e,emoji:l,lite:i}=s(),m=`I want you to act like a git commit message writer. | ||
${e?"It should follow the conventional commits. The format is <type>: <description>. A type can be one of the following: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, or test. Use it to precisely describe the change.":""} | ||
${l?"The commit message should include an emoji (NOT a shortcode like :tada:). The emoji should be the first character of the message.":""} | ||
${l?"The commit message should include an emoji (NOT a shortcode like :tada:). The emoji should be prepended to the message.":""} | ||
The diffs are below: | ||
@@ -10,0 +10,0 @@ |
{ | ||
"name": "aimmit", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Commit messages made easy with AI (ChatGPT)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -43,3 +43,3 @@ <!-- PROJECT SHIELDS --> | ||
Idea from the original project: [Nutlope/aicommits](https://github.com/Nutlope/aicommits). I made this another project because I want to add more features: | ||
Idea from the original project [Nutlope/aicommits](https://github.com/Nutlope/aicommits). I made this `aimmit` project because I want to add more features: | ||
@@ -46,0 +46,0 @@ - [x] Use Conventional Commits |
Sorry, the diff of this file is not supported yet
22631