anomalyco / anomalyco/opencode

[FEATURE]: Let well-known auth use OpenCode's bundled Bun runtime

Open
#49,094 0 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Sep 15, 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

Well-known auth requires providers to return an external executable command. This makes portable authentication difficult: Windows installations may not have sh, while other systems cannot be assumed to have Node, Python, or curl.

OpenCode already bundles Bun and can expose it by invoking its own executable with BUN_BE_BUN=1. This works on Windows as well as macOS/Linux, but a well-known auth document cannot currently request it. auth.env names the stored token variable; it does not configure the child process environment, and the login implementation calls Process.spawn(wellknown.auth.command, ...) without an environment override.

Could well-known auth support a constrained way to run a script with OpenCode's bundled Bun runtime? For example:

{
  "auth": {
    "runtime": "bun",
    "command": ["-e", "..."],
    "env": "PROVIDER_API_KEY"
  }
}

The exact schema is flexible. The important property is that providers can implement one shell-free authentication flow across supported platforms without requiring users to install another runtime.

I would prefer this over accepting arbitrary remotely supplied environment variables. OpenCode already has equivalent internal precedent for local MCP commands by setting BUN_BE_BUN=1 when the command is opencode.

I verified the underlying mechanism with OpenCode's bundled executable on Windows:

BUN_BE_BUN=1 opencode -e "console.log(process.platform, Bun.version)"
win32 1.3.14
Context

I'm trying to smooth onboarding for users of the university-specific BayLeaf platform.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.