Skip to content

feat(install): detect & reuse opencode.jsonc, pin plugin to @latest#24

Merged
justin-carper merged 1 commit into
mainfrom
opencode-config-detection
Jun 16, 2026
Merged

feat(install): detect & reuse opencode.jsonc, pin plugin to @latest#24
justin-carper merged 1 commit into
mainfrom
opencode-config-detection

Conversation

@justin-carper

Copy link
Copy Markdown
Collaborator

What

Make install.sh config-format aware and keep the plugin spec fresh.

  • Detect & reuse an existing opencode.jsonc or opencode.json (preference: existing .jsonc → existing .json → default .json).
  • Comment-preserving edits: a comment/string-aware node editor patches the raw text in place, so .jsonc comments and user formatting survive. jq stays as a fallback for plain .json when node is unavailable.
  • Pin to @latest dist-tag so opencode re-resolves to the newest release each startup; older/pinned entries are upgraded in place.
  • README documents .jsonc support and the @latest suffix (drop it or pin a version to opt out).

Verification

  • bash -n install.sh → OK
  • shellcheck install.sh → clean

Left for reviewer

Functional test of the JSONC editor against fixtures (existing .jsonc with comments, existing .json, no config) was not run — syntax-clean only.

Reuse an existing opencode.jsonc or opencode.json if present (comments
preserved via a comment-aware node editor), else create opencode.json.
Pin the plugin spec to the @latest dist-tag and upgrade older/pinned
entries in place. jq remains a fallback for plain .json.

Document .jsonc support and the @latest suffix in the README.
@justin-carper justin-carper merged commit 62fa968 into main Jun 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant