opencommit 1.1.3 → 1.1.4
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 +1 -1
- package/out/cli.cjs +18 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ All the commits in this repo are done with OpenCommit — look into [the commits
|
|
|
28
28
|
npm install -g opencommit
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys)
|
|
31
|
+
2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys). Make sure you add payment details, so API works.
|
|
32
32
|
|
|
33
33
|
3. Set the key to opencommit config:
|
|
34
34
|
|
package/out/cli.cjs
CHANGED
|
@@ -15412,7 +15412,7 @@ function G3(t, e2) {
|
|
|
15412
15412
|
// package.json
|
|
15413
15413
|
var package_default = {
|
|
15414
15414
|
name: "opencommit",
|
|
15415
|
-
version: "1.1.
|
|
15415
|
+
version: "1.1.3",
|
|
15416
15416
|
description: "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
|
15417
15417
|
keywords: [
|
|
15418
15418
|
"git",
|
|
@@ -16404,7 +16404,10 @@ var source_default = chalk;
|
|
|
16404
16404
|
// src/commands/config.ts
|
|
16405
16405
|
var validateConfig = (key, condition, validationMessage) => {
|
|
16406
16406
|
if (!condition) {
|
|
16407
|
-
|
|
16407
|
+
ce(
|
|
16408
|
+
`${source_default.red("\u2716")} Unsupported config key ${key}: ${validationMessage}`
|
|
16409
|
+
);
|
|
16410
|
+
process.exit(1);
|
|
16408
16411
|
}
|
|
16409
16412
|
};
|
|
16410
16413
|
var configValidators = {
|
|
@@ -17530,10 +17533,10 @@ var [command, mode] = process.argv.slice(2);
|
|
|
17530
17533
|
if (!apiKey && command !== "config" && mode !== "set" /* set */) {
|
|
17531
17534
|
ae("opencommit");
|
|
17532
17535
|
ce(
|
|
17533
|
-
"OPENAI_API_KEY is not set, please run `oc config set OPENAI_API_KEY=<your token
|
|
17536
|
+
"OPENAI_API_KEY is not set, please run `oc config set OPENAI_API_KEY=<your token>. Make sure you add payment details, so API works.`"
|
|
17534
17537
|
);
|
|
17535
17538
|
ce(
|
|
17536
|
-
"For help
|
|
17539
|
+
"For help look into README https://github.com/di-sukharev/opencommit#setup"
|
|
17537
17540
|
);
|
|
17538
17541
|
process.exit(1);
|
|
17539
17542
|
}
|
|
@@ -17555,7 +17558,17 @@ var OpenAi = class {
|
|
|
17555
17558
|
const message = data.choices[0].message;
|
|
17556
17559
|
return message?.content;
|
|
17557
17560
|
} catch (error) {
|
|
17558
|
-
|
|
17561
|
+
ce(`${source_default.red("\u2716")} ${error}`);
|
|
17562
|
+
if (error.isAxiosError && error.response?.status === 401) {
|
|
17563
|
+
const err = error;
|
|
17564
|
+
const openAiError = (err.response?.data).error;
|
|
17565
|
+
if (openAiError?.message)
|
|
17566
|
+
ce(openAiError.message);
|
|
17567
|
+
ce(
|
|
17568
|
+
"For help look into README https://github.com/di-sukharev/opencommit#setup"
|
|
17569
|
+
);
|
|
17570
|
+
}
|
|
17571
|
+
process.exit(1);
|
|
17559
17572
|
}
|
|
17560
17573
|
};
|
|
17561
17574
|
}
|