[FEATURE]: Support an Opencode-specific AWS profile
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I would like to use Opencode with Amazon Bedrock in an AWS account different than the one I'm deploying to. Setting AWS_PROFILE system wide forces the two to be the same.
Rational: I have one AWS account specifically designated for Bedrock use (and Sagemaker and other AI tools). It is not the account we use as our test bed.
I see other tools solve with with a custom set of environment variables. For example:
export AWS_PROFILE="sandbox"
export AWS_REGION="us-west-2"
export OPENCODE_AWS_PROFILE="bedrock"
export OPENCODE_AWS_REGION="us-east-1"
By prioritizing OPENCODE_ environment variables, users could easily work with services in one AWS account while Opencode uses Amazon Bedrock in another.
Yeah someone else asked for this w/ vertex
I think this shouldnt be too difficult but wed wanna do it across the board prolly
Can you use a tool like dotenvx as a work around? I use Bedrock and load the AWS_PROFILE and AWS_REGION from the .env that way: dotenvx run -- opencode
It's a simple workaround with AWS_PROFILE=bedrock opencode. Just thought it would be nice for me (and probably others) if Opencode had a superset of environment variables as I described above. I got the idea from the Zed IDE, and it's nice to just set it and forget it.
yeah I think it's fair
Agree with the author. In our setup also we have different account setup for bedrock while the default setup points to regular account.
Yeah this should be easy to add, I can work on it if I get a chance soon
If this merits a different issue, let me know and I'll open one.
Something that I'd find helpful in this scenario is being able to specify what profile to use for this provider in the config file (global or project level).