aicommits 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/bin/aicommits.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<div>
|
|
3
|
-
<img src="/screenshot.png" alt="AI Commits"/>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/Nutlope/aicommits/main/screenshot.png?token=GHSAT0AAAAAABPRWK4L2SO2P7OQARQ3YCF6Y7K3XWA" alt="AI Commits"/>
|
|
4
4
|
<h1 align="center">AI Commits</h1>
|
|
5
5
|
</div>
|
|
6
6
|
<p>A CLI that writes your git commit messages for you. Never write a commit message again.</p>
|
|
7
7
|
<a href="https://packagephobia.com/result?p=aicommits"><img src="https://badgen.net/packagephobia/install/aicommits" alt="Current version"></a>
|
|
8
|
-
<a href="https://www.npmjs.com/package/aicommits"><img src="https://img.shields.io/npm/v/aicommits" alt="Install size"></a>
|
|
9
8
|
<a href="https://twitter.com/nutlope">
|
|
10
9
|
<img src="https://img.shields.io/twitter/follow/nutlope?style=flat&label=nutlope&logo=twitter&color=0bf&logoColor=fff" alt="Hassan Twitter follower count" />
|
|
11
10
|
</a>
|
|
@@ -26,7 +25,9 @@ After that, generate your commit running `aicommits`.
|
|
|
26
25
|
|
|
27
26
|
## How it works
|
|
28
27
|
|
|
29
|
-
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.
|
|
28
|
+
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. I also want to note that it does cost money since data gets sent to OpenAI for a commit message to be generated. However, OpenAI gives folks $18 of free credits and commit message generations are cheap so it should be free for a long time.
|
|
29
|
+
|
|
30
|
+
Video coming soon where I rebuild it from scratch to show you how to easily build your own CLI tools powered by AI.
|
|
30
31
|
|
|
31
32
|
## Limitations
|
|
32
33
|
|
|
@@ -35,13 +36,9 @@ This CLI tool runs a `git diff` command to grab all the latest changes, sends th
|
|
|
35
36
|
|
|
36
37
|
The next version of the CLI, v2, will address both of these limitations!
|
|
37
38
|
|
|
38
|
-
## Tasks now
|
|
39
|
-
|
|
40
|
-
- Experiment with openai curie and codex as opposed to dacinvi
|
|
41
|
-
- Figure out the price per commit
|
|
42
|
-
|
|
43
39
|
## Future tasks
|
|
44
40
|
|
|
45
41
|
- Add support for conventional commits as a flag that users can enable
|
|
46
|
-
-
|
|
42
|
+
- Add support for diffs greater than 200 lines by grabbing the diff per file
|
|
43
|
+
- Add support for a flag that can auto-accept
|
|
47
44
|
- Build landing page for the 2.0 launch
|
package/bin/aicommits.js
CHANGED
|
@@ -21,10 +21,10 @@ const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
|
21
21
|
let OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
|
22
22
|
function main() {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
console.log(chalk_1.default.white("▲ ") + chalk_1.default.green("Welcome to
|
|
24
|
+
console.log(chalk_1.default.white("▲ ") + chalk_1.default.green("Welcome to AICommits!"));
|
|
25
25
|
if (!OPENAI_API_KEY) {
|
|
26
26
|
console.error(chalk_1.default.white("▲ ") +
|
|
27
|
-
"Please
|
|
27
|
+
"Please save your OpenAI API key as an env variable by doing 'export OPENAI_API_KEY=YOUR_API_KEY'");
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
try {
|
|
@@ -76,7 +76,7 @@ exports.main = main;
|
|
|
76
76
|
function generateCommitMessage(prompt) {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
const payload = {
|
|
79
|
-
model: "text-
|
|
79
|
+
model: "text-davinci-003",
|
|
80
80
|
prompt,
|
|
81
81
|
temperature: 0.7,
|
|
82
82
|
top_p: 1,
|