Skip to content

feat(cli): write supabase/config.jsonc on init (CLI-2868) - #7756

Merged
Coly010 merged 5 commits into
developfrom
columferry/cli-2868-make-supabase-init-write-configjsonc
Nov 23, 2026
Merged

Coly010 merged 5 commits into
developfrom
columferry/cli-2868-make-supabase-init-write-configjsonc

Conversation

@Coly010

@Coly010 Coly010 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

supabase init now creates supabase/config.jsonc for new projects instead of supabase/config.toml. It starts with a $schema line pointing at the hosted config schema, so editors pick up completion and validation straight away, and it keeps every commented-out option the TOML template had.

The init template is now maintained as JSONC. Tests that need it as TOML convert it with the same converter supabase config convert uses, and a drift test checks it still converts to clean TOML. config.toml stays fully supported.

A few other bits that come with it:

  • init still treats an existing config.json, config.jsonc or config.toml as the project's config and won't write a second one
  • init --force writes a fresh config.jsonc and removes any config.json or config.toml, so the loader reads the new file
  • if .vscode/settings.json already exists, init adds https://supabase.com/schemas/ to json.schemaDownload.trustedDomains, the same as config convert does, so VS Code loads the schema without a warning. It never creates .vscode/ for this, and if the file can't be edited without losing its comments it's left alone with a warning. It only does this in text output, where the edit is reported
  • the init, start and stop docs and the local stack nudge now name config.jsonc

Release notes

New projects created with supabase init get supabase/config.jsonc instead of supabase/config.toml. Existing projects aren't touched, and the CLI and Branching read either format.

If you have tools, scripts or CI that only look for supabase/config.toml, they should also look for supabase/config.jsonc and supabase/config.json. To keep using TOML, run supabase config convert --to toml after supabase init.

Linked issue

Closes CLI-2868

New projects created with `supabase init` get supabase/config.jsonc instead
of supabase/config.toml. The file starts with a `$schema` line pointing at
the hosted config schema and keeps every commented-out option. It is
generated from the TOML init template through the `config convert`
converter, so the two can't drift. Existing projects aren't touched and
config.toml stays fully supported.

- an existing config.json, config.jsonc or config.toml still stops init
- `init --force` writes a fresh config.jsonc and removes config.json and
  config.toml
- an existing .vscode/settings.json gains the supabase.com/schemas trusted
  domain, as with `config convert`; .vscode/ is never created for it

Tools that only read supabase/config.toml should also look for
supabase/config.jsonc and supabase/config.json. To keep using TOML, run
`supabase config convert --to toml` after `supabase init`.
@Coly010
Coly010 requested a review from a team as a code owner November 23, 2026 12:24
@Coly010
Coly010 requested a review from Prashansa-K November 23, 2026 12:25
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 78b01e2 against develop at c447bce · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 210 ms 205 ms no real change
supabase --help help 203 ms 192 ms no real change (-5%, within normal variation)
supabase init init 190 ms 201 ms no real change (+6%, within normal variation)
supabase migration new bench migration-new 208 ms 223 ms no real change (+7%, within normal variation)
supabase config convert config-convert 234 ms 214 ms no real change (-9%, within normal variation)
supabase config validate config-validate 240 ms 253 ms no real change (+5%, within normal variation)
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 271 ms 273 ms no real change
supabase projects list projects-list 280 ms 260 ms no real change (-7%, within normal variation)
supabase functions list --project-ref replayfixtureprojref functions-list 259 ms 282 ms no real change (+9%, within normal variation)

API calls: unchanged for all 9 commands.

