-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Problem
OMO currently hardcodes configuration paths to ~/.config/opencode/oh-my-opencode.json without any mechanism to override the config directory location.
This breaks compatibility with tools like OCX that use profile-based isolation. OCX's ghost mode stores configurations per-profile:
~/.config/opencode/profiles/
├── default/
│ ├── opencode.jsonc
│ └── .opencode/oh-my-opencode.json
├── work/
│ └── ...
└── personal/
└── ...
When running ocx ghost opencode, users expect their profile-specific OMO configuration to be used—but OMO always reads from the global path.
Proposed Solution
Add OPENCODE_CONFIG_DIR environment variable support, following the existing CLAUDE_CONFIG_DIR pattern already in the codebase.
Resolution order: OPENCODE_CONFIG_DIR → project config → XDG/global config
This allows tools like OCX to set the env var when spawning OpenCode:
OPENCODE_CONFIG_DIR=~/.config/opencode/profiles/work opencodeBenefits
- Profile isolation — Different OMO settings per profile (work, personal, oss)
- OCX compatibility — Ghost mode works seamlessly with OMO
- Industry standard — Matches Docker (
DOCKER_CONFIG), Cargo (CARGO_HOME), Claude Code (CLAUDE_CONFIG_DIR) - Minimal change — Follows existing pattern in
src/shared/claude-config-dir.ts
Scope
- Add env var check to
src/shared/opencode-config-dir.ts - Update
src/shared/config-path.tsto use shared logic - Add unit tests
- Document in README
chilipvlmer, motonari728, emretfn and Kh05ifr4nD
Metadata
Metadata
Assignees
Labels
No labels