New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aicommits

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aicommits - npm Package Compare versions

Comparing version

to
0.0.4

cli.js

2

aicommit.js

@@ -6,4 +6,2 @@ #!/usr/bin/env zx

// TODO: Figure out how to fail gracefully instead of exit 1
let conventionalCommit = false;

@@ -10,0 +8,0 @@

{
"name": "aicommits",
"version": "0.0.3",
"description": "generates ai commit",
"main": "aicommit.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "./aicommit.js"
},
"version": "0.0.4",
"description": "Writes your git commit messages for you with AI",
"main": "cli.js",
"bin": {
"gpt-commit": "./aicommit.js"
"gpt-commit": "./cli.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Nutlope/ai-commit.git"
},
"author": "hassan",
"license": "ISC",
"homepage": "https://github.com/Nutlope/ai-commit#readme"
"repository": "https://github.com/Nutlope/aicommits",
"author": "Hassan El Mghari (@nutlope)",
"license": "MIT",
"dependencies": {
"inquirer": "^9.1.4"
}
}

@@ -1,19 +0,21 @@

# AI Commit
# AI Commits - work in progress
Have AI Commit write your git commit messages for you so you never have to write a commit message again.
AI Commits is a tool that writes your git commit messages for you. Never write a commit message again.
[![AI Commit Screenshot](./screenshot.png)](https://twitter.com/nutlope/status/1624646872890589184)
[![AI Commit Screenshot](https://github.com/Nutlope/aicommits/blob/main/screenshot.png)](https://twitter.com/nutlope/status/1624646872890589184)
## How to install
## Installation and usage
`npm install -g autocommit`
1. `npm install -g autocommit` to install the CLI
2. `export OPENAI_KEY=sk-xxxxxxxxxxxxxxxx` to specify your OpenAI API Key
3. `autocommit` after you run `git add .` to generate your commit
**Note:** The process to install this will get vastly simplified when I rewrite this CLI and publish it as an npm package to be run with `npx`.
## How it works
This project uses a command line interface tool called zx that's developed by google. In the script, it runs a `git diff` command to grab all the latest changes, sends this to OpenAI's GPT-3, then returns the AI generated commit message. Video coming soon where I rebuild it from scratch to show you how to easily build your own CLI tools powered by AI. Fully privacy friendly as commands only run on your local machine using your OpenAI account.
This CLI tool runs a `git diff` command to grab all the latest changes, sends this to OpenAI's GPT-3, then returns the AI generated commit message. Video coming soon where I rebuild it from scratch to show you how to easily build your own CLI tools powered by AI.
This CLI also supports conventional commits. If you want conventional commits, simply set the `conventionalCommit` variable at the top of the script to `true`.
## Limitations
It currently can only support git diffs of up to 200 lines of code. I'm working on version 2.0 which will be TypeScript-first, support conventional commits, and support long diffs.
## Remaining tasks

@@ -23,13 +25,10 @@

- [ ] Rewrite this in node to publish as an npm package
- [ ] Figure out how to fail gracefully instead of exit 1
- [ ] Try openai curie And/OR codex
- Rewrite this in node to publish as an npm package
After:
Future tasks:
- [ ] Rewrite in TypeScript
- [ ] Look into better conventional commit support, look at other CLIs
- [ ] Try supporting more than 200 lines by grabbing the diff per file
- [ ] Build landing page
# How to run new version
- Experiment with openai curie and/or codex
- Add conventional commit support
- Try supporting more than 200 lines by grabbing the diff per file
- Rewrite in TypeScript
- Build landing page for the 2.0 launch