Binary size: 135.6 MB, up 4.0 KB from 135.6 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 191-257 ms 196-229 ms -5 ms (-2%) within noise
supabase --help help 175-211 ms 179-261 ms -10 ms (-5%) within noise
supabase init init 177-207 ms 184-229 ms +12 ms (+6%) within noise
supabase migration new bench migration-new 175-257 ms 182-256 ms +15 ms (+7%) within noise
supabase config convert config-convert 203-282 ms 178-390 ms -20 ms (-9%) within noise
supabase config validate config-validate 217-341 ms 207-327 ms +13 ms (+5%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 217-363 ms 219-370 ms +3 ms (+1%) within noise
supabase projects list projects-list 227-523 ms 236-395 ms -20 ms (-7%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 212-331 ms 237-396 ms +23 ms (+9%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase config validate config-validate 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@a9d1e91 supplied to reviewers (advisory, not a style pass).

Stable v3.3.0 writes TOML. Switching init to JSONC breaks workflows that use the generated TOML path, and --force can overwrite the target of a JSONC symlink. The new VS Code trust edit runs without opt-in and is silent in structured output. Adjudication also found two unchanged lifecycle E2E assertions that expect the TOML file. The review verified these findings by reading source. The E2E suite was unrun, and PR base and description metadata were unavailable.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/shared/init/project-init.ts:321 breaking-change claude The released supabase init command changes its output from supabase/config.toml to supabase/config.jsonc. On an existing TOML project, init --force now deletes the TOML file. Scripts, CI workflows, and older CLI versions that consume the generated TOML path can fail or use defaults. Please use a type(scope)!: title, add a BREAKING CHANGE: line to the PR description, and retarget the PR to next.
🟠 MAJOR apps/cli/src/shared/init/project-init.ts:322 filesystem-safety codex supabase init --force can overwrite the target of a config.jsonc symlink, including a config shared with another checkout.
🟠 MAJOR apps/cli/src/shared/init/project-init.ts:322 test-reliability codex Two project lifecycle E2E tests will fail against the new scaffold because they still assert that config.toml exists after successful init.
🟠 MAJOR apps/cli/src/shared/init/project-init.ts:354 side-effects claude+codex Init changes an existing VS Code workspace’s schema-download trust without a VS Code settings opt-in. JSON and stream-JSON callers receive no notice of the change or of a failed update.
🟡 MINOR apps/cli/src/shared/init/project-init.ts:330 error-handling codex A failed cleanup can leave the new JSONC scaffold in use after init --force reports an error, with only part of the old config set removed.
🟡 MINOR apps/cli/src/shared/init/project-init.templates.ts:568 error-handling codex A scaffold conversion refusal becomes a defect and bypasses init’s typed command error handling.
🟡 MINOR apps/cli/docs/supabase/start.md:5 docs-drift codex The start and stop overlays describe TOML as a file the current supabase init can create.
🟡 MINOR apps/cli/tests/helpers/cli.ts:367 test-reliability codex The JSONC port rewriters can silently leave a default port active when a valid formatting change adds an inline comment or changes colon spacing.
🟡 MINOR apps/cli/src/commands/start/start.slim-images.e2e.test.ts:109 test-reliability codex The slim-images test can use a different service’s port if the API object omits its active port property.
🟡 MINOR apps/cli/tests/helpers/declarative-sync-e2e.ts:104 test-reliability codex Declarative sync setup can continue without setting the explicit schema-path override when the scaffold comment’s formatting changes.
🟡 MINOR apps/cli/src/shared/init/project-init.ts:163 observability codex The new schema-trust filesystem phase has no named span or trace outcome.
🟡 MINOR apps/cli/src/commands/init/init.integration.test.ts:154 test-coverage codex The default-init integration test can pass with a commented-out API port or a TOML artifact that exists but cannot be read.
🟡 MINOR apps/cli/src/command-internal/config-advice.ts:11 correctness claude Config guidance falls back to the TOML path and syntax when there is no loaded config, even though init now creates JSONC. The hard-coded stack and log hints also direct users of new JSONC projects to edit TOML.
⚪ NIT apps/cli/docs/supabase/init.md:9 docs-style codex The changed directory example uses both “such as” and “etc.” to introduce a non-exhaustive list, and uses “may” where it describes what the directory can contain.

Findings outside the diff

  • 🟡 MINOR apps/cli/src/command-internal/config-advice.ts:11 — Config guidance falls back to the TOML path and syntax when there is no loaded config, even though init now creates JSONC. The hard-coded stack and log hints also direct users of new JSONC projects to edit TOML.

Stats

Claude findings: 3 · Codex findings: 11 · Confirmed: 14 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/docs/supabase/init.md Resolved
`supabase init` writes config.jsonc, so the template is now maintained in
that format and no longer converted from TOML at runtime. Tests that need
the template as TOML derive it with the JSONC-to-TOML converter, and the
drift test now checks the JSONC converts to clean TOML.

Also from review:
- `init --force` replaces a symlinked config.jsonc instead of writing
  through to its target
- the VS Code schema trust edit runs only in text output, where it is
  reported, and records its outcome on an `Init.trustSchemaDomain` span
- e2e helpers edit config.jsonc through the JSONC editor and verify the
  values landed
- start/stop/init docs wording
The stack backend hints in `--stack` and `logs` errors and the stack guide
named supabase/config.toml and its TOML table syntax. After `supabase init`
the project has config.jsonc, so they now say to set `experimental.stack`
in the project config and the guide shows the JSONC form.
@Coly010
Coly010 added this pull request to the merge queue Nov 23, 2026
Merged via the queue into develop with commit ed02850 Nov 23, 2026
50 checks passed
@Coly010
Coly010 deleted the columferry/cli-2868-make-supabase-init-write-configjsonc branch November 23, 2026 13:13
avallete added a commit to supabase/pg-toolbelt that referenced this pull request Nov 23, 2026
supabase/cli#7756 makes init write supabase/config.jsonc, so the harness
failed reading config.toml:

  ENOENT: no such file or directory, open '.../supabase/config.toml'

Run `supabase config convert --to toml` after init; the smoke set passes
on the stack backend against CLI develop ed02850b5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coly010 added a commit to supabase/evals that referenced this pull request Nov 24, 2026
#550)

## Current Behavior

`supabase init` writes `supabase/config.jsonc` instead of
`supabase/config.toml` from CLI `v3.4.0-beta.3` / `v4.0.0-next.47`
([supabase/cli#7756](supabase/cli#7756)). The
CLI reads `config.toml`, `config.json` or `config.jsonc`, but a few of
our CLI scorers only look for `config.toml`.

In this morning's daily CLI run
([45326340108](https://github.com/supabase/evals/actions/runs/45326340108))
that showed up as false fails on beta and next. Every one of these runs
had `supabase/config.jsonc` in the final workspace and the agent had
done the task:

| eval | stable | beta | next |
| --- | --- | --- | --- |
| `build-database-002-stack-lifecycle` | 3/3 | 0/3 | 0/3 |
| `build-database-003-parallel-projects` | 1/3 | 0/3 | 0/3 |
| `resolve-database-003-docker-mode-unavailable` | 3/3 | 0/3 | 0/3 |

I also went through the beta/next transcripts for config-related CLI
errors and didn't find any. As far as I can tell the CLI side of the
jsonc change is fine, it's only our scorers that need to catch up.

## Expected Behavior

- `findProjectDirs` in `evals/cli/lib/projects.ts` finds
`supabase/config.toml`, `config.json` and `config.jsonc`, and a
directory with more than one counts as one project (otherwise it'd be
reported as ambiguous). That covers `build-database-003`,
`resolve-database-003` and the project lookup in `resolve-database-002`.
- `build-database-002`'s "project initialised" check passes for any of
the three files.
- `resolve-database-002`'s leftover `legacy-import` port probe reads
`db.port` from `config.json`, then `config.jsonc`, then `config.toml`,
matching the CLI's precedence. It wasn't failing yet, but it would've
silently fallen back to 54322 for a jsonc project.
- Tests for jsonc-only, json-only and toml + jsonc projects, plus the
jsonc port read.
- READMEs updated where they describe these checks.

One thing worth a look: three check names change so they don't say
`config.toml` any more, i.e. `supabase project initialised
(supabase/config.toml exists)` becomes `supabase project initialised
(supabase config file exists)`. Anything keyed on check name (Braintrust
/ Hex) starts fresh history for those three. I think that's better than
keeping a name that's wrong, but if you'd rather keep the old names for
continuity I'm fine reverting that part.

The evals that seed their own `local/supabase/config.toml` (and the
format-specific `build-cli-005`..`008`) are untouched.

## Related Issue(s)

None, found while checking the beta results for the jsonc init change.
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.

2 participants