Skip to content

Installing to opencode overwrites opencode.json file #125

Closed

Description

@ccidral

I installed compound engineering to opencode at ~/.config/opencode and it overwrote the ~/.config/opencode/opencode.json file so I lost all my existing configuration (mcp, permissions, tools, etc).

Activity

  1. added
    bug
    on Feb 17, 2026
  2. 0ut5ider commented on Feb 20, 2026

    @0ut5ider

    When I ran the install script for opencode today, it backed up my old opencode.json file, so this issue may have already been fixed?

  3. ccidral commented on Feb 20, 2026

    @ccidral
    Author

    I guess that mitigates the problem but I suppose a more convenient approach would be to update the existing opencode.json file with the plugin configuration instead of replacing it or creating a backup of it.

  4. pelletencate commented on Mar 6, 2026

    @pelletencate

    I installed it today, and I also noticed that it created an opencode.json file, completely ignoring my already present opencode.jsonc file.

  5. 0ut5ider commented on Mar 8, 2026

    @0ut5ider

    I have fixed this issue is a previous PR. It could be that the npm repo is not updated and when you run the bunx command (shown in README.md) it pulls an outdated version of the code.

    Try running bun run src/index.ts install compound-engineering --to opencode
    This will use the local source to run the script.

  6. added a commit that references this issue on Mar 9, 2026
    1db7680
  7. mvanhorn commented on Mar 9, 2026

    @mvanhorn
    Contributor

    The install path already has merge logic that preserves user config (added in #119 and subsequent commits), but I found that the sync path's mergeJsonConfigAtKey had the spread order reversed - incoming plugin entries were overwriting existing user entries on name conflict.

    PR #239 fixes the sync path spread order to match the install path's behavior (user config wins), adds user-facing feedback when merging, and adds a test for this case.

  8. ryanleecode commented on Mar 20, 2026

    @ryanleecode

    this doesnt work at all it just creates an opencode.json with context7 mcp and nothing else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions