Skip to content

add OPENCODE_CONFIG_DIR to allow loading a custom config directory - #3504

Merged
rekram1-node merged 8 commits into
anomalyco:devfrom
oribarilan:feat/opencode-config-dir
Oct 28, 2025
Merged

rekram1-node merged 8 commits into
anomalyco:devfrom
oribarilan:feat/opencode-config-dir

Conversation

@oribarilan

@oribarilan oribarilan commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor
  • Adding OPENCODE_CONFIG_DIR to allow a custom config directory
  • Adding docs for this new flag
  • Adding tests

fixes: #3432
fixes: #3410

@rekram1-node

rekram1-node commented Oct 28, 2025 •

Copy link
Copy Markdown
Collaborator

Since this is your first OSS contribution just providing this info for future reference:

I am editing your description to include:

fixes: #3432

You can also do closes and some other terms. Basically what it does:

  • links PR to an issue
  • when PR gets merged it will automatically close the issue

Comment thread packages/opencode/src/config/config.ts Resolved
@rekram1-node

Copy link
Copy Markdown
Collaborator

/oc undo all changes to config.test.ts that were made in this PR

@opencode-agent

opencode-agent Bot commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor

Done! I've removed all the OPENCODE_CONFIG_DIR related tests from the config.test.ts file, reverting it to its original state before the PR changes.

New%20session%20-%202025-10-28T16%3A40%3A05.691Z
opencode session  |  github run

@rekram1-node

Copy link
Copy Markdown
Collaborator

/oc edit log.debug("using custom config directory", { path: Flag.OPENCODE_CONFIG_DIR }) in config.ts to be:

log.debug("loading config from OPENCODE_CONFIG_DIR", { path: Flag.OPENCODE_CONFIG_DIR })

@opencode-agent

opencode-agent Bot commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor

Done! I've updated the log message from "using custom config directory" to "loading config from OPENCODE_CONFIG_DIR" in packages/opencode/src/config/config.ts:66.

New%20session%20-%202025-10-28T16%3A45%3A14.327Z
opencode session  |  github run

@rekram1-node rekram1-node changed the title Adding OPENCODE_CONFIG_DIR to allow a custom config directory add OPENCODE_CONFIG_DIR to allow loading a custom config directory Oct 28, 2025
@rekram1-node

Copy link
Copy Markdown
Collaborator

@oribarilan thanks for the PR! I made some small tweaks but this was perfect, and congrats on your first contribution

@rekram1-node
rekram1-node merged commit eb398f1 into anomalyco:dev Oct 28, 2025
@oribarilan
oribarilan deleted the feat/opencode-config-dir branch October 28, 2025 17:16
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
…nomalyco#3504)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
…nomalyco#3504)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
…nomalyco#3504)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
…nomalyco#3504)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: custom config path to also support agent definition (via markdown) [FEATURE]:global configuration /etc/opencode

2 participants