From 4f331cc9cf7cfe63c28194c7c4229429569c5099 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 13 Oct 2026 14:19:31 +0200 Subject: opencode2-bin: isolate config/state with a launcher wrapper Install the real binary as /usr/libexec/opencode2/opencode and make /usr/bin/opencode2 a wrapper that points XDG_CONFIG_HOME and XDG_DATA_HOME at opencode2-specific directories, so 2.0 does not touch the v1 opencode package's config, auth or state. --- opencode2-bin/README | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'opencode2-bin/README') diff --git a/opencode2-bin/README b/opencode2-bin/README index 511792d..67f16b7 100644 --- a/opencode2-bin/README +++ b/opencode2-bin/README @@ -12,12 +12,11 @@ The binary is compiled with Bun and is self-contained (no runtime dependencies). The default build targets glibc x86_64 with AVX2. On a CPU without AVX2, use the `-baseline` variant instead. -OpenCode v1 and v2 share the same configuration and state directories -(`~/.config/opencode`, `~/.local/share/opencode`). To test 2.0 without -touching the v1 state, run it with an isolated XDG environment, e.g.: - - XDG_CONFIG_HOME=~/.config/opencode2 \ - XDG_DATA_HOME=~/.local/share/opencode2 \ - opencode2 +OpenCode v1 and v2 would otherwise share the same configuration and +state directories (`~/.config/opencode`, `~/.local/share/opencode`). +The `opencode2` command is therefore a wrapper that launches the real +binary with `XDG_CONFIG_HOME` and `XDG_DATA_HOME` pointed at +`~/.config/opencode2` and `~/.local/share/opencode2`, keeping 2.0's +config and state separate from the v1 package. Homepage: https://opencode.ai -- cgit v1.2.3