Skip to main content

opencode_home_dir

Function opencode_home_dir 

Source
pub fn opencode_home_dir(root: &Path, project: &str, agent: &str) -> PathBuf
Expand description

Absolute path to the per-agent OpenCode home directory. OpenCode has no single state-root env var like CODEX_HOME; per-agent isolation is two env vars pointing into this rendered dir instead: OPENCODE_DB relocates the session sqlite db (created beside its -shm/-wal sidecars) and OPENCODE_CONFIG loads the per-process config json carrying the MCP servers + instructions. render writes <this>/opencode.json; the wrapper’s env file points both vars here. Credentials are NOT relocated — auth stays at the operator’s real ~/.local/share/opencode/auth.json, shared by every agent.