[PR #6014] Add custom provider support to /connect #11701

Closed
opened 2026-02-16 18:16:38 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6014

State: closed
Merged: No


I've fixed the /connect command in the TUI to support custom providers. Here's a summary of the changes:

Changes Made

File: packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx

1. Added "Other" option to the provider list

The provider selection dialog now includes an "Other" option at the end of the list under the "Other" category. This matches the behavior of the CLI auth login command.

2. Added CustomProviderMethod component

A new component that implements a two-step flow for custom providers:

  1. Step 1: Prompts for a provider ID (with validation for a-z, 0-9, and hyphens only, same as CLI)
  2. Step 2: Prompts for the API key with a warning message that the user will need to configure the provider in opencode.json

The implementation mirrors the CLI's behavior including:

  • Stripping the @ai-sdk/ prefix if present
  • Validating provider ID format
  • Showing the same configuration warning message

Now when users run /connect in the TUI, they'll see "Other (Custom provider)" at the bottom of the provider list, which allows them to add credentials for any OpenAI-compatible provider.

Closes #5937

New%20session%20-%202025-12-23T06%3A11%3A49.345Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6014 **State:** closed **Merged:** No --- I've fixed the `/connect` command in the TUI to support custom providers. Here's a summary of the changes: ## Changes Made **File:** `packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx` ### 1. Added "Other" option to the provider list The provider selection dialog now includes an "Other" option at the end of the list under the "Other" category. This matches the behavior of the CLI `auth login` command. ### 2. Added `CustomProviderMethod` component A new component that implements a two-step flow for custom providers: 1. **Step 1:** Prompts for a provider ID (with validation for `a-z`, `0-9`, and hyphens only, same as CLI) 2. **Step 2:** Prompts for the API key with a warning message that the user will need to configure the provider in `opencode.json` The implementation mirrors the CLI's behavior including: - Stripping the `@ai-sdk/` prefix if present - Validating provider ID format - Showing the same configuration warning message Now when users run `/connect` in the TUI, they'll see "Other (Custom provider)" at the bottom of the provider list, which allows them to add credentials for any OpenAI-compatible provider. Closes #5937 <a href="https://opencode.ai/s/xCAflZA6"><img width="200" alt="New%20session%20-%202025-12-23T06%3A11%3A49.345Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI1LTEyLTIzVDA2OjExOjQ5LjM0NVo=.png?model=opencode/claude-opus-4-5&version=1.0.190&id=xCAflZA6" /></a> [opencode session](https://opencode.ai/s/xCAflZA6)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/sst/opencode/actions/runs/20453017602)
yindo added the pull-request label 2026-02-16 18:16:38 -05:00
yindo closed this issue 2026-02-16 18:16:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11701