anomalyco / anomalyco/opencode
[FEATURE]: Support refreshing provider credentials without restarting cli
@kitlangton is already working on this.
Since Aug 18, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Enable configuring a token refresh command and interval for api keys with custom providers, this is useful when fetching the api key from a vault or IdP.
Currently when fetching an api key from IdP/vault it is done through env vars when launching opencode but they cannot be refreshed without closing opencode, generating a new token and opening opencode back up.
We should provide the ability to specify a script to generate the token and the interval to refresh it.
Eg:
{
"provider": {
"my_provider": {
"auth": {
"command": "/path/to/get-token.sh",
"refreshInterval": 3600
}
}
}
}
Similar to claude apiKeyHelper and the codex auth config which enable refresh commands.
I am happy to implement this feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.