Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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 👍 / 👎.


Comment on lines +89 to +90

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.

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
Expand Down