opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

feat(config): Add options to skip commit and push prompts

Open Sma1lboy opened this issue 3 months ago • 4 comments
trafficstars

This pull request introduces one new configuration options to streamline the commit workflow by skipping unnecessary confirmation steps.

I've been using these changes locally and they have significantly improved my workflow, allowing for faster commits with readable messages without the interruption of prompts. I believe this will be a valuable addition for many users who prefer a more automated process.

Changes:

  • OCO_SKIP_COMMIT_CONFIRM: When set to true, this option skips the commit message confirmation prompt and automatically commits with the generated message. This is useful for users who trust the generated messages and want to speed up their workflow.

These options can be configured via environment variables or the opencommit config file.

Local Usage Log:

Here's an example of the streamlined workflow in action from my local environment:

./out/cli.cjs
┌  open-commit
│
◇  2 staged files:
  src/commands/commit.ts
  src/commands/config.ts
│
◇  📝 Commit message generated
│
└  Generated commit message:
——————————————————
feat(config): add OCO_SKIP_COMMIT_CONFIRM to skip confirmation prompt
feat(config): add OCO_SKIP_PUSH_PROMPT to skip push prompt
refactor(commit): use config.OCO_SKIP_COMMIT_CONFIRM instead of direct skipCommitConfirmation
refactor(commit): use config.OCO_SKIP_PUSH_PROMPT to control git push behavior
——————————————————
│
◇  ✔ Successfully committed
│
└  [feat/adding-skip-commit-and-skip-push 6fc7274] feat(config): add OCO_SKIP_COMMIT_CONFIRM to skip confirmation prompt feat(config): add OCO_SKIP_PUSH_PROMPT to skip push prompt refactor(commit): use config.OCO_SKIP_COMMIT_CONFIRM instead of direct skipCommitConfirmation refactor(commit): use config.OCO_SKIP_PUSH_PROMPT to control git push behavior
 2 files changed, 41 insertions(+), 5 deletions(-)

I hope this pull request will be accepted. The constant prompting can be tedious, and this change provides a much-needed quality-of-life improvement for users who want a faster, more direct commit process.

Sma1lboy avatar Jul 31 '25 05:07 Sma1lboy