Skip to content

Conversation

@welingtonsampaio
Copy link
Contributor

@welingtonsampaio welingtonsampaio commented Oct 7, 2024

Enhance Context Awareness for Commit Message Generation

OpenCommit now allows you to provide additional context when generating commit messages. This context is incorporated into the prompt given to the AI model, enabling it to create more tailored and relevant commit messages.

Usage

To provide additional context, use the --context flag followed by your context in quotes after the OpenCommit command:

oco --context "This commit updates the authentication flow to use JWT tokens"

The AI model will consider the provided context when generating the commit message, incorporating relevant information when appropriate.

Benefits

  • Context-aware commit messages: By providing additional context, the generated commit messages will be more aligned with the specific changes made, resulting in clearer and more descriptive commit messages.
  • Improved relevance: The AI model can better understand the intent and purpose behind the changes, leading to commit messages that accurately reflect the modifications.
  • Customization: You can tailor the commit message generation process by providing context specific to your project or development environment.

This enhancement strengthens OpenCommit's ability to generate meaningful and accurate commit messages, facilitating better commit history management and code collaboration.

di-sukharev and others added 6 commits September 7, 2024 18:17
* feat(config): add support for groq AI provider, including config validation and engine implementation (di-sukharev#381)

* fix migrations (di-sukharev#414)

---------

Co-authored-by: Takanori Matsumoto <matscube@gmail.com>
Co-authored-by: BILLY Maxime <ozeliurs@gmail.com>
@di-sukharev
Copy link
Owner

thats awesome, reading

Copy link
Owner

@di-sukharev di-sukharev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, left few comments

src/prompts.ts Outdated
* @returns - The context of the user input
*/
const userInputCodeContext = () => {
const args = process.argv;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this function should accept an argument context: string, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To implement this in a more effective manner, I switched to a flag called context. This approach makes the code more declarative and self-explanatory. Users can learn about this feature by running the oco --help command, which provides detailed information on how to use the context flag and its purpose within the application

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check again when you can


export async function commit(
extraArgs: string[] = [],
context: string = '',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly

@di-sukharev
Copy link
Owner

nice job, i will be merging tmr

@di-sukharev di-sukharev merged commit eca4083 into di-sukharev:dev Nov 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants