You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: custom config path to also support agent definition (via markdown) #3432
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.
changed the title [-][FEATURE]: custom config to also support agent definition (via markdown)[/-][+][FEATURE]: custom config path to also support agent definition (via markdown)[/+]on Oct 25, 2025
This issue might be a duplicate of existing issues. Please check:
[FEATURE]:global configuration /etc/opencode #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.
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.
Activity
[-][FEATURE]: custom config to also support agent definition (via markdown)[/-][+][FEATURE]: custom config path to also support agent definition (via markdown)[/+]github-actions commentedon Oct 25, 2025
This issue might be a duplicate of existing issues. Please check:
/etc/opencode/agent/xx.mdand~/.config/opencode/Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 25, 2025
I guess we could add an OPENCODE_CONFIG_DIR
Edit:
add var here
and then implement here similar to
Flag.OPENCODE_CONFIGoribarilan commentedon 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!
#3504
rekram1-node commentedon Oct 28, 2025
let's go nice! I will check it out
rekram1-node commentedon Oct 28, 2025
added support for loading configs from specified dir OPENCODE_CONFIG_DIR it will be in next release
thanks to @oribarilan
TomaszSz368 commentedon Mar 5, 2026
Could we add adding agents like we can add skills by adding path?
{ "$schema": "https://opencode.ai/config.json", "skills": { "paths": ["./node_modules/<my_skills_package>/skills/"] }, }Something like this:
{ "$schema": "https://opencode.ai/config.json", "agents": { "paths": ["./node_modules/<my_skills_package>/agents/"] }, }