You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## TL;DR
`supabase init` now runs natively in ts
## What’s introduced
adds a shared native `init` implementation
the command now creates the local project directly in TypeScript,
including `supabase/config.toml`, `supabase/.gitignore`, and
the optional VS Code and IntelliJ settings files,
while preserving existing behavior around `--force`, `--interactive`,
legacy hidden IDE flags, and the
`--experimental` requirement for `--use-orioledb`.....
& coverage all around this!
## Ref
- closes CLI-1303
---------
Co-authored-by: Colum Ferry <cferry09@gmail.com>
|`init`|`partial`|[`../src/next/commands/init/init.command.ts`](../src/next/commands/init/init.command.ts)|`--force`, `--interactive`, `--use-orioledb`|`-`| TS init creates a minimal `supabase/config.json` with only a `"$schema"` reference and ensures repo-local `.supabase/` state can stay gitignored, but it does not yet expose the old Go flag surface.|
68
+
|`init`|`ported`|[`../src/next/commands/init/init.command.ts`](../src/next/commands/init/init.command.ts)|`-`|`-`| TS init now writes the Go-style `supabase/config.toml` scaffold, updates `supabase/.gitignore` only when invoked inside a git repo, supports `--force`, `--interactive`, and `--use-orioledb`, and shares the same native implementation with the legacy shell command.|
69
69
|`link`|`partial`|[`../src/next/commands/link/link.command.ts`](../src/next/commands/link/link.command.ts)|`--password`, `--skip-pooler`|`-`| TS link supports `--project-ref`, interactive project selection, and zero-config linking. It stores linked remote metadata in repo-local `.supabase/project.json`, but it does not yet manage direct database-password or pooler-specific link flows. |
70
70
|`unlink`|`ported`|[`../src/next/commands/unlink/unlink.command.ts`](../src/next/commands/unlink/unlink.command.ts)|`-`|`-`| TS unlink matches the current Go surface and removes the repo-local linked project metadata for the active checkout. |
71
71
|`login`|`ported`|[`../src/next/commands/login/login.command.ts`](../src/next/commands/login/login.command.ts)|`-`|`-`| Flag surface matches the old CLI: `--token`, `--name`, `--no-browser`. TS also supports env-var and piped-stdin token input without adding new flags. |
|`0`| success - prints "Finished supabase init." |
38
+
|`1`|`supabase/config.toml` already exists and `--force` was not provided |
39
+
|`1`| permission denied writing config file |
40
+
|`1`| an existing `.vscode/settings.json` / `.vscode/extensions.json` is not valid JSON(C) |
38
41
39
42
## Output
40
43
41
-
### `--output-format text` (Go CLI compatible)
44
+
### Legacy Output
42
45
43
46
On success:
44
47
@@ -48,19 +51,15 @@ Finished supabase init.
48
51
49
52
In interactive mode (`-i`/`--interactive`), may prompt for IDE settings preferences.
50
53
51
-
### `--output-format json`
52
-
53
-
Not applicable — init produces no machine-readable output.
54
-
55
-
### `--output-format stream-json`
56
-
57
-
Not applicable — init produces no structured output.
54
+
Success is emitted as raw text even when the legacy shell is invoked with non-text output modes.
58
55
59
56
## Notes
60
57
61
-
-Sets `WORKDIR` to `"."` in `PersistentPreRunE` to prevent recursing to parent directories.
58
+
-Uses the invocation cwd directly and does not recurse upward looking for an existing project.
62
59
- The `--force` flag overwrites an existing `supabase/config.toml`.
63
60
- The `--use-orioledb` flag sets `UseOrioleDB` in init params; requires `--experimental` flag.
64
61
- The `--interactive` / `-i` flag enables IDE settings prompts (only effective in TTY).
65
-
- The `--with-vscode-settings`, `--with-vscode-workspace`, and `--with-intellij-settings` flags are hidden backward-compat aliases.
66
-
- No authentication required — purely local file creation.
62
+
- The `--with-vscode-settings` and `--with-vscode-workspace` flags are hidden backward-compat aliases for the same VS Code helper and both write `.vscode/settings.json` and `.vscode/extensions.json`.
63
+
- The `--with-intellij-settings` flag is a hidden backward-compat alias for generating `.idea/deno.xml`.
64
+
- An existing `.vscode/settings.json` / `.vscode/extensions.json` is parsed tolerantly through a JSONC boundary that strips line/block comments and trailing commas (matching Go's `jsonc.ToJSONInPlace`), then the template is merged on top (template keys win). An empty file is treated as absent and the template is written verbatim. A non-empty file that is not valid JSON(C) aborts the command with `InitParseSettingsError` and is left untouched rather than being overwritten.
65
+
- No authentication required - purely local file creation.
0 commit comments