Skip to content

refactor(cli): allow custom config setting for cli network options and improve docs#19107

Open
OpeOginni wants to merge 1 commit intoanomalyco:devfrom
OpeOginni:fix/server-config
Open

refactor(cli): allow custom config setting for cli network options and improve docs#19107
OpeOginni wants to merge 1 commit intoanomalyco:devfrom
OpeOginni:fix/server-config

Conversation

@OpeOginni
Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #19078

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds support for custom config set by OPENCODE_CONFIG var when setting network options for cli commands like serve and web.

Improves the docs stating the places where config for serve and web comes from. The global config and the custom config.

How did you verify your code works?

Tested on my local machine with he dev changes and check the docs frontend as well.

Screenshots / recordings

Screenshot 2026-03-25 at 13 15 30

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR


export async function resolveNetworkOptions(args: NetworkOptions) {
const config = await Config.global()
const globalConfig = await Config.global()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, isn't there any helper that "merges" the configs based on the Precidence Order defined here https://opencode.ai/docs/config#precedence-order

I can imagine that this can be a recurring issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know if a merge would be the best, rather it just takes the complete server config of either the Global or the Custom one set with the var.
Would be weird if some parts of the server are in one config, then mixed with the other. But the team would be best to make that choice, just made the PR with what seemed to make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode serve ignores configuration

2 participants