di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.98k stars 318 forks source link

📚 [Feature]: Proposal for Configurable Backend Integration #213

Open sebastienfi opened 1 year ago

sebastienfi commented 1 year ago

Description

Hello wonderful OpenCommit family! 🌈 Before diving in, I must express my admiration for the code owners and contributors of OpenCommit. You folks rock! 🎸 Now, I have another proposal aimed at amplifying OpenCommit's flexibility and interoperability. 📈

OpenCommit is currently restricted to using OpenAI as the backend. Allowing configuration for alternative backends would greatly increase the project's scope and applicability. 🌐

https://github.com/di-sukharev/opencommit/issues/150

Suggested Solution

Implement a configuration mechanism that allows users to connect to any backend.

  1. Define a configuration schema with fields like backend_url, api_key, and request_format.
  2. Store this configuration in a file (e.g., backend-config.json) in ~/.opencommit/.
  3. Read the configuration at startup to determine the backend.
  4. Create an abstract BackendInterface in TypeScript for backend integrations.
  5. Develop specific backend classes that implement this interface.
  6. Use dependency injection to use the correct backend based on the configuration (?).

Alternatives

Additional Context

This proposal opens up OpenCommit to a wider audience by supporting a variety of backend services. Users can connect to the backend that best fits their needs or preferences.

💡 I am excited to know what you think! Your feedback and ideas are invaluable. 💌

Thank you, OpenCommit family! 🎉

TommyLike commented 1 year ago

Is there anyone working on this?

sebastienfi commented 1 year ago

Is there anyone working on this?

Not to my knowledge. Would you like to contribute? I can assist

github-actions[bot] commented 1 year ago

Stale issue message

di-sukharev commented 7 months ago

we now support ollama, but im anyway reopening it, in case you want other backends, let's chat about it