feat: support custom endpoint and bearer token configuration in TUI
Problem
Configuring a custom gateway endpoint (e.g. for Amazon Bedrock behind a corporate proxy) currently requires manually editing ~/.config/altimate-code/altimate-code.json and setting AWS_BEARER_TOKEN_BEDROCK as an environment variable or running providers login from the CLI.
This is friction for customers who expect to configure everything from within the TUI.
Proposal
Add TUI flows for:
-
Custom endpoint configuration — When selecting or configuring the
amazon-bedrockprovider, allow the user to enter a custombaseURL/endpointdirectly in the TUI. This should write to the global config (provider.amazon-bedrock.options.baseURL). -
Bearer token entry — Allow entering the
AWS_BEARER_TOKEN_BEDROCKtoken from a TUI prompt (similar to howproviders loginworks on the CLI, but accessible from within an active TUI session).
Context
Customers using custom LLM gateways on top of Bedrock (e.g. https://api.<URL>/claude-code-aws-bedrock/v1) currently need to:
- Manually create/edit
altimate-code.jsonwith the correctprovider.amazon-bedrock.options.baseURL - Set
AWS_BEARER_TOKEN_BEDROCKin their shell profile or runaltimate-code providers login -p amazon-bedrockseparately
This is especially painful for first-time setup where the user hasn't created a config file yet.
Relevant Code
- Provider handler:
packages/opencode/src/provider/provider.ts(line 301,"amazon-bedrock"handler) - Config schema:
packages/opencode/src/config/config.ts(line 1008, provider options) - CLI login:
packages/opencode/src/cli/cmd/providers.ts(line 250,ProvidersLoginCommand) - Auth storage:
packages/opencode/src/auth/service.ts