Repository navigation
feat: write OMO config into ~/.omo/omo.jsonc [opencode] block and slim to .jsonc - #2
Merged
Merged
Conversation
…m to .jsonc OMO >= 4.19.3 only reads ~/.omo/omo.jsonc, so synced settings were ignored. All file writes now go through applyBundle(bundle, dirs): - OMO: replace only the "[opencode]" property via jsonc-parser so comments and other blocks survive; create ~/.omo/ if missing; write omo.json instead when that is the file OMO reads. A corrupt or non-object file aborts the sync before anything is written. - Slim: write oh-my-opencode-slim.jsonc so an installer .jsonc can't shadow it. - Legacy oh-my-opencode(-slim).json files are never touched. Closes #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1 · Parent spec: itsmylife44/cliproxyapi-dashboard#285
Why
OMO ≥ 4.19.3 only reads
~/.omo/omo.jsonc, so dashboard settings synced tooh-my-opencode.jsonhave been ignored since ~2026-07-28. Slim configs could also be shadowed by an installer-createdoh-my-opencode-slim.jsonc.What
applyBundle(bundle, dirs)(src/writer.ts);index.tskeeps version check, fetch, logging and the toast."[opencode]"property of~/.omo/omo.jsoncviajsonc-parser(modify+applyEdits), so comments, formatting and other blocks ([native],[codex], …) are byte-preserved. Creates~/.omo/and the file if missing.oh-my-opencode-slim.jsonc.oh-my-opencode.json/oh-my-opencode-slim.jsonare never touched.Beyond the ticket (deliberate)
~/.omo/omo.jsonexists, the plugin writes there, mirroring upstream'sdetectUserOmoJsonPath(jsonc first, then json).omo.jsoncaborts the sync before any file is written (clear error, retried on next start), instead of writing back garbage.jsonc-parseris imported from its ESM build: bundling the default UMD entry left a brokenrequire("./impl/format")indist. Verifieddist/index.jsloads in Node.Known limit
All OCX profiles share one
~/.omo/omo.jsonc(OMO profiles are out of scope per the spec). Documented in the README.Tests
bun test12 pass (temp dirs): comments/other blocks preserved, missing~/.omo/created,omo.jsonfallback, slim.jsonc, legacy files untouched, changed-path reporting, 3 corrupt-file cases.bun run typecheckclean.Release note
Bump
versionbefore merging: CI skips publishing a version already on npm, and this must ship before the dashboard's affected-user banner (cliproxyapi-dashboard#295).