The sync path's mergeJsonConfigAtKey had incoming entries overwriting
existing user entries on conflict. Reverse the spread order so user
config wins, matching the install path's existing behavior.
Also add merge feedback logging and a test for the sync merge path.
Fixes#125
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Before writing config.toml (Codex) or opencode.json (OpenCode), the CLI
attempts to create a timestamped backup of any existing config file.
This prevents accidental data loss when users have customized configs.
Backup is best-effort - if it fails (e.g., unusual permissions), the
install continues without blocking.
Backup files are named: config.toml.bak.2026-01-23T21-16-40-065Z
The OpenCode installer was writing to ~/.opencode but OpenCode expects
global configuration at ~/.config/opencode per XDG Base Directory spec.
Fixes:
- src/commands/install.ts: Change default output from ~/.opencode to
~/.config/opencode
- src/targets/opencode.ts: Recognize "opencode" basename (not just
".opencode") for direct writes without nesting
Closes#114🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>