[PR #1434] [MERGED] feat: jsonc configuration file support #9933

Closed
opened 2026-02-16 18:14:24 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1434
Author: @rekram1-node
Created: 7/30/2025
Status: Merged
Merged: 7/31/2025
Merged by: @adamdotdevin

Base: devHead: jsonc-config


📝 Commits (1)

📊 Changes

5 files changed (+31 additions, -8 deletions)

View changed files

📝 bun.lock (+1 -0)
📝 packages/opencode/package.json (+1 -0)
📝 packages/opencode/src/cli/error.ts (+5 -1)
📝 packages/opencode/src/config/config.ts (+16 -5)
📝 packages/web/src/content/docs/docs/config.mdx (+8 -2)

📄 Description

addresses: #995

This is fairly simple, uses the standard jsonc parsing lib by microsoft.

Very similar pattern is seen in wrangler see here

I noticed opencode already picks up opencode.jsonc but ofc it will break if the person actually has any comments since JSON.parse was used instead of jsonc parsing.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1434 **Author:** [@rekram1-node](https://github.com/rekram1-node) **Created:** 7/30/2025 **Status:** ✅ Merged **Merged:** 7/31/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `jsonc-config` --- ### 📝 Commits (1) - [`8a232f6`](https://github.com/anomalyco/opencode/commit/8a232f6a23c511efcb5817317100197f8f792767) feat: jsonc support ### 📊 Changes **5 files changed** (+31 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `bun.lock` (+1 -0) 📝 `packages/opencode/package.json` (+1 -0) 📝 `packages/opencode/src/cli/error.ts` (+5 -1) 📝 `packages/opencode/src/config/config.ts` (+16 -5) 📝 `packages/web/src/content/docs/docs/config.mdx` (+8 -2) </details> ### 📄 Description addresses: #995 This is fairly simple, uses the standard jsonc parsing lib by microsoft. Very similar pattern is seen in wrangler see [here](https://github.com/cloudflare/workers-sdk/blob/6e6d4a8c95b720bf8b1d64b5d21c7c737454e6d4/packages/wrangler/src/parse.ts#L174) I noticed opencode already picks up `opencode.jsonc` but ofc it will break if the person actually has any comments since JSON.parse was used instead of jsonc parsing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:24 -05:00
yindo closed this issue 2026-02-16 18:14:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9933