[FEATURE]: custom config path to also support agent definition (via markdown) #2272

Closed
opened 2026-02-16 17:34:55 -05:00 by yindo · 5 comments
Owner

Originally created by @oribarilan on GitHub (Oct 25, 2025).

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

I would like to use a different path for all of my opencode's configuration.
Currently, I am seeting OPENCODE_CONFIG as an env variable as suggested in the docs, and it works well.
However, OPENCODE_CONFIG should point to the json file rather than my custom folder, which made me suspect it won't pick up any agents defined in my {OPENCODE_CONFIG}/agent/*.md dir.
Sadly I checked this out and I am right.

Feature ask is to allow agents be defined in markdown in a custom directory path.

I believe a clean way to handle it is to have OPENCODE_CONFIG to point to an entire opencode config directory, which can include any existing or future configuration, agent file being among this.

My current workaround is to use the json to define agents.

Thanks for making such an awesome tool!

Originally created by @oribarilan on GitHub (Oct 25, 2025). ### 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 a different path for all of my opencode's configuration. Currently, I am seeting `OPENCODE_CONFIG` as an env variable as suggested in the docs, and it works well. However, `OPENCODE_CONFIG` should point to the json file rather than my custom folder, which made me suspect it won't pick up any agents defined in my `{OPENCODE_CONFIG}/agent/*.md` dir. Sadly I checked this out and I am right. Feature ask is to allow agents be defined in markdown in a custom directory path. I believe a clean way to handle it is to have `OPENCODE_CONFIG` to point to an entire opencode config directory, which can include any existing or future configuration, agent file being among this. My current workaround is to use the json to define agents. Thanks for making such an awesome tool!
yindo added the help-wanteddiscussiongood first issue labels 2026-02-16 17:34:55 -05:00
yindo closed this issue 2026-02-16 17:34:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 25, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3410: Similar request for custom agent configuration paths, specifically mentions agent markdown files in custom directories like /etc/opencode/agent/xx.md and ~/.config/opencode/

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 25, 2025): This issue might be a duplicate of existing issues. Please check: - #3410: Similar request for custom agent configuration paths, specifically mentions agent markdown files in custom directories like `/etc/opencode/agent/xx.md` and `~/.config/opencode/` Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 25, 2025):

I guess we could add an OPENCODE_CONFIG_DIR

Edit:
add var here

and then implement here similar to Flag.OPENCODE_CONFIG

@rekram1-node commented on GitHub (Oct 25, 2025): I guess we could add an OPENCODE_CONFIG_DIR Edit: add var [here](https://github.com/sst/opencode/blob/dev/packages/opencode/src/flag/flag.ts) and then implement [here](https://github.com/sst/opencode/blob/0af450575647fc906f017b0065fe3aca227c369f/packages/opencode/src/config/config.ts#L24) similar to `Flag.OPENCODE_CONFIG`
Author
Owner

@oribarilan commented on GitHub (Oct 28, 2025):

Hey @rekram1-node !
I followed your guidance and tried to contribute.
This is my first ever opensource contribution so please excuse me if something is off.

I did not yet have a chance to test this e2e, but maybe you have some comments beforehand.

Thanks!

https://github.com/sst/opencode/pull/3504

@oribarilan commented on GitHub (Oct 28, 2025): Hey @rekram1-node ! I followed your guidance and tried to contribute. This is my first ever opensource contribution so please excuse me if something is off. I did not yet have a chance to test this e2e, but maybe you have some comments beforehand. Thanks! https://github.com/sst/opencode/pull/3504
Author
Owner

@rekram1-node commented on GitHub (Oct 28, 2025):

let's go nice! I will check it out

@rekram1-node commented on GitHub (Oct 28, 2025): let's go nice! I will check it out
Author
Owner

@rekram1-node commented on GitHub (Oct 28, 2025):

added support for loading configs from specified dir OPENCODE_CONFIG_DIR it will be in next release

thanks to @oribarilan

@rekram1-node commented on GitHub (Oct 28, 2025): added support for loading configs from specified dir OPENCODE_CONFIG_DIR it will be in next release thanks to @oribarilan
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2272