From eb398f1951764af812c7ef01f37f01da862a852a Mon Sep 17 00:00:00 2001 From: oribi Date: Tue, 28 Oct 2025 18:50:09 +0200 Subject: add OPENCODE_CONFIG_DIR to allow loading a custom config directory (#3504) Co-authored-by: opencode-agent[bot] Co-authored-by: rekram1-node --- packages/web/src/content/docs/config.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'packages/web/src/content/docs') diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index f3b2a05a0..2a259ff37 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -61,6 +61,22 @@ opencode run "Hello world" --- +### Custom directory + +You can specify a custom config directory using the `OPENCODE_CONFIG_DIR` +environment variable. This directory will be searched for agents, commands, +modes, and plugins just like the standard `.opencode` directory, and should +follow the same structure. + +```bash +export OPENCODE_CONFIG_DIR=/path/to/my/config-directory +opencode run "Hello world" +``` + +Note: The custom directory is loaded after the global config and `.opencode` directories, so it can override their settings. + +--- + ## Schema The config file has a schema that's defined in [**`opencode.ai/config.json`**](https://opencode.ai/config.json). -- cgit v1.2.3