Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/cli/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# oxfmt reads .prettierignore by default. Autogenerated files that must stay
# byte-identical to their generator's output (never reformat):
src/shared/feedback/database.types.ts
17 changes: 9 additions & 8 deletions apps/cli/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,15 @@ Always check `src/shared/` before writing new infrastructure. Do not duplicate w

Also check the following `legacy/` infrastructure before writing equivalent helpers from scratch:

| Path | What it provides |
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `legacy/config/legacy-cli-config.layer.ts` | `LegacyCliConfig` — resolves `SUPABASE_PROFILE` (built-in name **or** YAML file path), `--workdir`, `--experimental`, project-id from `supabase/config.toml` |
| `legacy/config/legacy-project-ref.layer.ts` | `LegacyProjectRefResolver` — `--project-ref` flag → env → `supabase/.temp/project-ref` file → prompt; matches Go's resolver order |
| `legacy/telemetry/legacy-telemetry-state.layer.ts` | `LegacyTelemetryState.flush` — writes `~/.supabase/telemetry.json`, runs in every command's `Effect.ensuring` |
| `legacy/telemetry/legacy-linked-project-cache.layer.ts` | `LegacyLinkedProjectCache.cache(ref)` — writes `<workdir>/supabase/.temp/linked-project.json` after `--project-ref` resolves; bypasses generated schema validation (uses raw HTTP client) |
| `legacy/auth/legacy-http-debug.layer.ts` | `legacyHttpClientLayer` — wraps the HTTP transport with a `--debug` stderr logger in Go's `log.LstdFlags` format |
| `legacy/output/legacy-glamour-table.ts` | `renderGlamourTable(headers, rows)` — byte-exact ASCII match for Go's `glamour.RenderTable(..., AsciiStyle)` |
| Path | What it provides |
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `legacy/config/legacy-cli-config.layer.ts` | `LegacyCliConfig` — resolves `SUPABASE_PROFILE` (built-in name **or** YAML file path), `--workdir`, `--experimental`. Its `projectId` is a bare `SUPABASE_PROJECT_ID` env passthrough — it does **not** read `config.toml` or the linked-project file, so it is `None` in a linked project unless that env var is set. Never treat it as "the linked project ref" on its own; see the two rows below |
| `legacy/config/legacy-project-ref.layer.ts` | `LegacyProjectRefResolver` — `--project-ref` flag → env → `supabase/.temp/project-ref` file → prompt; matches Go's resolver order. `resolveOptional` is the soft-load variant (no prompt, no error when unlinked). Requires `LegacyPlatformApiFactory` for its prompt path, so commands that must work unauthenticated should read the file directly instead |
| `legacy/shared/legacy-temp-paths.ts` | `legacyTempPaths(path, workdir)` — the `<workdir>/supabase/.temp/*` paths `supabase link` writes; `legacyReadProjectRefFile(fs, path, workdir)` reads the linked ref with no API/TTY dependency (absent or blank file → `None`; other read errors fail) |
| `legacy/telemetry/legacy-telemetry-state.layer.ts` | `LegacyTelemetryState.flush` — writes `~/.supabase/telemetry.json`, runs in every command's `Effect.ensuring` |
| `legacy/telemetry/legacy-linked-project-cache.layer.ts` | `LegacyLinkedProjectCache.cache(ref)` — writes `<workdir>/supabase/.temp/linked-project.json` after `--project-ref` resolves; bypasses generated schema validation (uses raw HTTP client) |
| `legacy/auth/legacy-http-debug.layer.ts` | `legacyHttpClientLayer` — wraps the HTTP transport with a `--debug` stderr logger in Go's `log.LstdFlags` format |
| `legacy/output/legacy-glamour-table.ts` | `renderGlamourTable(headers, rows)` — byte-exact ASCII match for Go's `glamour.RenderTable(..., AsciiStyle)` |

---

Expand Down
15 changes: 8 additions & 7 deletions apps/cli/docs/go-cli-porting-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ This tracker is command-focused, but root global flag drift is large enough to n

These commands exist in the TS CLI today but have no direct top-level equivalent in the old Go CLI reference.

