-
Notifications
You must be signed in to change notification settings - Fork 33
Add custom provider docs #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -86,6 +86,8 @@ Note: The non-interactive flags `--yes`, `-y`, and `--auto` expect staged change | |||||
|
|
||||||
| Run `commit-echo init` to configure your provider and model. Configuration is stored in `~/.config/commit-echo/config.json`. | ||||||
|
|
||||||
| To add a custom provider, create a file in the `src/providers` directory (e.g., `src/providers/my-provider.ts`) and add it to the `BUILTIN_PROVIDERS` list. Then, wire it into the `createProvider()` function. You can also use the `__custom__` provider key and set the `CUSTOM_API_KEY` environment variable to point to your custom endpoint. | ||||||
|
|
||||||
|
Comment on lines
+89
to
+90
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Document the custom base URL separately from the API key.
Suggested wording-You can also use the `__custom__` provider key and set the `CUSTOM_API_KEY` environment variable to point to your custom endpoint.
+You can also use the `__custom__` provider key, configure the endpoint base URL with `commit-echo init` (or `COMMIT_ECHO_BASE_URL`), and set `CUSTOM_API_KEY` to the endpoint's API key.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| If you want `git commit` to prefill the first suggestion automatically, run `commit-echo init --install-hook` from inside a Git repository. This installs both a `prepare-commit-msg` hook (prefills the first suggestion) and a `post-commit` hook (logs the committed message for style learning). The hooks skip merge commits, cherry-picks, amend flows, and any commit where a message was already supplied. | ||||||
|
|
||||||
| ### Options | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the
__custom__provider,CUSTOM_API_KEYis only used as the API key; the endpoint still has to come frombaseUrlin config orCOMMIT_ECHO_BASE_URL. In the code,getBaseUrl()throws when a custom provider has no base URL, so users following this sentence by setting onlyCUSTOM_API_KEYwill still fail before any request is made.Useful? React with 👍 / 👎.