di-sukharev / di-sukharev/opencommit

๐Ÿ“š [Feature]: Proposal for Configurable Backend Integration

Open
#213 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.5k
Forks
445
Avg merge
18m
Merged PRs (30d)
2

Description

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
  • Hardcoding multiple backend options, but this lacks scalability.
  • Providing only a few select backends as options, but this limits the choice for users. (Self-hosted LLMs...)
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! ๐ŸŽ‰

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up โ€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the startup configuration loading and the current OpenAI backend entry point. Review the proposed backend-config.json in ~/.opencommit/, BackendInterface, backend classes, and dependency-injection approach; done means users can select an alternative backend through configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.