| TS command | TS path | Notes |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dev` | `planned` | Reserved for a TS-native long-running local development workflow command that watches files and orchestrates subcommands. Track this as TS-only unless a direct Go equivalent emerges. |
| `logs` | [`../src/next/commands/logs/logs.command.ts`](../src/next/commands/logs/logs.command.ts) | Streams local stack logs. No top-level `logs` command exists in the old Go CLI reference. |
| `api` | [`../src/next/commands/platform/api.command.ts`](../src/next/commands/platform/api.command.ts) | Low-level Management API client. It supersedes the old generated tree with explicit discovery via `supabase api routes` and execution via `supabase api request <route> [--method <METHOD>]`. |
| `stack` | [`../src/next/cli/root.ts`](../src/next/cli/root.ts) | TS-only local runtime namespace exposing `stack start`, `stack stop`, `stack status`, `stack list`, and `stack update`. Top-level `start`, `stop`, and `status` remain aliases. |
| `branches switch` | [`../src/next/commands/branches/switch/switch.command.ts`](../src/next/commands/branches/switch/switch.command.ts) | No direct Go equivalent. Updates local active-branch state so subsequent commands target the selected branch. |
| TS command | TS path | Notes |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dev` | `planned` | Reserved for a TS-native long-running local development workflow command that watches files and orchestrates subcommands. Track this as TS-only unless a direct Go equivalent emerges. |
| `feedback` | [`../src/legacy/commands/feedback/feedback.command.ts`](../src/legacy/commands/feedback/feedback.command.ts) | Quick feedback submission (alias `btw`), legacy shell only. Posts to the `interfaces_feedback` table via supabase-js with a committed publishable key; profile-driven staging/production environments (production currently reuses staging, CLI-1946). |
| `logs` | [`../src/next/commands/logs/logs.command.ts`](../src/next/commands/logs/logs.command.ts) | Streams local stack logs. No top-level `logs` command exists in the old Go CLI reference. |
| `api` | [`../src/next/commands/platform/api.command.ts`](../src/next/commands/platform/api.command.ts) | Low-level Management API client. It supersedes the old generated tree with explicit discovery via `supabase api routes` and execution via `supabase api request <route> [--method <METHOD>]`. |
| `stack` | [`../src/next/cli/root.ts`](../src/next/cli/root.ts) | TS-only local runtime namespace exposing `stack start`, `stack stop`, `stack status`, `stack list`, and `stack update`. Top-level `start`, `stop`, and `status` remain aliases. |
| `branches switch` | [`../src/next/commands/branches/switch/switch.command.ts`](../src/next/commands/branches/switch/switch.command.ts) | No direct Go equivalent. Updates local active-branch state so subsequent commands target the selected branch. |

## Quick Start

Expand Down
2 changes: 2 additions & 0 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@supabase/config": "workspace:*",
"@supabase/process-compose": "workspace:*",
"@supabase/stack": "workspace:*",
"@supabase/supabase-js": "^2.110.7",
"@tsconfig/bun": "catalog:",
"@types/bun": "catalog:",
"@types/pg": "^8.15.0",
Expand Down Expand Up @@ -119,6 +120,7 @@
"ignore": [
"scripts/*.ts",
"tests/**/*.ts",
"src/shared/feedback/database.types.ts",
"src/shared/telemetry/event-catalog.ts"
],
"ignoreBinaries": [
Expand Down
2 changes: 2 additions & 0 deletions apps/cli/src/legacy/cli/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { legacyConfigCommand } from "../commands/config/config.command.ts";
import { legacyDbCommand } from "../commands/db/db.command.ts";
import { legacyDomainsCommand } from "../commands/domains/domains.command.ts";
import { legacyEncryptionCommand } from "../commands/encryption/encryption.command.ts";
import { legacyFeedbackCommand } from "../commands/feedback/feedback.command.ts";
import { legacyFunctionsCommand } from "../commands/functions/functions.command.ts";
import { legacyGenCommand } from "../commands/gen/gen.command.ts";
import { legacyInitCommand } from "../commands/init/init.command.ts";
Expand Down Expand Up @@ -70,6 +71,7 @@ export const legacyRoot = Command.make("supabase").pipe(
legacyDbCommand,
legacyDomainsCommand,
legacyEncryptionCommand,
legacyFeedbackCommand,
legacyFunctionsCommand,
legacyGenCommand,
legacyInitCommand,
Expand Down
Loading
Loading