Skip to content

Conversation

@opencode-agent
Copy link
Contributor

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

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

lgtm

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.

Custom provider docs incorrect

2 participants