Skip to content

Add custom provider docs#241

Open
Ap-0007 wants to merge 1 commit into
404-PF:mainfrom
Ap-0007:agent/fix-238-document-how-to-add-a-custom-p
Open

Add custom provider docs#241
Ap-0007 wants to merge 1 commit into
404-PF:mainfrom
Ap-0007:agent/fix-238-document-how-to-add-a-custom-p

Conversation

@Ap-0007

@Ap-0007 Ap-0007 commented Jul 16, 2026

Copy link
Copy Markdown

What was broken

Users had no clear documentation on adding a custom provider.

What changed

Added instructions to README on how to add a custom provider.

How to test

Verify that the instructions are clear and accurate.


Opened by autonomous agent. Human review required before merge.

Summary by CodeRabbit

  • Documentation
    • Added instructions for configuring custom providers.
    • Documented how to use a custom endpoint with the __custom__ provider key and CUSTOM_API_KEY environment variable.

@Ap-0007 Ap-0007 requested a review from 404-Page-Found as a code owner July 16, 2026 07:33
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

README.md now documents how to add custom providers, register them, wire them into createProvider(), and configure custom endpoints with __custom__ and CUSTOM_API_KEY.

Changes

Custom Provider Documentation

Layer / File(s) Summary
Document custom provider configuration
README.md
Adds instructions for creating provider files, registering providers in BUILTIN_PROVIDERS, wiring createProvider(), and using __custom__ with CUSTOM_API_KEY.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

  • 404-PF/commit-echo#238 — The README changes directly document the requested custom provider configuration.

Suggested reviewers: 404-page-found, 404-page-found

Poem

I hopped through the README, light as a feather,
Custom providers now bloom together.
__custom__ guides the API key’s flight,
createProvider() makes the wiring right.
Squeak! Clear setup from morning to night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: documentation for custom providers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da21673b33

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the custom endpoint setting separately

For the __custom__ provider, CUSTOM_API_KEY is only used as the API key; the endpoint still has to come from baseUrl in config or COMMIT_ECHO_BASE_URL. In the code, getBaseUrl() throws when a custom provider has no base URL, so users following this sentence by setting only CUSTOM_API_KEY will still fail before any request is made.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 89-90: Update the custom provider documentation near the
__custom__ provider instructions to distinguish CUSTOM_API_KEY as the credential
from the required base URL. Document that the base URL must be configured
through config.json, commit-echo init, or COMMIT_ECHO_BASE_URL, while preserving
the existing custom endpoint setup guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 17309d3b-a5d1-427d-8265-c3b231c5a267

📥 Commits

Reviewing files that changed from the base of the PR and between 1910b09 and da21673.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md
Comment on lines +89 to +90
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

CUSTOM_API_KEY supplies the credential; it does not point to the endpoint. The __custom__ flow also requires a base URL via config.json, commit-echo init, or COMMIT_ECHO_BASE_URL. As written, users may configure only the API key and hit Custom provider requires a base URL.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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.
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, 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.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 89 - 90, Update the custom provider documentation
near the __custom__ provider instructions to distinguish CUSTOM_API_KEY as the
credential from the required base URL. Document that the base URL must be
configured through config.json, commit-echo init, or COMMIT_ECHO_BASE_URL, while
preserving the existing custom endpoint setup guidance.

@404-Page-Found 404-Page-Found left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Patch the findings above

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