Remove oc alias (#178)

oc is pretty wellknow alias for OpenShift CLI

Signed-off-by: Moulick Aggarwal <moulickaggarwal@gmail.com>
This commit is contained in:
Moulick Aggarwal
2023-05-26 06:05:18 +02:00
committed by GitHub
parent 3f3043c48e
commit 34775e9e69
7 changed files with 27 additions and 30 deletions
+16 -16
View File
@@ -76,7 +76,7 @@ Interactive rebase (`rebase -i`) changes commit SHA, so commit history in remote
## Setup OpenCommit as a CLI ## Setup OpenCommit as a CLI
You can use OpenCommit by simply running it via CLI like this `oc`. 2 seconds and your staged changes are committed with a meaningful message. You can use OpenCommit by simply running it via CLI like this `oco`. 2 seconds and your staged changes are committed with a meaningful message.
1. Install OpenCommit globally to use in any repository: 1. Install OpenCommit globally to use in any repository:
@@ -103,7 +103,7 @@ git add <files...>
opencommit opencommit
``` ```
You can also use the `oc` shortcut: You can also use the `oco` shortcut:
```sh ```sh
git add <files...> git add <files...>
@@ -133,19 +133,19 @@ Local config still has more priority as Global config, but you may set `OCO_MODE
Simply run any of the variable above like this: Simply run any of the variable above like this:
```sh ```sh
oc config set OCO_OPENAI_API_KEY=gpt-4 oco config set OCO_OPENAI_API_KEY=gpt-4
``` ```
Configure [GitMoji](https://gitmoji.dev/) to preface a message. Configure [GitMoji](https://gitmoji.dev/) to preface a message.
```sh ```sh
oc config set OCO_EMOJI=true oco config set OCO_EMOJI=true
``` ```
To remove preface emoji: To remove preface emoji:
```sh ```sh
oc config set OCO_EMOJI=false oco config set OCO_EMOJI=false
``` ```
### Switch to GPT-4 ### Switch to GPT-4
@@ -155,7 +155,7 @@ By default OpenCommit uses GPT-3.5-turbo (ChatGPT).
You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠 You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
```sh ```sh
oc config set OCO_MODEL=gpt-4 oco config set OCO_MODEL=gpt-4
``` ```
Make sure you do lowercase `gpt-4` and you have API access to the 4th model. Even if you have ChatGPT+ it doesn't necessarily mean that you have API access to GPT-4. Make sure you do lowercase `gpt-4` and you have API access to the 4th model. Even if you have ChatGPT+ it doesn't necessarily mean that you have API access to GPT-4.
@@ -166,14 +166,14 @@ To globally specify the language used to generate commit messages:
```sh ```sh
# de, German ,Deutsch # de, German ,Deutsch
oc config set OCO_LANGUAGE=de oco config set OCO_LANGUAGE=de
oc config set OCO_LANGUAGE=German oco config set OCO_LANGUAGE=German
oc config set OCO_LANGUAGE=Deutsch oco config set OCO_LANGUAGE=Deutsch
# fr, French, française # fr, French, française
oc config set OCO_LANGUAGE=fr oco config set OCO_LANGUAGE=fr
oc config set OCO_LANGUAGE=French oco config set OCO_LANGUAGE=French
oc config set OCO_LANGUAGE=française oco config set OCO_LANGUAGE=française
``` ```
The default language set is **English** The default language set is **English**
@@ -181,10 +181,10 @@ All available languages are currently listed in the [i18n](https://github.com/di
### Git flags ### Git flags
The `opencommit` or `oc` commands can be used in place of the `git commit -m "${generatedMessage}"` command. This means that any regular flags that are used with the `git commit` command will also be applied when using `opencommit` or `oc`. The `opencommit` or `oco` commands can be used in place of the `git commit -m "${generatedMessage}"` command. This means that any regular flags that are used with the `git commit` command will also be applied when using `opencommit` or `oco`.
```sh ```sh
oc --no-verify oco --no-verify
``` ```
is translated to : is translated to :
@@ -213,13 +213,13 @@ You can set OpenCommit as Git [`prepare-commit-msg`](https://git-scm.com/docs/gi
To set the hook: To set the hook:
```sh ```sh
oc hook set oco hook set
``` ```
To unset the hook: To unset the hook:
```sh ```sh
oc hook unset oco hook unset
``` ```
To use the hook: To use the hook:
+2 -3
View File
@@ -16289,7 +16289,6 @@ var package_default = {
main: "cli.js", main: "cli.js",
bin: { bin: {
opencommit: "./out/cli.cjs", opencommit: "./out/cli.cjs",
oc: "./out/cli.cjs",
oco: "./out/cli.cjs" oco: "./out/cli.cjs"
}, },
repository: { repository: {
@@ -21903,7 +21902,7 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => {
if (changedFiles) if (changedFiles)
await gitAdd({ files: changedFiles }); await gitAdd({ files: changedFiles });
else { else {
ce("No changes detected, write some code and run `oc` again"); ce("No changes detected, write some code and run `oco` again");
process.exit(1); process.exit(1);
} }
} }
@@ -22037,7 +22036,7 @@ async function commit(extraArgs2 = [], isStageAllFlag = false) {
if (changedFiles2) if (changedFiles2)
await gitAdd({ files: changedFiles2 }); await gitAdd({ files: changedFiles2 });
else { else {
ce("No changes detected, write some code and run `oc` again"); ce("No changes detected, write some code and run `oco` again");
process.exit(1); process.exit(1);
} }
} }
-1
View File
@@ -26,7 +26,6 @@
"openai": "^3.2.1" "openai": "^3.2.1"
}, },
"bin": { "bin": {
"oc": "out/cli.cjs",
"oco": "out/cli.cjs", "oco": "out/cli.cjs",
"opencommit": "out/cli.cjs" "opencommit": "out/cli.cjs"
}, },
-1
View File
@@ -17,7 +17,6 @@
"main": "cli.js", "main": "cli.js",
"bin": { "bin": {
"opencommit": "./out/cli.cjs", "opencommit": "./out/cli.cjs",
"oc": "./out/cli.cjs",
"oco": "./out/cli.cjs" "oco": "./out/cli.cjs"
}, },
"repository": { "repository": {
+1 -1
View File
@@ -21,7 +21,7 @@ if (!apiKey && command !== 'config' && mode !== CONFIG_MODES.set) {
intro('opencommit'); intro('opencommit');
outro( outro(
'OCO_OPENAI_API_KEY is not set, please run `oc config set OCO_OPENAI_API_KEY=<your token>. Make sure you add payment details, so API works.`' 'OCO_OPENAI_API_KEY is not set, please run `oco config set OCO_OPENAI_API_KEY=<your token>. Make sure you add payment details, so API works.`'
); );
outro( outro(
'For help look into README https://github.com/di-sukharev/opencommit#setup' 'For help look into README https://github.com/di-sukharev/opencommit#setup'
+1 -1
View File
@@ -138,7 +138,7 @@ export async function commit(
if (changedFiles) await gitAdd({ files: changedFiles }); if (changedFiles) await gitAdd({ files: changedFiles });
else { else {
outro('No changes detected, write some code and run `oc` again'); outro('No changes detected, write some code and run `oco` again');
process.exit(1); process.exit(1);
} }
} }
+1 -1
View File
@@ -24,7 +24,7 @@ export const prepareCommitMessageHook = async (
if (changedFiles) await gitAdd({ files: changedFiles }); if (changedFiles) await gitAdd({ files: changedFiles });
else { else {
outro('No changes detected, write some code and run `oc` again'); outro('No changes detected, write some code and run `oco` again');
process.exit(1); process.exit(1);
} }
} }