Repository navigation
feat(cli): write supabase/config.jsonc on init (CLI-2868) - #7756
Conversation
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`.
CLI benchmark (Lightweight Commands): no changes foundCommit
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 phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 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.
`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.
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>
#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.
Summary
supabase initnow createssupabase/config.jsoncfor new projects instead ofsupabase/config.toml. It starts with a$schemaline 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 convertuses, and a drift test checks it still converts to clean TOML.config.tomlstays fully supported.A few other bits that come with it:
initstill treats an existingconfig.json,config.jsoncorconfig.tomlas the project's config and won't write a second oneinit --forcewrites a freshconfig.jsoncand removes anyconfig.jsonorconfig.toml, so the loader reads the new file.vscode/settings.jsonalready exists,initaddshttps://supabase.com/schemas/tojson.schemaDownload.trustedDomains, the same asconfig convertdoes, 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 reportedinit,startandstopdocs and the local stack nudge now nameconfig.jsoncRelease notes
New projects created with
supabase initgetsupabase/config.jsoncinstead ofsupabase/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 forsupabase/config.jsoncandsupabase/config.json. To keep using TOML, runsupabase config convert --to tomlaftersupabase init.Linked issue
Closes CLI-2868