From 9c788378bdbf9845b49e99288c53cba028c3c9d7 Mon Sep 17 00:00:00 2001 From: Milan Date: Sat, 8 Feb 2025 22:41:27 +0100 Subject: [PATCH 1/2] refactor: Update README and index.js to add new command options and handle message-only mode (displays commit message without further interaction) --- README.md | 2 ++ index.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 2b18797..a4e6970 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ You can also use the local model for free with Ollama. `--force`: Automatically create a commit without being prompted to select a message (can't be used with `--list`) +`--message-only` Runs the app in a non-interactive mode, avoiding unnecessary prompts or actions beyond displaying the message. + `--filter-fee`: Displays the approximate fee for using the API and prompts you to confirm the request `--apiKey`: Your OpenAI API key. It is not recommended to pass `apiKey` here, it is better to use `env` variable diff --git a/index.js b/index.js index 4206168..0f4b2a9 100755 --- a/index.js +++ b/index.js @@ -103,6 +103,11 @@ const generateSingleCommit = async (diff) => { return; } + if (args["message-only"]) { + console.log(finalCommitMessage); + process.exit(0); + } + const answer = await inquirer.prompt([ { type: "confirm", From 126ffc2a8e7f393438161c384d8d64977665d5e8 Mon Sep 17 00:00:00 2001 From: Milan Date: Sat, 8 Feb 2025 23:35:47 +0100 Subject: [PATCH 2/2] fix: remove duplicate commit message output. --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 0f4b2a9..1da4527 100755 --- a/index.js +++ b/index.js @@ -104,7 +104,6 @@ const generateSingleCommit = async (diff) => { } if (args["message-only"]) { - console.log(finalCommitMessage); process.exit(0); }