From 817a8f25bd25dbfa9117da7ed327688d562822a2 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 19 Nov 2026 11:24:30 -0700 Subject: [PATCH 1/2] chore(cli): carry sidebar category and title as a command annotation --- apps/cli/docs/README.md | 22 +-- apps/cli/package.json | 1 + apps/cli/scripts/generate-docs-sidebar.ts | 9 ++ apps/cli/scripts/publish-docs-spec.ts | 6 +- .../src/command-internal/command-sidebar.ts | 56 +++++++ .../src/commands/backups/backups.command.ts | 2 + .../src/commands/backups/list/list.command.ts | 2 + .../commands/bootstrap/bootstrap.command.ts | 2 + .../src/commands/branches/branches.command.ts | 2 + .../src/commands/branches/get/get.command.ts | 2 + .../commands/completion/bash/bash.command.ts | 2 + .../commands/completion/completion.command.ts | 2 + .../commands/completion/fish/fish.command.ts | 2 + .../powershell/powershell.command.ts | 2 + .../commands/completion/zsh/zsh.command.ts | 2 + .../cli/src/commands/config/config.command.ts | 2 + .../src/commands/config/pull/pull.command.ts | 2 + .../src/commands/config/push/push.command.ts | 2 + .../commands/db/advisors/advisors.command.ts | 2 + apps/cli/src/commands/db/db.command.ts | 2 + apps/cli/src/commands/db/diff/diff.command.ts | 2 + apps/cli/src/commands/db/dump/dump.command.ts | 2 + apps/cli/src/commands/db/lint/lint.command.ts | 2 + apps/cli/src/commands/db/pull/pull.command.ts | 2 + apps/cli/src/commands/db/push/push.command.ts | 2 + .../src/commands/db/reset/reset.command.ts | 2 + .../src/commands/db/start/start.command.ts | 2 + .../domains/activate/activate.command.ts | 2 + .../commands/domains/delete/delete.command.ts | 2 + .../src/commands/domains/domains.command.ts | 2 + .../src/commands/domains/get/get.command.ts | 2 + .../domains/reverify/reverify.command.ts | 2 + .../commands/encryption/encryption.command.ts | 2 + .../src/commands/feedback/add/add.command.ts | 2 + .../src/commands/feedback/feedback.command.ts | 2 + .../functions/delete/delete.command.ts | 2 + .../functions/deploy/deploy.command.ts | 2 + .../functions/download/download.command.ts | 2 + .../commands/functions/functions.command.ts | 2 + .../commands/functions/list/list.command.ts | 2 + .../src/commands/functions/new/new.command.ts | 2 + .../commands/functions/serve/serve.command.ts | 2 + apps/cli/src/commands/gen/gen.command.ts | 2 + .../src/commands/gen/types/types.command.ts | 2 + apps/cli/src/commands/init/init.command.ts | 2 + .../inspect/db/bloat/bloat.command.ts | 2 + .../inspect/db/blocking/blocking.command.ts | 2 + .../inspect/db/calls/calls.command.ts | 2 + .../inspect/db/db-stats/db-stats.command.ts | 2 + .../cli/src/commands/inspect/db/db.command.ts | 2 + .../db/index-stats/index-stats.command.ts | 2 + .../inspect/db/locks/locks.command.ts | 2 + .../long-running-queries.command.ts | 2 + .../inspect/db/outliers/outliers.command.ts | 2 + .../replication-slots.command.ts | 2 + .../db/role-stats/role-stats.command.ts | 2 + .../db/table-stats/table-stats.command.ts | 2 + .../traffic-profile.command.ts | 2 + .../db/vacuum-stats/vacuum-stats.command.ts | 2 + .../src/commands/inspect/inspect.command.ts | 2 + .../commands/inspect/report/report.command.ts | 2 + apps/cli/src/commands/issue/issue.command.ts | 2 + apps/cli/src/commands/link/link.command.ts | 2 + apps/cli/src/commands/login/login.command.ts | 2 + .../cli/src/commands/logout/logout.command.ts | 2 + apps/cli/src/commands/logs/logs.command.ts | 3 + .../commands/migration/down/down.command.ts | 2 + .../commands/migration/list/list.command.ts | 2 + .../commands/migration/migration.command.ts | 2 + .../src/commands/migration/new/new.command.ts | 2 + .../migration/repair/repair.command.ts | 2 + .../src/commands/migration/up/up.command.ts | 2 + .../commands/network-bans/get/get.command.ts | 2 + .../network-bans/network-bans.command.ts | 2 + .../network-restrictions/get/get.command.ts | 2 + .../network-restrictions.command.ts | 2 + .../commands/notebooks/notebooks.command.ts | 2 + apps/cli/src/commands/orgs/orgs.command.ts | 2 + .../postgres-config/delete/delete.command.ts | 2 + .../postgres-config/get/get.command.ts | 2 + .../postgres-config.command.ts | 2 + .../postgres-config/update/update.command.ts | 2 + .../projects/api-keys/api-keys.command.ts | 2 + .../src/commands/projects/projects.command.ts | 2 + apps/cli/src/commands/pull/pull.command.ts | 2 + .../src/commands/secrets/list/list.command.ts | 2 + .../src/commands/secrets/secrets.command.ts | 2 + .../src/commands/secrets/set/set.command.ts | 2 + .../commands/secrets/unset/unset.command.ts | 2 + .../commands/seed/buckets/buckets.command.ts | 2 + apps/cli/src/commands/seed/seed.command.ts | 2 + .../src/commands/services/services.command.ts | 2 + .../snippets/download/download.command.ts | 2 + .../src/commands/snippets/snippets.command.ts | 2 + .../ssl-enforcement/get/get.command.ts | 2 + .../ssl-enforcement.command.ts | 2 + .../ssl-enforcement/update/update.command.ts | 2 + apps/cli/src/commands/sso/add/add.command.ts | 2 + .../cli/src/commands/sso/info/info.command.ts | 2 + .../cli/src/commands/sso/list/list.command.ts | 2 + .../src/commands/sso/remove/remove.command.ts | 2 + .../cli/src/commands/sso/show/show.command.ts | 2 + apps/cli/src/commands/sso/sso.command.ts | 2 + .../src/commands/sso/update/update.command.ts | 2 + apps/cli/src/commands/start/start.command.ts | 2 + .../cli/src/commands/status/status.command.ts | 2 + apps/cli/src/commands/stop/stop.command.ts | 2 + .../cli/src/commands/storage/cp/cp.command.ts | 2 + .../cli/src/commands/storage/ls/ls.command.ts | 2 + .../cli/src/commands/storage/mv/mv.command.ts | 2 + .../cli/src/commands/storage/rm/rm.command.ts | 2 + .../src/commands/storage/storage.command.ts | 2 + .../commands/telemetry/telemetry.command.ts | 2 + apps/cli/src/commands/test/db/db.command.ts | 2 + apps/cli/src/commands/test/new/new.command.ts | 2 + apps/cli/src/commands/test/test.command.ts | 2 + .../cli/src/commands/unlink/unlink.command.ts | 2 + .../delete/delete.command.ts | 2 + .../vanity-subdomains/get/get.command.ts | 2 + .../vanity-subdomains.command.ts | 2 + .../cli/src/commands/whoami/whoami.command.ts | 2 + apps/cli/src/docs/docs-sidebar.ts | 109 +++++++++++++ apps/cli/src/docs/docs-sidebar.unit.test.ts | 144 ++++++++++++++++++ apps/cli/src/docs/docs-spec.tables.ts | 62 +------- apps/cli/src/docs/docs-spec.ts | 32 +--- apps/cli/src/docs/docs-spec.unit.test.ts | 18 +-- 126 files changed, 578 insertions(+), 114 deletions(-) create mode 100644 apps/cli/scripts/generate-docs-sidebar.ts create mode 100644 apps/cli/src/command-internal/command-sidebar.ts create mode 100644 apps/cli/src/docs/docs-sidebar.ts create mode 100644 apps/cli/src/docs/docs-sidebar.unit.test.ts diff --git a/apps/cli/docs/README.md b/apps/cli/docs/README.md index 39f6e07f98..aa69330b49 100644 --- a/apps/cli/docs/README.md +++ b/apps/cli/docs/README.md @@ -63,9 +63,10 @@ directory must already exist. Local mode does not clone, commit, push, or open a credentials. Add `--dry-run` to validate the input and print the destination without writing. This preview writes only the command-reference spec, not sidebar entries or JSON Schemas. -New commands still need an entry in the website's -[common-cli-sections.json](https://github.com/supabase/supabase/blob/master/apps/docs/spec/common-cli-sections.json) -to appear in the reference. +From `apps/cli`, `pnpm docs:spec ` generates the command-reference spec and +`pnpm docs:sidebar` generates the content for the website's +[common-cli-sections.json](https://github.com/supabase/supabase/blob/master/apps/docs/spec/common-cli-sections.json). +Copy the generated sidebar into that file so new commands appear in the reference. ## Release Publishing @@ -116,10 +117,11 @@ bun scripts/publish-schemas.ts --version [--dry-run] ## Maintenance -When adding or changing a command or flag, update the matching entries in -`src/docs/docs-spec.tables.ts` — each table's doc comment says -when it applies: `TAGS`, `DEFAULT_OVERRIDES`, `REQUIRED`, `EXPERIMENTAL` (and -`_OPTIONAL`), `EXCLUDED` (whole commands), `EXCLUDED_FLAGS`, `ARG_OVERRIDES`, -`CHOICE_OVERRIDES`, `EXTRA_FLAGS`. The spec build fails on entries that no -longer resolve against the command tree, but new commands and flags must be -added by hand — nothing detects a missing entry for a new surface. +When adding or changing a command or flag, update the applicable argument overrides and extra +flags in `src/docs/docs-spec.tables.ts`; each table's doc comment says when it applies. +The spec build fails on entries that no longer resolve against the command tree, but it cannot +detect missing overrides for a new surface. +Each new top-level command needs `withSidebar({ category })`, using a category from +`DOCS_SIDEBAR_CATEGORIES` in `src/command-internal/command-sidebar.ts`. +Run `pnpm docs:sidebar` to regenerate the sidebar; the build rejects missing categories, +categories declared on subcommands, unused categories and titles longer than 50 characters. diff --git a/apps/cli/package.json b/apps/cli/package.json index 3eebcc588a..4460882edc 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -28,6 +28,7 @@ "build:binary": "bun scripts/build-binary.ts", "build:shim": "bun build src/shared/cli/bin.ts --outfile dist/supabase.js --target node", "docs:spec": "bun scripts/generate-docs-spec.ts", + "docs:sidebar": "bun scripts/generate-docs-sidebar.ts", "schemas:generate": "bun scripts/generate-schemas.ts", "dev": "bun src/main.ts", "gen:feedback-types": "pnpm dev -- gen types typescript --project-id xguihxuzqibwxjnimxev --schema public > src/shared/feedback/database.types.ts", diff --git a/apps/cli/scripts/generate-docs-sidebar.ts b/apps/cli/scripts/generate-docs-sidebar.ts new file mode 100644 index 0000000000..dd511d638d --- /dev/null +++ b/apps/cli/scripts/generate-docs-sidebar.ts @@ -0,0 +1,9 @@ +/** + * Emits the docs-site CLI sidebar (`common-cli-sections.json`) from the Effect command tree. Run as + * `bun scripts/generate-docs-sidebar.ts > common-cli-sections.json`. + */ +import process from "node:process"; +import { rootCommand } from "../src/cli/root.ts"; +import { buildDocsSidebar, stringifyDocsSidebar } from "../src/docs/docs-sidebar.ts"; + +process.stdout.write(stringifyDocsSidebar(buildDocsSidebar(rootCommand))); diff --git a/apps/cli/scripts/publish-docs-spec.ts b/apps/cli/scripts/publish-docs-spec.ts index 3cf256e215..b52ff34647 100644 --- a/apps/cli/scripts/publish-docs-spec.ts +++ b/apps/cli/scripts/publish-docs-spec.ts @@ -131,9 +131,9 @@ const main = Effect.gen(function* () { "command tree or the content under `apps/cli/docs/` there rather than this", "file.", "", - "New commands also need an entry in `apps/docs/spec/common-cli-sections.json` —", - "without one a command's page is silently dropped from the docs site.", - "Sections fixes can be committed directly onto this branch — later releases", + "Generate `apps/docs/spec/common-cli-sections.json` content with `pnpm docs:sidebar`", + "from `apps/cli` in supabase/cli and copy it here; missing entries silently drop pages.", + "Sidebar fixes can be committed directly onto this branch; later releases", "add commits on top instead of rewriting it.", ].join("\n"), autoMerge: false, diff --git a/apps/cli/src/command-internal/command-sidebar.ts b/apps/cli/src/command-internal/command-sidebar.ts new file mode 100644 index 0000000000..27c19dc516 --- /dev/null +++ b/apps/cli/src/command-internal/command-sidebar.ts @@ -0,0 +1,56 @@ +import { Context, Option } from "effect"; +import { Command } from "effect/cli"; +/** Sidebar sections in display order; top-level commands pick one with `withSidebar`. */ +export const DOCS_SIDEBAR_CATEGORIES = [ + { id: "general", title: "General" }, + { id: "testing", title: "Testing" }, + { id: "generate-types", title: "Generate Types" }, + { id: "database", title: "Database" }, + { id: "migrations", title: "Migrations" }, + { id: "seed", title: "Seed" }, + { id: "inspect", title: "Inspect" }, + { id: "logs", title: "Logs" }, + { id: "organizations", title: "Organizations" }, + { id: "projects", title: "Projects" }, + { id: "config", title: "Config" }, + { id: "branches", title: "Branches" }, + { id: "backups", title: "Backups" }, + { id: "edge-functions", title: "Edge Functions" }, + { id: "secrets", title: "Secrets" }, + { id: "storage", title: "Storage" }, + { id: "authentication", title: "Authentication" }, + { id: "custom-domains", title: "Custom Domains" }, + { id: "vanity-subdomains", title: "Vanity Subdomains" }, + { id: "encryption", title: "Encryption" }, + { id: "network-bans", title: "Network Bans" }, + { id: "network-restrictions", title: "Network Restrictions" }, + { id: "ssl-enforcement", title: "SSL Enforcement" }, + { id: "postgres-config", title: "Postgres Config" }, + { id: "sql-snippets", title: "SQL Snippets" }, + { id: "notebooks", title: "Notebooks" }, + { id: "services", title: "Services" }, + { id: "autocompletion-scripts", title: "Autocompletion Scripts" }, + { id: "telemetry", title: "Telemetry" }, + { id: "feedback", title: "Feedback" }, +] as const; + +export type DocsSidebarCategory = (typeof DOCS_SIDEBAR_CATEGORIES)[number]["id"]; + +/** + * Docs-site sidebar placement. Top-level commands declare a category, which their subcommands + * inherit; any command may override its sidebar title, which defaults to its short description. + */ +export type CommandSidebar = + | { readonly category: DocsSidebarCategory; readonly title?: string } + | { readonly title: string }; + +export class CommandSidebarAnnotation extends Context.Service< + CommandSidebarAnnotation, + CommandSidebar +>()("supabase/CommandSidebarAnnotation") {} + +export const withSidebar = (sidebar: CommandSidebar) => + Command.annotate(CommandSidebarAnnotation, sidebar); + +export const readSidebar = (command: Command.Command.Any): Option.Option => + Context.getOption(command.annotations, CommandSidebarAnnotation); diff --git a/apps/cli/src/commands/backups/backups.command.ts b/apps/cli/src/commands/backups/backups.command.ts index c28a2d7724..0aae7c869a 100644 --- a/apps/cli/src/commands/backups/backups.command.ts +++ b/apps/cli/src/commands/backups/backups.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { backupsListCommand } from "./list/list.command.ts"; import { backupsRestoreCommand } from "./restore/restore.command.ts"; export const backupsCommand = Command.make("backups").pipe( + withSidebar({ category: "backups", title: "Manage physical backups" }), Command.withDescription("Manage Supabase physical backups."), Command.withShortDescription("Manage Supabase physical backups"), Command.withSubcommands([backupsListCommand, backupsRestoreCommand]), diff --git a/apps/cli/src/commands/backups/list/list.command.ts b/apps/cli/src/commands/backups/list/list.command.ts index 02262f2b0c..ab3ef6ea0b 100644 --- a/apps/cli/src/commands/backups/list/list.command.ts +++ b/apps/cli/src/commands/backups/list/list.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import type * as CliCommand from "effect/cli/Command"; import { Command } from "effect/cli"; @@ -20,6 +21,7 @@ const config = { export type BackupsListFlags = CliCommand.Command.Config.Infer; export const backupsListCommand = Command.make("list", config).pipe( + withSidebar({ title: "List available physical backups" }), Command.withDescription("Lists available physical backups"), Command.withShortDescription("Lists available physical backups"), Command.withExamples([ diff --git a/apps/cli/src/commands/bootstrap/bootstrap.command.ts b/apps/cli/src/commands/bootstrap/bootstrap.command.ts index 11f75d8a45..08084b6ae4 100644 --- a/apps/cli/src/commands/bootstrap/bootstrap.command.ts +++ b/apps/cli/src/commands/bootstrap/bootstrap.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Argument, Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -33,6 +34,7 @@ const config = { export type BootstrapFlags = CliCommand.Command.Config.Infer; export const bootstrapCommand = Command.make("bootstrap", config).pipe( + withSidebar({ category: "general", title: "Launch a quick start template" }), Command.withDescription("Bootstrap a Supabase project from a starter template."), Command.withShortDescription("Bootstrap a Supabase project from a starter template"), withPermissions( diff --git a/apps/cli/src/commands/branches/branches.command.ts b/apps/cli/src/commands/branches/branches.command.ts index 6991f95d9d..91a82141f9 100644 --- a/apps/cli/src/commands/branches/branches.command.ts +++ b/apps/cli/src/commands/branches/branches.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { branchesListCommand } from "./list/list.command.ts"; import { branchesCreateCommand } from "./create/create.command.ts"; @@ -9,6 +10,7 @@ import { branchesDeleteCommand } from "./delete/delete.command.ts"; import { branchesDisableCommand } from "./disable/disable.command.ts"; export const branchesCommand = Command.make("branches").pipe( + withSidebar({ category: "branches" }), Command.withDescription("Manage Supabase preview branches."), Command.withShortDescription("Manage preview branches"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/branches/get/get.command.ts b/apps/cli/src/commands/branches/get/get.command.ts index ce4d250329..ca8fe7fe2f 100644 --- a/apps/cli/src/commands/branches/get/get.command.ts +++ b/apps/cli/src/commands/branches/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -57,6 +58,7 @@ const config = { export type BranchesGetFlags = CliCommand.Command.Config.Infer; export const branchesGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Show connection details for a preview branch" }), Command.withDescription( "Retrieve details of the specified preview branch.\n\nNote: For the main branch, password-dependent fields (POSTGRES_URL, POSTGRES_URL_NON_POOLING) are not populated because production database credentials are not retrievable via API.", ), diff --git a/apps/cli/src/commands/completion/bash/bash.command.ts b/apps/cli/src/commands/completion/bash/bash.command.ts index b29d317cab..2d48dcc667 100644 --- a/apps/cli/src/commands/completion/bash/bash.command.ts +++ b/apps/cli/src/commands/completion/bash/bash.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; @@ -14,6 +15,7 @@ const config = { export type CompletionBashFlags = CliCommand.Command.Config.Infer; export const completionBashCommand = Command.make("bash", config).pipe( + withSidebar({ title: "Generate bash script" }), Command.withDescription( "Generate the autocompletion script for the bash shell.\n\n" + "This script depends on the 'bash-completion' package.\n" + diff --git a/apps/cli/src/commands/completion/completion.command.ts b/apps/cli/src/commands/completion/completion.command.ts index 6f466dbe46..4731fb72c2 100644 --- a/apps/cli/src/commands/completion/completion.command.ts +++ b/apps/cli/src/commands/completion/completion.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { completionBashCommand } from "./bash/bash.command.ts"; import { completionFishCommand } from "./fish/fish.command.ts"; @@ -5,6 +6,7 @@ import { completionPowershellCommand } from "./powershell/powershell.command.ts" import { completionZshCommand } from "./zsh/zsh.command.ts"; export const completionCommand = Command.make("completion").pipe( + withSidebar({ category: "autocompletion-scripts", title: "Generate autocompletion scripts" }), Command.withDescription( "Generate the autocompletion script for supabase for the specified shell.\n" + "See each sub-command's help for details on how to use the generated script.", diff --git a/apps/cli/src/commands/completion/fish/fish.command.ts b/apps/cli/src/commands/completion/fish/fish.command.ts index f39b838510..f48e8babec 100644 --- a/apps/cli/src/commands/completion/fish/fish.command.ts +++ b/apps/cli/src/commands/completion/fish/fish.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; @@ -14,6 +15,7 @@ const config = { export type CompletionFishFlags = CliCommand.Command.Config.Infer; export const completionFishCommand = Command.make("fish", config).pipe( + withSidebar({ title: "Generate fish script" }), Command.withDescription( "Generate the autocompletion script for the fish shell.\n\n" + "To load completions in your current shell session:\n\n" + diff --git a/apps/cli/src/commands/completion/powershell/powershell.command.ts b/apps/cli/src/commands/completion/powershell/powershell.command.ts index 2603cd44ae..6cc7c6b48d 100644 --- a/apps/cli/src/commands/completion/powershell/powershell.command.ts +++ b/apps/cli/src/commands/completion/powershell/powershell.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; @@ -14,6 +15,7 @@ const config = { export type CompletionPowershellFlags = CliCommand.Command.Config.Infer; export const completionPowershellCommand = Command.make("powershell", config).pipe( + withSidebar({ title: "Generate powershell script" }), Command.withDescription( "Generate the autocompletion script for powershell.\n\n" + "To load completions in your current shell session:\n\n" + diff --git a/apps/cli/src/commands/completion/zsh/zsh.command.ts b/apps/cli/src/commands/completion/zsh/zsh.command.ts index 1e76a6bf1d..3eb89121f5 100644 --- a/apps/cli/src/commands/completion/zsh/zsh.command.ts +++ b/apps/cli/src/commands/completion/zsh/zsh.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; @@ -14,6 +15,7 @@ const config = { export type CompletionZshFlags = CliCommand.Command.Config.Infer; export const completionZshCommand = Command.make("zsh", config).pipe( + withSidebar({ title: "Generate zsh script" }), Command.withDescription( "Generate the autocompletion script for the zsh shell.\n\n" + "If shell completion is not already enabled in your environment you will need\n" + diff --git a/apps/cli/src/commands/config/config.command.ts b/apps/cli/src/commands/config/config.command.ts index 62ef529eff..10a1883733 100644 --- a/apps/cli/src/commands/config/config.command.ts +++ b/apps/cli/src/commands/config/config.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { configConvertCommand } from "./convert/convert.command.ts"; import { configDiffCommand } from "./diff/diff.command.ts"; @@ -6,6 +7,7 @@ import { configPushCommand } from "./push/push.command.ts"; import { configValidateCommand } from "./validate/validate.command.ts"; export const configCommand = Command.make("config").pipe( + withSidebar({ category: "config" }), Command.withDescription("Manage Supabase project configurations."), Command.withShortDescription("Manage project configurations"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/config/pull/pull.command.ts b/apps/cli/src/commands/config/pull/pull.command.ts index 94c1e66d50..598fbca3ac 100644 --- a/apps/cli/src/commands/config/pull/pull.command.ts +++ b/apps/cli/src/commands/config/pull/pull.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import type * as CliCommand from "effect/cli/Command"; import { Command, Flag } from "effect/cli"; @@ -53,6 +54,7 @@ const configPullHandler = (flags: ConfigPullFlags) => ); export const configPullCommand = Command.make("pull", config).pipe( + withSidebar({ title: "Pull remote config into supabase/config.toml" }), Command.withDescription( "Writes configuration from a remote project or branch into the project config file. Prompts for confirmation before writing on an interactive TTY, unless --yes is set; --output-format json|stream-json skips the prompt entirely and takes its default answer, while a non-interactive text run still prints the prompt to stderr and reads one line from piped stdin (y/yes/n/no honored, empty takes the default, anything else declines) — use --dry-run to preview first.", ), diff --git a/apps/cli/src/commands/config/push/push.command.ts b/apps/cli/src/commands/config/push/push.command.ts index 2bfb1fe306..7545994299 100644 --- a/apps/cli/src/commands/config/push/push.command.ts +++ b/apps/cli/src/commands/config/push/push.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withCliConfigFlags } from "../../../config/cli-config-flags.ts"; @@ -32,6 +33,7 @@ const configPushHandler = (flags: ConfigPushFlags) => ); export const configPushCommand = Command.make("push", config).pipe( + withSidebar({ title: "Push config from a local file" }), Command.withDescription( "Pushes the properties your local config file declares to the linked project or one of its branches. Properties the file does not declare are left unchanged; run `supabase config diff` to preview. Shows the exact diff for every changed resource, then asks once before anything is written (the default answer is no). Piped answers are not read: non-interactive and JSON runs need --yes or a SUPABASE_YES set in the shell. Run `supabase config diff` first to review the changes.", ), diff --git a/apps/cli/src/commands/db/advisors/advisors.command.ts b/apps/cli/src/commands/db/advisors/advisors.command.ts index 4a06ea0bf3..fbab2ae759 100644 --- a/apps/cli/src/commands/db/advisors/advisors.command.ts +++ b/apps/cli/src/commands/db/advisors/advisors.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -41,6 +42,7 @@ const config = { export type DbAdvisorsFlags = CliCommand.Command.Config.Infer; export const dbAdvisorsCommand = Command.make("advisors", config).pipe( + withSidebar({ title: "Check database for security and performance issues" }), Command.withDescription("Checks database for security and performance issues."), Command.withShortDescription("Checks database for security and performance issues"), Command.withHandler((flags) => diff --git a/apps/cli/src/commands/db/db.command.ts b/apps/cli/src/commands/db/db.command.ts index 57180f492a..86d15f094e 100644 --- a/apps/cli/src/commands/db/db.command.ts +++ b/apps/cli/src/commands/db/db.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { dbDiffCommand } from "./diff/diff.command.ts"; import { dbDumpCommand } from "./dump/dump.command.ts"; @@ -14,6 +15,7 @@ import { dbRemoteCommand } from "./remote/remote.command.ts"; import { dbSchemaCommand } from "./schema/schema.command.ts"; export const dbCommand = Command.make("db").pipe( + withSidebar({ category: "database", title: "Manage local databases" }), Command.withDescription("Manage Postgres databases."), Command.withShortDescription("Manage databases"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/db/diff/diff.command.ts b/apps/cli/src/commands/db/diff/diff.command.ts index 61f11e2155..a499eb85ff 100644 --- a/apps/cli/src/commands/db/diff/diff.command.ts +++ b/apps/cli/src/commands/db/diff/diff.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -116,6 +117,7 @@ const explicitBranchSide = (flag: "from" | "to") => }) as const; export const dbDiffCommand = Command.make("diff", config).pipe( + withSidebar({ title: "Diff local database" }), Command.withDescription( "Compares a shadow built from supabase/migrations with a live database (the local database by default, or the one --remote selects). Declarative files under supabase/schemas are not part of this baseline. Output is printed by default; in normal mode, -f names and saves the complete diff as a migration and does not filter objects. Explicit --from/--to output is flattened review SQL, not a portable apply script.", ), diff --git a/apps/cli/src/commands/db/dump/dump.command.ts b/apps/cli/src/commands/db/dump/dump.command.ts index 7c01983507..39263955a5 100644 --- a/apps/cli/src/commands/db/dump/dump.command.ts +++ b/apps/cli/src/commands/db/dump/dump.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -97,6 +98,7 @@ const config = { export type DbDumpFlags = CliCommand.Command.Config.Infer; export const dbDumpCommand = Command.make("dump", config).pipe( + withSidebar({ title: "Dump schema from remote database" }), Command.withDescription("Dumps data or schemas from a database."), Command.withShortDescription("Dumps data or schemas from a database"), Command.withExamples([ diff --git a/apps/cli/src/commands/db/lint/lint.command.ts b/apps/cli/src/commands/db/lint/lint.command.ts index f0459f590a..25f21d7b48 100644 --- a/apps/cli/src/commands/db/lint/lint.command.ts +++ b/apps/cli/src/commands/db/lint/lint.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -43,6 +44,7 @@ const config = { export type DbLintFlags = CliCommand.Command.Config.Infer; export const dbLintCommand = Command.make("lint", config).pipe( + withSidebar({ title: "Lint local database" }), Command.withDescription("Checks a database for typing error."), Command.withShortDescription("Checks a database for typing error"), Command.withExamples([ diff --git a/apps/cli/src/commands/db/pull/pull.command.ts b/apps/cli/src/commands/db/pull/pull.command.ts index 2c8db65246..bea069c916 100644 --- a/apps/cli/src/commands/db/pull/pull.command.ts +++ b/apps/cli/src/commands/db/pull/pull.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Effect, Layer, Option } from "effect"; import { Argument, Command, Flag } from "effect/cli"; @@ -99,6 +100,7 @@ const telemetryOptions = (flags: DbPullFlags) => ({ }); export const dbPullCommand = Command.make("pull", config).pipe( + withSidebar({ title: "Pull schema changes from remote database" }), Command.withDescription( "Migration mode compares supabase/migrations with the selected live database (the local database by default, or the one --remote selects), writes the complete difference as migration files, and records them in that database's migration history; a hosted database asks for confirmation first, or needs --yes in a non-interactive run. --declarative instead replaces the declarative schema tree and does not create migrations or update migration history.", ), diff --git a/apps/cli/src/commands/db/push/push.command.ts b/apps/cli/src/commands/db/push/push.command.ts index bebf2658d5..02bf53349b 100644 --- a/apps/cli/src/commands/db/push/push.command.ts +++ b/apps/cli/src/commands/db/push/push.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -52,6 +53,7 @@ const config = { export type DbPushFlags = CliCommand.Command.Config.Infer; export const dbPushCommand = Command.make("push", config).pipe( + withSidebar({ title: "Push migration to remote database" }), Command.withDescription( "Push new migrations to a database. Vault secrets from the config file are updated before migrations unless --skip-vault is set.", ), diff --git a/apps/cli/src/commands/db/reset/reset.command.ts b/apps/cli/src/commands/db/reset/reset.command.ts index 9a6fe784d0..beaf5a877c 100644 --- a/apps/cli/src/commands/db/reset/reset.command.ts +++ b/apps/cli/src/commands/db/reset/reset.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -43,6 +44,7 @@ const config = { export type DbResetFlags = CliCommand.Command.Config.Infer; export const dbResetCommand = Command.make("reset", config).pipe( + withSidebar({ title: "Reset local database" }), Command.withDescription("Resets a database to current migrations."), Command.withShortDescription("Resets a database to current migrations"), Command.withExamples([ diff --git a/apps/cli/src/commands/db/start/start.command.ts b/apps/cli/src/commands/db/start/start.command.ts index 9e4201c7dd..7fe95dd717 100644 --- a/apps/cli/src/commands/db/start/start.command.ts +++ b/apps/cli/src/commands/db/start/start.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -24,6 +25,7 @@ const config = { export type DbStartFlags = CliCommand.Command.Config.Infer; export const dbStartCommand = Command.make("start", config).pipe( + withSidebar({ title: "Start only the local database" }), Command.withDescription("Starts local Postgres database."), Command.withShortDescription("Starts local Postgres database"), Command.withHandler((flags) => diff --git a/apps/cli/src/commands/domains/activate/activate.command.ts b/apps/cli/src/commands/domains/activate/activate.command.ts index 6fcd145010..99fb4d9557 100644 --- a/apps/cli/src/commands/domains/activate/activate.command.ts +++ b/apps/cli/src/commands/domains/activate/activate.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Option } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -32,6 +33,7 @@ const managementApiLayer = managementApiRuntimeLayer(COMMAND_PATH); export type DomainsActivateFlags = CliCommand.Command.Config.Infer; export const domainsActivateCommand = Command.make("activate", config).pipe( + withSidebar({ title: "Activate custom hostname" }), Command.withDescription( "Activates the custom hostname configuration for a project. This reconfigures your Supabase project to respond to requests on your custom hostname. After the custom hostname is activated, your project's auth services will no longer function on the Supabase-provisioned subdomain.", ), diff --git a/apps/cli/src/commands/domains/delete/delete.command.ts b/apps/cli/src/commands/domains/delete/delete.command.ts index 203797de95..52ca2ada48 100644 --- a/apps/cli/src/commands/domains/delete/delete.command.ts +++ b/apps/cli/src/commands/domains/delete/delete.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Option } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -32,6 +33,7 @@ const managementApiLayer = managementApiRuntimeLayer(COMMAND_PATH); export type DomainsDeleteFlags = CliCommand.Command.Config.Infer; export const domainsDeleteCommand = Command.make("delete", config).pipe( + withSidebar({ title: "Delete custom hostname config" }), Command.withDescription("Deletes the custom hostname config for your project."), Command.withShortDescription("Delete the custom hostname config"), Command.withExamples([ diff --git a/apps/cli/src/commands/domains/domains.command.ts b/apps/cli/src/commands/domains/domains.command.ts index 5e67898123..1444f5e6af 100644 --- a/apps/cli/src/commands/domains/domains.command.ts +++ b/apps/cli/src/commands/domains/domains.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { domainsActivateCommand } from "./activate/activate.command.ts"; import { domainsCreateCommand } from "./create/create.command.ts"; @@ -6,6 +7,7 @@ import { domainsGetCommand } from "./get/get.command.ts"; import { domainsReverifyCommand } from "./reverify/reverify.command.ts"; export const domainsCommand = Command.make("domains").pipe( + withSidebar({ category: "custom-domains", title: "Manage custom domains" }), Command.withDescription( "Manage custom domain names for Supabase projects. Use of custom domains and vanity subdomains is mutually exclusive.", ), diff --git a/apps/cli/src/commands/domains/get/get.command.ts b/apps/cli/src/commands/domains/get/get.command.ts index 26a1f623b7..7043113a73 100644 --- a/apps/cli/src/commands/domains/get/get.command.ts +++ b/apps/cli/src/commands/domains/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Option } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -32,6 +33,7 @@ const managementApiLayer = managementApiRuntimeLayer(COMMAND_PATH); export type DomainsGetFlags = CliCommand.Command.Config.Infer; export const domainsGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Retrieve custom hostname config" }), Command.withDescription( "Retrieve the custom hostname config for your project, as stored in the Supabase platform.", ), diff --git a/apps/cli/src/commands/domains/reverify/reverify.command.ts b/apps/cli/src/commands/domains/reverify/reverify.command.ts index 09b8f152cf..b52d4904b1 100644 --- a/apps/cli/src/commands/domains/reverify/reverify.command.ts +++ b/apps/cli/src/commands/domains/reverify/reverify.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Option } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -32,6 +33,7 @@ const managementApiLayer = managementApiRuntimeLayer(COMMAND_PATH); export type DomainsReverifyFlags = CliCommand.Command.Config.Infer; export const domainsReverifyCommand = Command.make("reverify", config).pipe( + withSidebar({ title: "Re-verify custom hostname config" }), Command.withDescription("Re-verify the custom hostname config for your project."), Command.withShortDescription("Re-verify the custom hostname config"), Command.withExamples([ diff --git a/apps/cli/src/commands/encryption/encryption.command.ts b/apps/cli/src/commands/encryption/encryption.command.ts index 200157a294..e70d62d6dd 100644 --- a/apps/cli/src/commands/encryption/encryption.command.ts +++ b/apps/cli/src/commands/encryption/encryption.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { encryptionGetRootKeyCommand } from "./get-root-key/get-root-key.command.ts"; import { encryptionUpdateRootKeyCommand } from "./update-root-key/update-root-key.command.ts"; export const encryptionCommand = Command.make("encryption").pipe( + withSidebar({ category: "encryption" }), Command.withDescription("Manage encryption keys of Supabase projects"), Command.withShortDescription("Manage encryption keys"), Command.withSubcommands([encryptionGetRootKeyCommand, encryptionUpdateRootKeyCommand]), diff --git a/apps/cli/src/commands/feedback/add/add.command.ts b/apps/cli/src/commands/feedback/add/add.command.ts index e02e392260..aeb7a15c9a 100644 --- a/apps/cli/src/commands/feedback/add/add.command.ts +++ b/apps/cli/src/commands/feedback/add/add.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts"; @@ -42,6 +43,7 @@ export const feedbackAddHandler = (args: FeedbackAddArgs) => ); export const feedbackAddCommand = Command.make("add", config).pipe( + withSidebar({ title: "Send feedback" }), Command.withDescription("Send quick feedback about the Supabase CLI to the Supabase team."), Command.withShortDescription("Send feedback to the Supabase team"), Command.withExamples([ diff --git a/apps/cli/src/commands/feedback/feedback.command.ts b/apps/cli/src/commands/feedback/feedback.command.ts index 88c881cecf..597713797d 100644 --- a/apps/cli/src/commands/feedback/feedback.command.ts +++ b/apps/cli/src/commands/feedback/feedback.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { feedbackAddCommand } from "./add/add.command.ts"; import { feedbackDeleteCommand } from "./delete/delete.command.ts"; export const feedbackCommand = Command.make("feedback").pipe( + withSidebar({ category: "feedback" }), Command.withDescription("Send feedback about the Supabase CLI to the Supabase team."), Command.withShortDescription("Send feedback to the Supabase team"), Command.withSubcommands([feedbackAddCommand, feedbackDeleteCommand]), diff --git a/apps/cli/src/commands/functions/delete/delete.command.ts b/apps/cli/src/commands/functions/delete/delete.command.ts index a7cec3e18a..f08071ac3a 100644 --- a/apps/cli/src/commands/functions/delete/delete.command.ts +++ b/apps/cli/src/commands/functions/delete/delete.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withPermissions } from "../../../command-internal/command-permissions/command-permissions.annotation.ts"; @@ -30,6 +31,7 @@ const functionsDeleteHandler = (flags: FunctionsDeleteFlags) => ); export const functionsDeleteCommand = Command.make("delete", config).pipe( + withSidebar({ title: "Delete a function" }), Command.withDescription( "Delete a Function from the linked Supabase project. This does NOT remove the Function locally.", ), diff --git a/apps/cli/src/commands/functions/deploy/deploy.command.ts b/apps/cli/src/commands/functions/deploy/deploy.command.ts index b6db8bed5b..6be675fb93 100644 --- a/apps/cli/src/commands/functions/deploy/deploy.command.ts +++ b/apps/cli/src/commands/functions/deploy/deploy.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -67,6 +68,7 @@ const dockerPath = [ ] as const; export const functionsDeployCommand = Command.make("deploy", config).pipe( + withSidebar({ title: "Deploy a function" }), Command.withDescription("Deploy a Function to the linked Supabase project."), Command.withShortDescription("Deploy a Function to Supabase"), Command.withExamples([ diff --git a/apps/cli/src/commands/functions/download/download.command.ts b/apps/cli/src/commands/functions/download/download.command.ts index 694ec359c1..d92fa27320 100644 --- a/apps/cli/src/commands/functions/download/download.command.ts +++ b/apps/cli/src/commands/functions/download/download.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Layer, Option } from "effect"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -63,6 +64,7 @@ const functionsDownloadLegacyBundleHandler = (flags: FunctionsDownloadFlags) => }; export const functionsDownloadCommand = Command.make("download", config).pipe( + withSidebar({ title: "Download a function" }), Command.withDescription( "Download the source code for a Function from the linked Supabase project. If no function name is provided, downloads all functions.", ), diff --git a/apps/cli/src/commands/functions/functions.command.ts b/apps/cli/src/commands/functions/functions.command.ts index 21669d7980..e47d988c2e 100644 --- a/apps/cli/src/commands/functions/functions.command.ts +++ b/apps/cli/src/commands/functions/functions.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { functionsListCommand } from "./list/list.command.ts"; import { functionsDeleteCommand } from "./delete/delete.command.ts"; @@ -7,6 +8,7 @@ import { functionsNewCommand } from "./new/new.command.ts"; import { functionsServeCommand } from "./serve/serve.command.ts"; export const functionsCommand = Command.make("functions").pipe( + withSidebar({ category: "edge-functions", title: "Manage edge functions" }), Command.withDescription("Manage Supabase Edge functions."), Command.withShortDescription("Manage Supabase Edge functions"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/functions/list/list.command.ts b/apps/cli/src/commands/functions/list/list.command.ts index 05f744f644..3539740d6e 100644 --- a/apps/cli/src/commands/functions/list/list.command.ts +++ b/apps/cli/src/commands/functions/list/list.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withPermissions } from "../../../command-internal/command-permissions/command-permissions.annotation.ts"; @@ -19,6 +20,7 @@ const config = { export type FunctionsListFlags = CliCommand.Command.Config.Infer; export const functionsListCommand = Command.make("list", config).pipe( + withSidebar({ title: "List all functions" }), Command.withDescription("List all Functions in the linked Supabase project."), Command.withShortDescription("List all Functions in Supabase"), Command.withExamples([ diff --git a/apps/cli/src/commands/functions/new/new.command.ts b/apps/cli/src/commands/functions/new/new.command.ts index 09d40cedb3..010d66b83d 100644 --- a/apps/cli/src/commands/functions/new/new.command.ts +++ b/apps/cli/src/commands/functions/new/new.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -40,6 +41,7 @@ const functionsNewRuntimeLayer = Layer.mergeAll( ); export const functionsNewCommand = Command.make("new", config).pipe( + withSidebar({ title: "Create a function" }), Command.withDescription("Create a new Function locally."), Command.withShortDescription("Create a new Function locally"), withPermissions({ operations: [], noApiEffectFlags: ["auth"] }), diff --git a/apps/cli/src/commands/functions/serve/serve.command.ts b/apps/cli/src/commands/functions/serve/serve.command.ts index 25c70bb545..3c75eb9377 100644 --- a/apps/cli/src/commands/functions/serve/serve.command.ts +++ b/apps/cli/src/commands/functions/serve/serve.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { httpClientLayer } from "../../../auth/http-debug.layer.ts"; import { Argument, Command, Flag } from "effect/cli"; @@ -74,6 +75,7 @@ const commandConfig = { } as const; export const functionsServeCommand = Command.make("serve", commandConfig).pipe( + withSidebar({ title: "Serve functions locally" }), Command.withDescription("Serve all Functions locally."), Command.withShortDescription("Serve all Functions locally"), Command.withHandler((flags) => diff --git a/apps/cli/src/commands/gen/gen.command.ts b/apps/cli/src/commands/gen/gen.command.ts index b80e140c94..6f4313cf66 100644 --- a/apps/cli/src/commands/gen/gen.command.ts +++ b/apps/cli/src/commands/gen/gen.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { genTypesCommand } from "./types/types.command.ts"; import { genSigningKeyCommand } from "./signing-key/signing-key.command.ts"; @@ -5,6 +6,7 @@ import { genBearerJwtCommand } from "./bearer-jwt/bearer-jwt.command.ts"; import { genKeysCommand } from "./keys/keys.command.ts"; export const genCommand = Command.make("gen").pipe( + withSidebar({ category: "generate-types" }), Command.withDescription("Run code generation tools."), Command.withShortDescription("Run code generation tools"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/gen/types/types.command.ts b/apps/cli/src/commands/gen/types/types.command.ts index f11d5dd95f..407443cadc 100644 --- a/apps/cli/src/commands/gen/types/types.command.ts +++ b/apps/cli/src/commands/gen/types/types.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command, Flag, Param } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withPermissions } from "../../../command-internal/command-permissions/command-permissions.annotation.ts"; @@ -122,6 +123,7 @@ const genTypesHandler = (flags: CliCommand.Command.Config.Infer; export const initCommand = Command.make("init", config).pipe( + withSidebar({ category: "general" }), Command.withDescription("Initialize a local project."), Command.withShortDescription("Initialize a local project"), Command.withExamples([ diff --git a/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts b/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts index f866792975..7a04304782 100644 --- a/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts +++ b/apps/cli/src/commands/inspect/db/bloat/bloat.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbBloat } from "./bloat.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbBloatCommand = Command.make("bloat", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show estimated database bloat" }), Command.withDescription("Estimates space allocated to a relation that is full of dead tuples."), Command.withShortDescription("Show relation bloat"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts b/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts index 1baf62e901..26e87dadd9 100644 --- a/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts +++ b/apps/cli/src/commands/inspect/db/blocking/blocking.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbBlocking } from "./blocking.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbBlockingCommand = Command.make("blocking", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show queries waiting and holding locks" }), Command.withDescription( "Show queries that are holding locks and the queries that are waiting for them to be released.", ), diff --git a/apps/cli/src/commands/inspect/db/calls/calls.command.ts b/apps/cli/src/commands/inspect/db/calls/calls.command.ts index 546fd85673..24dccb4110 100644 --- a/apps/cli/src/commands/inspect/db/calls/calls.command.ts +++ b/apps/cli/src/commands/inspect/db/calls/calls.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbCalls } from "./calls.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbCallsCommand = Command.make("calls", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show most frequently run queries" }), Command.withDescription("Show queries from pg_stat_statements ordered by total times called."), Command.withShortDescription("Show queries by call count"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts b/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts index fc87ab2614..99669ab5bb 100644 --- a/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/db-stats/db-stats.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbDbStats } from "./db-stats.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbDbStatsCommand = Command.make("db-stats", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show statistics related to database usage" }), Command.withDescription("Show stats such as cache hit rates, total sizes, and WAL size."), Command.withShortDescription("Show database stats"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/db.command.ts b/apps/cli/src/commands/inspect/db/db.command.ts index 43e0171558..1fbc5c729a 100644 --- a/apps/cli/src/commands/inspect/db/db.command.ts +++ b/apps/cli/src/commands/inspect/db/db.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { inspectDbBloatCommand } from "./bloat/bloat.command.ts"; import { inspectDbBlockingCommand } from "./blocking/blocking.command.ts"; @@ -29,6 +30,7 @@ import { inspectDbVacuumStatsCommand } from "./vacuum-stats/vacuum-stats.command import { inspectDbXidAgeCommand } from "./xid-age/xid-age.command.ts"; export const inspectDbCommand = Command.make("db").pipe( + withSidebar({ title: "Inspect database statistics" }), Command.withDescription( "Tools to inspect your Supabase database. They inspect the local database by default; pass --remote for the linked project, or --remote= for another database.", ), diff --git a/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts b/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts index c81d0235e5..9e393d8d9d 100644 --- a/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/index-stats/index-stats.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbIndexStats } from "./index-stats.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbIndexStatsCommand = Command.make("index-stats", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show sizes of individual indexes" }), Command.withDescription( "Show combined index size, usage percent, scan counts, and unused status.", ), diff --git a/apps/cli/src/commands/inspect/db/locks/locks.command.ts b/apps/cli/src/commands/inspect/db/locks/locks.command.ts index 8237010bfa..34eecddb0d 100644 --- a/apps/cli/src/commands/inspect/db/locks/locks.command.ts +++ b/apps/cli/src/commands/inspect/db/locks/locks.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbLocks } from "./locks.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbLocksCommand = Command.make("locks", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show queries taking exclusive locks" }), Command.withDescription("Show queries which have taken out an exclusive lock on a relation."), Command.withShortDescription("Show exclusive locks"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts b/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts index 52a6a69682..48d535204c 100644 --- a/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts +++ b/apps/cli/src/commands/inspect/db/long-running-queries/long-running-queries.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbLongRunningQueries } from "./long-running-queries.handler.ts"; @@ -15,6 +16,7 @@ export const inspectDbLongRunningQueriesCommand = Command.make( "long-running-queries", INSPECT_DB_FLAGS, ).pipe( + withSidebar({ title: "Show long running queries" }), Command.withDescription("Show currently running queries running for longer than 5 minutes."), Command.withShortDescription("Show long-running queries"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts b/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts index e7ab222640..9096d36122 100644 --- a/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts +++ b/apps/cli/src/commands/inspect/db/outliers/outliers.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbOutliers } from "./outliers.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbOutliersCommand = Command.make("outliers", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show queries ordered by total execution time" }), Command.withDescription("Show queries from pg_stat_statements ordered by total execution time."), Command.withShortDescription("Show query outliers by time"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts b/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts index 5479f8cdcf..447dc514ab 100644 --- a/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts +++ b/apps/cli/src/commands/inspect/db/replication-slots/replication-slots.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbReplicationSlots } from "./replication-slots.handler.ts"; @@ -15,6 +16,7 @@ export const inspectDbReplicationSlotsCommand = Command.make( "replication-slots", INSPECT_DB_FLAGS, ).pipe( + withSidebar({ title: "Show information about replication slots" }), Command.withDescription("Show information about replication slots on the database."), Command.withShortDescription("Show replication slots"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts b/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts index c3b5e3dd7e..c7003348c2 100644 --- a/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/role-stats/role-stats.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbRoleStats } from "./role-stats.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbRoleStatsCommand = Command.make("role-stats", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show number of active connections" }), Command.withDescription("Show information about roles on the database."), Command.withShortDescription("Show role stats"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts b/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts index 33639f2f68..21d45aae28 100644 --- a/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/table-stats/table-stats.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbTableStats } from "./table-stats.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbTableStatsCommand = Command.make("table-stats", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show sizes of individual tables" }), Command.withDescription("Show combined table size, index size, and estimated row count."), Command.withShortDescription("Show table stats"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts b/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts index 7684ae71c5..e394245d42 100644 --- a/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts +++ b/apps/cli/src/commands/inspect/db/traffic-profile/traffic-profile.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbTrafficProfile } from "./traffic-profile.handler.ts"; @@ -15,6 +16,7 @@ export const inspectDbTrafficProfileCommand = Command.make( "traffic-profile", INSPECT_DB_FLAGS, ).pipe( + withSidebar({ title: "Show read / write activity ratio for tables" }), Command.withDescription( "Show read/write activity ratio for tables based on block I/O operations.", ), diff --git a/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts b/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts index 3966ea33bc..af037761a0 100644 --- a/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts +++ b/apps/cli/src/commands/inspect/db/vacuum-stats/vacuum-stats.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../../command-internal/command-permissions/command-permissions.annotation.ts"; import { inspectDbVacuumStats } from "./vacuum-stats.handler.ts"; @@ -12,6 +13,7 @@ import { cliConfigValuesLayer } from "../../../../config/cli-config-values.layer import { withCliConfigFlags } from "../../../../config/cli-config-flags.ts"; export const inspectDbVacuumStatsCommand = Command.make("vacuum-stats", INSPECT_DB_FLAGS).pipe( + withSidebar({ title: "Show statistics related to vacuum operations" }), Command.withDescription("Show statistics related to vacuum operations per table."), Command.withShortDescription("Show vacuum stats"), withPermissions(INSPECT_DB_PERMISSIONS), diff --git a/apps/cli/src/commands/inspect/inspect.command.ts b/apps/cli/src/commands/inspect/inspect.command.ts index ca993f4a9a..c51c81baf6 100644 --- a/apps/cli/src/commands/inspect/inspect.command.ts +++ b/apps/cli/src/commands/inspect/inspect.command.ts @@ -1,9 +1,11 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { inspectDbCommand } from "./db/db.command.ts"; import { inspectReportCommand } from "./report/report.command.ts"; import { STACK_SELECTOR_FLAGS } from "../../command-internal/stack-target.ts"; export const inspectCommand = Command.make("inspect").pipe( + withSidebar({ category: "inspect" }), Command.withDescription("Tools to inspect your Supabase project."), Command.withShortDescription("Inspect project tools"), Command.withSubcommands([inspectReportCommand, inspectDbCommand]), diff --git a/apps/cli/src/commands/inspect/report/report.command.ts b/apps/cli/src/commands/inspect/report/report.command.ts index c4cf2c5c00..1773321b74 100644 --- a/apps/cli/src/commands/inspect/report/report.command.ts +++ b/apps/cli/src/commands/inspect/report/report.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -27,6 +28,7 @@ const config = { export type InspectReportFlags = CliCommand.Command.Config.Infer; export const inspectReportCommand = Command.make("report", config).pipe( + withSidebar({ title: "Inspect all database statistics and save output" }), Command.withDescription( "Generate a CSV output for all inspect commands. It reports on the local database by default; pass --remote for the linked project, or --remote= for another database.", ), diff --git a/apps/cli/src/commands/issue/issue.command.ts b/apps/cli/src/commands/issue/issue.command.ts index 340562015f..6325f119d9 100644 --- a/apps/cli/src/commands/issue/issue.command.ts +++ b/apps/cli/src/commands/issue/issue.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withTargetPolicy } from "../../command-internal/target/target-policy.ts"; @@ -161,6 +162,7 @@ const issueDocsCommand = Command.make("docs", issueDocsConfig).pipe( ); export const issueCommand = Command.make("issue").pipe( + withSidebar({ category: "feedback" }), Command.withDescription("Open Supabase CLI GitHub issue forms."), Command.withShortDescription("Open GitHub issue forms"), Command.withSubcommands([issueBugCommand, issueFeatureCommand, issueDocsCommand]), diff --git a/apps/cli/src/commands/link/link.command.ts b/apps/cli/src/commands/link/link.command.ts index 72c70e6d05..aa68c51df7 100644 --- a/apps/cli/src/commands/link/link.command.ts +++ b/apps/cli/src/commands/link/link.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Effect, Option } from "effect"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -64,6 +65,7 @@ const warnPasswordIgnored = Effect.fnUntraced(function* (flags: LinkFlags) { }); export const linkCommand = Command.make("link", config).pipe( + withSidebar({ category: "general" }), Command.withDescription("Link to a Supabase project."), Command.withShortDescription("Link to a Supabase project"), Command.withExamples([ diff --git a/apps/cli/src/commands/login/login.command.ts b/apps/cli/src/commands/login/login.command.ts index 2fbf3fa414..92536d7f68 100644 --- a/apps/cli/src/commands/login/login.command.ts +++ b/apps/cli/src/commands/login/login.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../command-internal/flag-documentation.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -33,6 +34,7 @@ const config = { export type LoginFlags = CliCommand.Command.Config.Infer; export const loginCommand = Command.make("login", config).pipe( + withSidebar({ category: "general", title: "Log in to a Supabase account" }), Command.withDescription("Authenticate using an access token."), Command.withShortDescription("Authenticate using an access token"), withPermissions( diff --git a/apps/cli/src/commands/logout/logout.command.ts b/apps/cli/src/commands/logout/logout.command.ts index 661cb281d9..143328681d 100644 --- a/apps/cli/src/commands/logout/logout.command.ts +++ b/apps/cli/src/commands/logout/logout.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withJsonErrorHandling } from "../../shared/output/json-error-handling.ts"; @@ -8,6 +9,7 @@ import { withTargetPolicy } from "../../command-internal/target/target-policy.ts import { withPermissions } from "../../command-internal/command-permissions/command-permissions.annotation.ts"; export const logoutCommand = Command.make("logout").pipe( + withSidebar({ category: "general" }), Command.withDescription("Log out and delete access tokens locally."), Command.withShortDescription("Log out and delete access tokens locally"), withPermissions({ operations: [] }), diff --git a/apps/cli/src/commands/logs/logs.command.ts b/apps/cli/src/commands/logs/logs.command.ts index 5f753405f7..607c84a643 100644 --- a/apps/cli/src/commands/logs/logs.command.ts +++ b/apps/cli/src/commands/logs/logs.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { OptionalSubcommand } from "../../shared/output/optional-subcommand-usage.ts"; import { Layer } from "effect"; import { Command, Flag } from "effect/cli"; @@ -141,6 +142,7 @@ const logsReadFlags = [ export const logsCommandFor = () => Command.make("logs", config).pipe( + withSidebar({ category: "logs", title: "Browse local or hosted logs" }), Command.annotate(OptionalSubcommand, true), Command.withDescription( "Browse local or hosted logs. Arrows select, Enter details, C copies, L loads more logs, and q quits. Custom SQL uses L to rerun. Pipes and machine output read once. Explicit --output-format text disables the viewer. Use --output-format json|stream-json for structured output; -o/--output is unsupported.", @@ -185,6 +187,7 @@ export const logsCommandFor = () => }), Command.withSubcommands([ Command.make("sources", sourcesConfig).pipe( + withSidebar({ title: "List supported log sources and filters" }), Command.withDescription( "List supported sources and filters. Hosted entries describe capabilities and do not imply that rows exist. Local entries list retained stack instances. Use --output-format json|stream-json for structured output; -o/--output is unsupported.", ), diff --git a/apps/cli/src/commands/migration/down/down.command.ts b/apps/cli/src/commands/migration/down/down.command.ts index c69d23b866..32ba7c18b2 100644 --- a/apps/cli/src/commands/migration/down/down.command.ts +++ b/apps/cli/src/commands/migration/down/down.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -38,6 +39,7 @@ const config = { export type MigrationDownFlags = CliCommand.Command.Config.Infer; export const migrationDownCommand = Command.make("down", config).pipe( + withSidebar({ title: "Reset migrations to a prior version" }), Command.withDescription("Resets applied migrations up to the last n versions."), Command.withShortDescription("Resets applied migrations up to the last n versions"), Command.withHandler((flags) => diff --git a/apps/cli/src/commands/migration/list/list.command.ts b/apps/cli/src/commands/migration/list/list.command.ts index b0b864a0ce..a467d65a1a 100644 --- a/apps/cli/src/commands/migration/list/list.command.ts +++ b/apps/cli/src/commands/migration/list/list.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -30,6 +31,7 @@ const config = { export type MigrationListFlags = CliCommand.Command.Config.Infer; export const migrationListCommand = Command.make("list", config).pipe( + withSidebar({ title: "List all migrations" }), Command.withDescription( "List local migration files and the migration history of the target database.", ), diff --git a/apps/cli/src/commands/migration/migration.command.ts b/apps/cli/src/commands/migration/migration.command.ts index dbdfaae3a3..d5dfba57b7 100644 --- a/apps/cli/src/commands/migration/migration.command.ts +++ b/apps/cli/src/commands/migration/migration.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { migrationListCommand } from "./list/list.command.ts"; import { migrationNewCommand } from "./new/new.command.ts"; @@ -8,6 +9,7 @@ import { migrationDownCommand } from "./down/down.command.ts"; import { migrationFetchCommand } from "./fetch/fetch.command.ts"; export const migrationCommand = Command.make("migration").pipe( + withSidebar({ category: "migrations", title: "Manage database migrations" }), Command.withDescription("Manage database migration scripts."), Command.withShortDescription("Manage database migration scripts"), Command.withAlias("migrations"), diff --git a/apps/cli/src/commands/migration/new/new.command.ts b/apps/cli/src/commands/migration/new/new.command.ts index 394ea3ff11..87afe14e69 100644 --- a/apps/cli/src/commands/migration/new/new.command.ts +++ b/apps/cli/src/commands/migration/new/new.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -17,6 +18,7 @@ const config = { export type MigrationNewFlags = CliCommand.Command.Config.Infer; export const migrationNewCommand = Command.make("new", config).pipe( + withSidebar({ title: "Create a migration" }), Command.withDescription("Create an empty migration script."), Command.withShortDescription("Create an empty migration script"), withPermissions({ operations: [] }), diff --git a/apps/cli/src/commands/migration/repair/repair.command.ts b/apps/cli/src/commands/migration/repair/repair.command.ts index 6b9f6a4e96..97df3d3d78 100644 --- a/apps/cli/src/commands/migration/repair/repair.command.ts +++ b/apps/cli/src/commands/migration/repair/repair.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command, Flag } from "effect/cli"; import { withPermissions } from "../../../command-internal/command-permissions/command-permissions.annotation.ts"; @@ -34,6 +35,7 @@ const config = { } as const; export const migrationRepairCommand = Command.make("repair", config).pipe( + withSidebar({ title: "Repair migration history table" }), Command.withDescription("Repair the migration history table."), Command.withShortDescription("Repair the migration history table"), Command.withHandler((flags) => diff --git a/apps/cli/src/commands/migration/up/up.command.ts b/apps/cli/src/commands/migration/up/up.command.ts index 24a0b8df5e..497c18ff52 100644 --- a/apps/cli/src/commands/migration/up/up.command.ts +++ b/apps/cli/src/commands/migration/up/up.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -27,6 +28,7 @@ const config = { export type MigrationUpFlags = CliCommand.Command.Config.Infer; export const migrationUpCommand = Command.make("up", config).pipe( + withSidebar({ title: "Apply pending migration files" }), Command.withDescription("Apply pending migrations to a database."), Command.withShortDescription("Apply pending migrations to a database"), Command.withHandler((flags) => diff --git a/apps/cli/src/commands/network-bans/get/get.command.ts b/apps/cli/src/commands/network-bans/get/get.command.ts index dfd981708f..07c011ce11 100644 --- a/apps/cli/src/commands/network-bans/get/get.command.ts +++ b/apps/cli/src/commands/network-bans/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -26,6 +27,7 @@ const config = { export type NetworkBansGetFlags = CliCommand.Command.Config.Infer; export const networkBansGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Retrieve network bans" }), Command.withDescription("Get the current network bans."), Command.withShortDescription("Get the current network bans"), withPermissions( diff --git a/apps/cli/src/commands/network-bans/network-bans.command.ts b/apps/cli/src/commands/network-bans/network-bans.command.ts index 8a6f614948..f2b2ad5d6f 100644 --- a/apps/cli/src/commands/network-bans/network-bans.command.ts +++ b/apps/cli/src/commands/network-bans/network-bans.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { networkBansGetCommand } from "./get/get.command.ts"; import { networkBansRemoveCommand } from "./remove/remove.command.ts"; export const networkBansCommand = Command.make("network-bans").pipe( + withSidebar({ category: "network-bans" }), Command.withDescription("Manage network bans."), Command.withShortDescription("Manage network bans"), Command.withSubcommands([networkBansGetCommand, networkBansRemoveCommand]), diff --git a/apps/cli/src/commands/network-restrictions/get/get.command.ts b/apps/cli/src/commands/network-restrictions/get/get.command.ts index 076835b031..21a3a2e8a5 100644 --- a/apps/cli/src/commands/network-restrictions/get/get.command.ts +++ b/apps/cli/src/commands/network-restrictions/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -26,6 +27,7 @@ const config = { export type NetworkRestrictionsGetFlags = CliCommand.Command.Config.Infer; export const networkRestrictionsGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Retrieve network restrictions" }), Command.withDescription("Get the current network restrictions."), Command.withShortDescription("Get the current network restrictions"), withPermissions( diff --git a/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts b/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts index e428dc290b..47ff339a71 100644 --- a/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts +++ b/apps/cli/src/commands/network-restrictions/network-restrictions.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { networkRestrictionsGetCommand } from "./get/get.command.ts"; import { networkRestrictionsUpdateCommand } from "./update/update.command.ts"; export const networkRestrictionsCommand = Command.make("network-restrictions").pipe( + withSidebar({ category: "network-restrictions" }), Command.withDescription("Manage network restrictions."), Command.withShortDescription("Manage network restrictions"), Command.withSubcommands([networkRestrictionsGetCommand, networkRestrictionsUpdateCommand]), diff --git a/apps/cli/src/commands/notebooks/notebooks.command.ts b/apps/cli/src/commands/notebooks/notebooks.command.ts index f4c2cec58c..3e6e8978b8 100644 --- a/apps/cli/src/commands/notebooks/notebooks.command.ts +++ b/apps/cli/src/commands/notebooks/notebooks.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { notebooksPullCommand } from "./pull/pull.command.ts"; import { notebooksPushCommand } from "./push/push.command.ts"; export const notebooksCommand = Command.make("notebooks").pipe( + withSidebar({ category: "notebooks", title: "Manage notebooks" }), Command.withDescription( "Manage Supabase notebooks: SQL and markdown cells stored with your project, kept in `supabase/notebooks/.json`.", ), diff --git a/apps/cli/src/commands/orgs/orgs.command.ts b/apps/cli/src/commands/orgs/orgs.command.ts index 2b12ed74e5..905b7f8cea 100644 --- a/apps/cli/src/commands/orgs/orgs.command.ts +++ b/apps/cli/src/commands/orgs/orgs.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { orgsCreateCommand } from "./create/create.command.ts"; import { orgsListCommand } from "./list/list.command.ts"; @@ -6,6 +7,7 @@ import { orgsListCommand } from "./list/list.command.ts"; // summary and the `supabase orgs --help` long description. No trailing // period. export const orgsCommand = Command.make("orgs").pipe( + withSidebar({ category: "organizations", title: "Manage organizations" }), Command.withDescription("Manage Supabase organizations"), Command.withShortDescription("Manage Supabase organizations"), Command.withSubcommands([orgsListCommand, orgsCreateCommand]), diff --git a/apps/cli/src/commands/postgres-config/delete/delete.command.ts b/apps/cli/src/commands/postgres-config/delete/delete.command.ts index 10988c3be9..6c53754fac 100644 --- a/apps/cli/src/commands/postgres-config/delete/delete.command.ts +++ b/apps/cli/src/commands/postgres-config/delete/delete.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -42,6 +43,7 @@ const config = { export type PostgresConfigDeleteFlags = CliCommand.Command.Config.Infer; export const postgresConfigDeleteCommand = Command.make("delete", config).pipe( + withSidebar({ title: "Delete Postgres configurations" }), Command.withDescription("Delete specific Postgres database config overrides."), Command.withShortDescription("Delete Postgres database config overrides"), withPermissions( diff --git a/apps/cli/src/commands/postgres-config/get/get.command.ts b/apps/cli/src/commands/postgres-config/get/get.command.ts index 9353e34f8d..4aace61524 100644 --- a/apps/cli/src/commands/postgres-config/get/get.command.ts +++ b/apps/cli/src/commands/postgres-config/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -27,6 +28,7 @@ const config = { export type PostgresConfigGetFlags = CliCommand.Command.Config.Infer; export const postgresConfigGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Retrieve the current Postgres config overrides" }), Command.withDescription("Get the current Postgres database config overrides."), Command.withShortDescription("Get Postgres database config"), withPermissions( diff --git a/apps/cli/src/commands/postgres-config/postgres-config.command.ts b/apps/cli/src/commands/postgres-config/postgres-config.command.ts index 946a4a8cdd..0039334957 100644 --- a/apps/cli/src/commands/postgres-config/postgres-config.command.ts +++ b/apps/cli/src/commands/postgres-config/postgres-config.command.ts @@ -1,9 +1,11 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { postgresConfigDeleteCommand } from "./delete/delete.command.ts"; import { postgresConfigGetCommand } from "./get/get.command.ts"; import { postgresConfigUpdateCommand } from "./update/update.command.ts"; export const postgresConfigCommand = Command.make("postgres-config").pipe( + withSidebar({ category: "postgres-config", title: "Manage Postgres configurations" }), Command.withDescription("Manage Postgres database config."), Command.withShortDescription("Manage Postgres database config"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/postgres-config/update/update.command.ts b/apps/cli/src/commands/postgres-config/update/update.command.ts index 63f2a48bcb..108c3ec026 100644 --- a/apps/cli/src/commands/postgres-config/update/update.command.ts +++ b/apps/cli/src/commands/postgres-config/update/update.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -48,6 +49,7 @@ const config = { export type PostgresConfigUpdateFlags = CliCommand.Command.Config.Infer; export const postgresConfigUpdateCommand = Command.make("update", config).pipe( + withSidebar({ title: "Update Postgres configurations" }), Command.withDescription("Update Postgres database config."), Command.withShortDescription("Update Postgres database config"), withPermissions( diff --git a/apps/cli/src/commands/projects/api-keys/api-keys.command.ts b/apps/cli/src/commands/projects/api-keys/api-keys.command.ts index 12c6d99db1..07704e085a 100644 --- a/apps/cli/src/commands/projects/api-keys/api-keys.command.ts +++ b/apps/cli/src/commands/projects/api-keys/api-keys.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; import { withPermissions } from "../../../command-internal/command-permissions/command-permissions.annotation.ts"; @@ -23,6 +24,7 @@ const config = { export type ProjectsApiKeysFlags = CliCommand.Command.Config.Infer; export const projectsApiKeysCommand = Command.make("api-keys", config).pipe( + withSidebar({ title: "Show API keys for a project" }), Command.withDescription("List all API keys for a Supabase project."), Command.withShortDescription("List API keys"), Command.withExamples([ diff --git a/apps/cli/src/commands/projects/projects.command.ts b/apps/cli/src/commands/projects/projects.command.ts index 9604c227a4..0b585303c1 100644 --- a/apps/cli/src/commands/projects/projects.command.ts +++ b/apps/cli/src/commands/projects/projects.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { projectsListCommand } from "./list/list.command.ts"; import { projectsCreateCommand } from "./create/create.command.ts"; @@ -5,6 +6,7 @@ import { projectsApiKeysCommand } from "./api-keys/api-keys.command.ts"; import { projectsDeleteCommand } from "./delete/delete.command.ts"; export const projectsCommand = Command.make("projects").pipe( + withSidebar({ category: "projects" }), Command.withDescription("Manage Supabase projects."), Command.withShortDescription("Manage projects"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/pull/pull.command.ts b/apps/cli/src/commands/pull/pull.command.ts index 6cf0b42cb0..38aab9d6b5 100644 --- a/apps/cli/src/commands/pull/pull.command.ts +++ b/apps/cli/src/commands/pull/pull.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import type * as CliCommand from "effect/cli/Command"; import { Command, Flag } from "effect/cli"; @@ -70,6 +71,7 @@ export const pullHandler = (flags: PullFlags) => ); export const pullCommand = Command.make("pull", config).pipe( + withSidebar({ category: "general" }), Command.withDescription( "Refreshes local project state from a linked Supabase project or branch in one step: pulls config into the project config file, optionally fetches the remote migration history table, pulls the database schema into supabase/migrations (also updating that database's migration history), and downloads every Edge Function's source. Asks for confirmation (default No) before writing, because the database step records the migration in the remote migration history table: an interactive terminal is prompted, and --output-format json|stream-json or a non-interactive run needs --yes (or SUPABASE_YES in the shell environment) — use --dry-run to preview first.", ), diff --git a/apps/cli/src/commands/secrets/list/list.command.ts b/apps/cli/src/commands/secrets/list/list.command.ts index df8480de70..93784fa839 100644 --- a/apps/cli/src/commands/secrets/list/list.command.ts +++ b/apps/cli/src/commands/secrets/list/list.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import type * as CliCommand from "effect/cli/Command"; import { Command } from "effect/cli"; @@ -20,6 +21,7 @@ const config = { export type SecretsListFlags = CliCommand.Command.Config.Infer; export const secretsListCommand = Command.make("list", config).pipe( + withSidebar({ title: "List all secrets" }), Command.withDescription("List all secrets in the linked project."), Command.withShortDescription("List all secrets on Supabase"), Command.withExamples([ diff --git a/apps/cli/src/commands/secrets/secrets.command.ts b/apps/cli/src/commands/secrets/secrets.command.ts index f30cd13cbd..3cb5dd6a76 100644 --- a/apps/cli/src/commands/secrets/secrets.command.ts +++ b/apps/cli/src/commands/secrets/secrets.command.ts @@ -1,9 +1,11 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { secretsListCommand } from "./list/list.command.ts"; import { secretsSetCommand } from "./set/set.command.ts"; import { secretsUnsetCommand } from "./unset/unset.command.ts"; export const secretsCommand = Command.make("secrets").pipe( + withSidebar({ category: "secrets", title: "Manage secrets" }), Command.withDescription("Manage Supabase secrets."), Command.withShortDescription("Manage Supabase secrets"), Command.withSubcommands([secretsListCommand, secretsSetCommand, secretsUnsetCommand]), diff --git a/apps/cli/src/commands/secrets/set/set.command.ts b/apps/cli/src/commands/secrets/set/set.command.ts index ab352a90d0..8bbddb7d34 100644 --- a/apps/cli/src/commands/secrets/set/set.command.ts +++ b/apps/cli/src/commands/secrets/set/set.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import type * as CliCommand from "effect/cli/Command"; import { Argument, Command, Flag } from "effect/cli"; @@ -30,6 +31,7 @@ const config = { export type SecretsSetFlags = CliCommand.Command.Config.Infer; export const secretsSetCommand = Command.make("set", config).pipe( + withSidebar({ title: "Set a secret" }), Command.withDescription("Set a secret(s) to the linked Supabase project."), Command.withShortDescription("Set a secret(s) on Supabase"), Command.withExamples([ diff --git a/apps/cli/src/commands/secrets/unset/unset.command.ts b/apps/cli/src/commands/secrets/unset/unset.command.ts index caaf4b65d9..589e6e9dee 100644 --- a/apps/cli/src/commands/secrets/unset/unset.command.ts +++ b/apps/cli/src/commands/secrets/unset/unset.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import type * as CliCommand from "effect/cli/Command"; import { Argument, Command, Flag } from "effect/cli"; @@ -34,6 +35,7 @@ const config = { export type SecretsUnsetFlags = CliCommand.Command.Config.Infer; export const secretsUnsetCommand = Command.make("unset", config).pipe( + withSidebar({ title: "Unset a secret" }), Command.withDescription("Unset a secret(s) from the linked Supabase project."), Command.withShortDescription("Unset a secret(s) on Supabase"), Command.withExamples([ diff --git a/apps/cli/src/commands/seed/buckets/buckets.command.ts b/apps/cli/src/commands/seed/buckets/buckets.command.ts index 686d2f41f9..55a545ff45 100644 --- a/apps/cli/src/commands/seed/buckets/buckets.command.ts +++ b/apps/cli/src/commands/seed/buckets/buckets.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Layer } from "effect"; import { Command } from "effect/cli"; @@ -19,6 +20,7 @@ import { withTargetPolicy } from "../../../command-internal/target/target-policy export type BucketsFlags = TargetFlagValues; export const bucketsCommand = Command.make("buckets").pipe( + withSidebar({ title: "Seed storage buckets from config file" }), Command.withDescription("Seed buckets declared in storage.buckets."), Command.withShortDescription("Seed buckets declared in storage.buckets"), withPermissions(storagePermissions([])), diff --git a/apps/cli/src/commands/seed/seed.command.ts b/apps/cli/src/commands/seed/seed.command.ts index 43a79cda28..a55a4068a1 100644 --- a/apps/cli/src/commands/seed/seed.command.ts +++ b/apps/cli/src/commands/seed/seed.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { seedTargetGlobalFlags } from "../../command-internal/target/target-flags.ts"; @@ -5,6 +6,7 @@ import { STACK_SELECTOR_FLAGS } from "../../command-internal/stack-target.ts"; import { bucketsCommand } from "./buckets/buckets.command.ts"; export const seedCommand = Command.make("seed").pipe( + withSidebar({ category: "seed" }), Command.withDescription("Seed a Supabase project from its config file."), Command.withShortDescription("Seed a Supabase project"), Command.withSubcommands([bucketsCommand]), diff --git a/apps/cli/src/commands/services/services.command.ts b/apps/cli/src/commands/services/services.command.ts index ec7d9b5fa9..84aa1241a0 100644 --- a/apps/cli/src/commands/services/services.command.ts +++ b/apps/cli/src/commands/services/services.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../command-internal/command-permissions/command-permissions.annotation.ts"; import { compose, withContext } from "../../command-internal/command-permissions/model.ts"; @@ -16,6 +17,7 @@ const config = {}; export type ServicesFlags = CliCommand.Command.Config.Infer; export const servicesCommand = Command.make("services", config).pipe( + withSidebar({ category: "services" }), Command.withDescription("Show versions of all Supabase services."), Command.withShortDescription("Show versions of all Supabase services"), withPermissions( diff --git a/apps/cli/src/commands/snippets/download/download.command.ts b/apps/cli/src/commands/snippets/download/download.command.ts index b9ea46d607..4fc19032fd 100644 --- a/apps/cli/src/commands/snippets/download/download.command.ts +++ b/apps/cli/src/commands/snippets/download/download.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -22,6 +23,7 @@ const config = { export type SnippetsDownloadFlags = CliCommand.Command.Config.Infer; export const snippetsDownloadCommand = Command.make("download", config).pipe( + withSidebar({ title: "Download SQL snippet content" }), Command.withDescription("Download contents of the specified SQL snippet."), Command.withShortDescription("Download contents of a SQL snippet"), Command.withExamples([ diff --git a/apps/cli/src/commands/snippets/snippets.command.ts b/apps/cli/src/commands/snippets/snippets.command.ts index 67ee9b3421..ad438a7513 100644 --- a/apps/cli/src/commands/snippets/snippets.command.ts +++ b/apps/cli/src/commands/snippets/snippets.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { snippetsListCommand } from "./list/list.command.ts"; import { snippetsDownloadCommand } from "./download/download.command.ts"; export const snippetsCommand = Command.make("snippets").pipe( + withSidebar({ category: "sql-snippets" }), Command.withDescription("Manage Supabase SQL snippets."), Command.withShortDescription("Manage Supabase SQL snippets"), Command.withSubcommands([snippetsListCommand, snippetsDownloadCommand]), diff --git a/apps/cli/src/commands/ssl-enforcement/get/get.command.ts b/apps/cli/src/commands/ssl-enforcement/get/get.command.ts index d662c5e97c..7d8462f62e 100644 --- a/apps/cli/src/commands/ssl-enforcement/get/get.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -26,6 +27,7 @@ const config = { export type SslEnforcementGetFlags = CliCommand.Command.Config.Infer; export const sslEnforcementGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Retrieve the current SSL enforcement configuration" }), Command.withDescription("Get the current SSL enforcement configuration."), Command.withShortDescription("Get SSL enforcement configuration"), withPermissions( diff --git a/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts b/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts index cecc2b9e35..09a1f56f2d 100644 --- a/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/ssl-enforcement.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { sslEnforcementGetCommand } from "./get/get.command.ts"; import { sslEnforcementUpdateCommand } from "./update/update.command.ts"; export const sslEnforcementCommand = Command.make("ssl-enforcement").pipe( + withSidebar({ category: "ssl-enforcement", title: "Manage SSL enforcement configurations" }), Command.withDescription("Manage SSL enforcement configuration."), Command.withShortDescription("Manage SSL enforcement"), Command.withSubcommands([sslEnforcementGetCommand, sslEnforcementUpdateCommand]), diff --git a/apps/cli/src/commands/ssl-enforcement/update/update.command.ts b/apps/cli/src/commands/ssl-enforcement/update/update.command.ts index 873fc66c6e..b6a9cab69b 100644 --- a/apps/cli/src/commands/ssl-enforcement/update/update.command.ts +++ b/apps/cli/src/commands/ssl-enforcement/update/update.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -38,6 +39,7 @@ const config = { export type SslEnforcementUpdateFlags = CliCommand.Command.Config.Infer; export const sslEnforcementUpdateCommand = Command.make("update", config).pipe( + withSidebar({ title: "Update SSL enforcement configurations" }), Command.withDescription("Update SSL enforcement configuration."), Command.withShortDescription("Update SSL enforcement configuration"), withPermissions( diff --git a/apps/cli/src/commands/sso/add/add.command.ts b/apps/cli/src/commands/sso/add/add.command.ts index 8bd2b54288..2e62f7010f 100644 --- a/apps/cli/src/commands/sso/add/add.command.ts +++ b/apps/cli/src/commands/sso/add/add.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -64,6 +65,7 @@ const config = { export type SsoAddFlags = CliCommand.Command.Config.Infer; export const ssoAddCommand = Command.make("add", config).pipe( + withSidebar({ title: "Add an identity provider" }), Command.withDescription( "Add and configure a new connection to a SSO identity provider to your Supabase project.", ), diff --git a/apps/cli/src/commands/sso/info/info.command.ts b/apps/cli/src/commands/sso/info/info.command.ts index 22ac1e044a..5657dc1430 100644 --- a/apps/cli/src/commands/sso/info/info.command.ts +++ b/apps/cli/src/commands/sso/info/info.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -19,6 +20,7 @@ const config = { export type SsoInfoFlags = CliCommand.Command.Config.Infer; export const ssoInfoCommand = Command.make("info", config).pipe( + withSidebar({ title: "See your project's SSO information" }), Command.withDescription( "Returns all of the important SSO information necessary for your project to be registered with a SAML 2.0 compatible identity provider.", ), diff --git a/apps/cli/src/commands/sso/list/list.command.ts b/apps/cli/src/commands/sso/list/list.command.ts index 30465c2b77..bbc49abfaa 100644 --- a/apps/cli/src/commands/sso/list/list.command.ts +++ b/apps/cli/src/commands/sso/list/list.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -20,6 +21,7 @@ const config = { export type SsoListFlags = CliCommand.Command.Config.Infer; export const ssoListCommand = Command.make("list", config).pipe( + withSidebar({ title: "List all identity providers" }), Command.withDescription("List all SSO identity providers for a project."), Command.withShortDescription("List all SSO identity providers"), Command.withExamples([ diff --git a/apps/cli/src/commands/sso/remove/remove.command.ts b/apps/cli/src/commands/sso/remove/remove.command.ts index c51e096ca3..b500e451dc 100644 --- a/apps/cli/src/commands/sso/remove/remove.command.ts +++ b/apps/cli/src/commands/sso/remove/remove.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -23,6 +24,7 @@ const config = { export type SsoRemoveFlags = CliCommand.Command.Config.Infer; export const ssoRemoveCommand = Command.make("remove", config).pipe( + withSidebar({ title: "Remove an identity provider" }), Command.withDescription( "Remove a connection to an already added SSO identity provider. Removing the provider will prevent existing users from logging in. Please treat this command with care.", ), diff --git a/apps/cli/src/commands/sso/show/show.command.ts b/apps/cli/src/commands/sso/show/show.command.ts index 13f7b81693..f82b54d206 100644 --- a/apps/cli/src/commands/sso/show/show.command.ts +++ b/apps/cli/src/commands/sso/show/show.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -26,6 +27,7 @@ const config = { export type SsoShowFlags = CliCommand.Command.Config.Infer; export const ssoShowCommand = Command.make("show", config).pipe( + withSidebar({ title: "Show information for an identity provider" }), Command.withDescription( "Provides the information about an established connection to an identity provider. You can use --metadata to obtain the raw SAML 2.0 Metadata XML document stored in your project's configuration.", ), diff --git a/apps/cli/src/commands/sso/sso.command.ts b/apps/cli/src/commands/sso/sso.command.ts index 746faabbf2..28bf44ddf7 100644 --- a/apps/cli/src/commands/sso/sso.command.ts +++ b/apps/cli/src/commands/sso/sso.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { ssoAddCommand } from "./add/add.command.ts"; import { ssoInfoCommand } from "./info/info.command.ts"; @@ -7,6 +8,7 @@ import { ssoShowCommand } from "./show/show.command.ts"; import { ssoUpdateCommand } from "./update/update.command.ts"; export const ssoCommand = Command.make("sso").pipe( + withSidebar({ category: "authentication", title: "Manage SSO on your project" }), Command.withDescription("Manage Single Sign-On (SSO) authentication for projects."), Command.withShortDescription("Manage Single Sign-On (SSO) authentication"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/sso/update/update.command.ts b/apps/cli/src/commands/sso/update/update.command.ts index ebd9e8c32b..8729527653 100644 --- a/apps/cli/src/commands/sso/update/update.command.ts +++ b/apps/cli/src/commands/sso/update/update.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -75,6 +76,7 @@ const config = { export type SsoUpdateFlags = CliCommand.Command.Config.Infer; export const ssoUpdateCommand = Command.make("update", config).pipe( + withSidebar({ title: "Update an identity provider" }), // The `of a already added` grammar slip is part of the established output // string — don't fix it here. Command.withDescription( diff --git a/apps/cli/src/commands/start/start.command.ts b/apps/cli/src/commands/start/start.command.ts index be53a301e0..3326b58dd2 100644 --- a/apps/cli/src/commands/start/start.command.ts +++ b/apps/cli/src/commands/start/start.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -90,6 +91,7 @@ const startRuntimeLayer = Layer.mergeAll( ); export const startCommand = Command.make("start", config).pipe( + withSidebar({ category: "general", title: "Start a container" }), Command.withDescription("Start containers for Supabase local development."), Command.withShortDescription("Start local Supabase stack"), withPermissions({ diff --git a/apps/cli/src/commands/status/status.command.ts b/apps/cli/src/commands/status/status.command.ts index 668eee8a33..3bc7add424 100644 --- a/apps/cli/src/commands/status/status.command.ts +++ b/apps/cli/src/commands/status/status.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -75,6 +76,7 @@ const statusRuntimeLayer = Layer.mergeAll( ); export const statusCommand = Command.make("status", config).pipe( + withSidebar({ category: "general", title: "Retrieve container status" }), Command.withDescription("Show status of local Supabase containers."), Command.withShortDescription("Show status of local Supabase containers"), Command.withExamples([ diff --git a/apps/cli/src/commands/stop/stop.command.ts b/apps/cli/src/commands/stop/stop.command.ts index 1347cddf61..59d11634b5 100644 --- a/apps/cli/src/commands/stop/stop.command.ts +++ b/apps/cli/src/commands/stop/stop.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -52,6 +53,7 @@ const stopRuntimeLayer = Layer.mergeAll( ); export const stopCommand = Command.make("stop", config).pipe( + withSidebar({ category: "general", title: "Stop all containers" }), Command.withDescription("Stop all local Supabase containers."), Command.withShortDescription("Stop all local Supabase containers"), Command.withExamples([ diff --git a/apps/cli/src/commands/storage/cp/cp.command.ts b/apps/cli/src/commands/storage/cp/cp.command.ts index c0e6a5fd40..0a59a55ee7 100644 --- a/apps/cli/src/commands/storage/cp/cp.command.ts +++ b/apps/cli/src/commands/storage/cp/cp.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Effect } from "effect"; import { Argument, Command, Flag } from "effect/cli"; @@ -68,6 +69,7 @@ const config = { export type StorageCpFlags = CliCommand.Command.Config.Infer; export const storageCpCommand = Command.make("cp", config).pipe( + withSidebar({ title: "Upload and download from Storage" }), Command.withDescription("Copy objects from src to dst path."), Command.withShortDescription("Copy objects from src to dst path"), Command.withExamples([ diff --git a/apps/cli/src/commands/storage/ls/ls.command.ts b/apps/cli/src/commands/storage/ls/ls.command.ts index 32b6dc4e65..5092bdaf1d 100644 --- a/apps/cli/src/commands/storage/ls/ls.command.ts +++ b/apps/cli/src/commands/storage/ls/ls.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -29,6 +30,7 @@ const config = { export type StorageLsFlags = CliCommand.Command.Config.Infer; export const storageLsCommand = Command.make("ls", config).pipe( + withSidebar({ title: "Lists all Storage objects" }), Command.withDescription("List objects by path prefix."), Command.withShortDescription("List objects by path prefix"), Command.withExamples([ diff --git a/apps/cli/src/commands/storage/mv/mv.command.ts b/apps/cli/src/commands/storage/mv/mv.command.ts index 3abe76b1cc..372f842ed9 100644 --- a/apps/cli/src/commands/storage/mv/mv.command.ts +++ b/apps/cli/src/commands/storage/mv/mv.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -27,6 +28,7 @@ const config = { export type StorageMvFlags = CliCommand.Command.Config.Infer; export const storageMvCommand = Command.make("mv", config).pipe( + withSidebar({ title: "Move objects within a bucket" }), Command.withDescription("Move objects from src to dst path."), Command.withShortDescription("Move objects from src to dst path"), Command.withExamples([ diff --git a/apps/cli/src/commands/storage/rm/rm.command.ts b/apps/cli/src/commands/storage/rm/rm.command.ts index c8b5a1ccbf..e0db9d068e 100644 --- a/apps/cli/src/commands/storage/rm/rm.command.ts +++ b/apps/cli/src/commands/storage/rm/rm.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect, Layer } from "effect"; import { Argument, Command, Flag } from "effect/cli"; @@ -27,6 +28,7 @@ const config = { } as const; export const storageRmCommand = Command.make("rm", config).pipe( + withSidebar({ title: "Delete objects from Storage" }), Command.withDescription("Remove objects by file path."), Command.withShortDescription("Remove objects by file path"), Command.withExamples([ diff --git a/apps/cli/src/commands/storage/storage.command.ts b/apps/cli/src/commands/storage/storage.command.ts index 6c707379d0..4faa481bb7 100644 --- a/apps/cli/src/commands/storage/storage.command.ts +++ b/apps/cli/src/commands/storage/storage.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { storageLsCommand } from "./ls/ls.command.ts"; import { storageCpCommand } from "./cp/cp.command.ts"; @@ -6,6 +7,7 @@ import { storageRmCommand } from "./rm/rm.command.ts"; import { STACK_SELECTOR_FLAGS } from "../../command-internal/stack-target.ts"; export const storageCommand = Command.make("storage").pipe( + withSidebar({ category: "storage", title: "Manage Storage objects" }), Command.withDescription("Manage Supabase Storage objects."), Command.withShortDescription("Manage Supabase Storage objects"), // `--remote` and its aliases are declared per-leaf (see `storage.flags.ts`), not as diff --git a/apps/cli/src/commands/telemetry/telemetry.command.ts b/apps/cli/src/commands/telemetry/telemetry.command.ts index 93b63fd8ca..2c53176a32 100644 --- a/apps/cli/src/commands/telemetry/telemetry.command.ts +++ b/apps/cli/src/commands/telemetry/telemetry.command.ts @@ -1,9 +1,11 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { telemetryDisableCommand } from "./disable/disable.command.ts"; import { telemetryEnableCommand } from "./enable/enable.command.ts"; import { telemetryStatusCommand } from "./status/status.command.ts"; export const telemetryCommand = Command.make("telemetry").pipe( + withSidebar({ category: "telemetry", title: "Manage CLI telemetry settings" }), Command.withDescription("Manage CLI telemetry settings."), Command.withShortDescription("Manage telemetry"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/test/db/db.command.ts b/apps/cli/src/commands/test/db/db.command.ts index bf84af024f..745c114cce 100644 --- a/apps/cli/src/commands/test/db/db.command.ts +++ b/apps/cli/src/commands/test/db/db.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { withPermissions } from "../../../command-internal/command-permissions/command-permissions.annotation.ts"; @@ -21,6 +22,7 @@ import { STACK_SELECTOR_FLAGS } from "../../../command-internal/stack-target.ts" * `testDbConfig`/`runTestDbCommand` implementation across two `Command` registrations. */ export const testDbCommand = Command.make("db", testDbConfig).pipe( + withSidebar({ title: "Run tests (pgTAP)" }), Command.withDescription(TEST_DB_DESCRIPTION), Command.withShortDescription(TEST_DB_SHORT), Command.withHandler(runTestDbCommand), diff --git a/apps/cli/src/commands/test/new/new.command.ts b/apps/cli/src/commands/test/new/new.command.ts index 6f3133b25e..2d8bcadcc3 100644 --- a/apps/cli/src/commands/test/new/new.command.ts +++ b/apps/cli/src/commands/test/new/new.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Layer } from "effect"; import { Argument, Command, Flag } from "effect/cli"; @@ -39,6 +40,7 @@ const testNewRuntimeLayer = Layer.mergeAll( ); export const testNewCommand = Command.make("new", config).pipe( + withSidebar({ title: "Create a new test" }), Command.withDescription("Create a new test file."), Command.withShortDescription("Create a new test file"), withPermissions({ operations: [], noApiEffectFlags: ["template"] }), diff --git a/apps/cli/src/commands/test/test.command.ts b/apps/cli/src/commands/test/test.command.ts index 02c320cb54..eca0d392f3 100644 --- a/apps/cli/src/commands/test/test.command.ts +++ b/apps/cli/src/commands/test/test.command.ts @@ -1,8 +1,10 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { testDbCommand } from "./db/db.command.ts"; import { testNewCommand } from "./new/new.command.ts"; export const testCommand = Command.make("test").pipe( + withSidebar({ category: "testing", title: "Run tests" }), Command.withDescription("Run tests on local Supabase containers."), Command.withShortDescription("Run tests on local Supabase containers"), Command.withSubcommands([testDbCommand, testNewCommand]), diff --git a/apps/cli/src/commands/unlink/unlink.command.ts b/apps/cli/src/commands/unlink/unlink.command.ts index cfbd0e57d9..c4d7ff2081 100644 --- a/apps/cli/src/commands/unlink/unlink.command.ts +++ b/apps/cli/src/commands/unlink/unlink.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Layer } from "effect"; import { Command } from "effect/cli"; @@ -30,6 +31,7 @@ const unlinkRuntimeLayer = Layer.mergeAll( ); export const unlinkCommand = Command.make("unlink").pipe( + withSidebar({ category: "general" }), Command.withDescription("Unlink a Supabase project."), Command.withShortDescription("Unlink a Supabase project"), withPermissions({ operations: [] }), diff --git a/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts b/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts index cdb209622d..e0e74c22c5 100644 --- a/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/delete/delete.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -26,6 +27,7 @@ const config = { export type VanitySubdomainsDeleteFlags = CliCommand.Command.Config.Infer; export const vanitySubdomainsDeleteCommand = Command.make("delete", config).pipe( + withSidebar({ title: "Delete vanity subdomain" }), Command.withDescription( "Deletes the vanity subdomain for a project, and reverts to using the project ref for routing.", ), diff --git a/apps/cli/src/commands/vanity-subdomains/get/get.command.ts b/apps/cli/src/commands/vanity-subdomains/get/get.command.ts index 933b3e4d95..86f2afa652 100644 --- a/apps/cli/src/commands/vanity-subdomains/get/get.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/get/get.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -26,6 +27,7 @@ const config = { export type VanitySubdomainsGetFlags = CliCommand.Command.Config.Infer; export const vanitySubdomainsGetCommand = Command.make("get", config).pipe( + withSidebar({ title: "Retrieve vanity subdomain" }), Command.withDescription("Get the current vanity subdomain."), Command.withShortDescription("Get the current vanity subdomain"), withPermissions( diff --git a/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts b/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts index f4c838479f..2e567f8c84 100644 --- a/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts +++ b/apps/cli/src/commands/vanity-subdomains/vanity-subdomains.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import { Command } from "effect/cli"; import { vanitySubdomainsActivateCommand } from "./activate/activate.command.ts"; import { vanitySubdomainsCheckAvailabilityCommand } from "./check-availability/check-availability.command.ts"; @@ -5,6 +6,7 @@ import { vanitySubdomainsDeleteCommand } from "./delete/delete.command.ts"; import { vanitySubdomainsGetCommand } from "./get/get.command.ts"; export const vanitySubdomainsCommand = Command.make("vanity-subdomains").pipe( + withSidebar({ category: "vanity-subdomains" }), Command.withDescription("Manage vanity subdomains for Supabase projects."), Command.withShortDescription("Manage vanity subdomains"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/whoami/whoami.command.ts b/apps/cli/src/commands/whoami/whoami.command.ts index b5e99db796..18fb0fc842 100644 --- a/apps/cli/src/commands/whoami/whoami.command.ts +++ b/apps/cli/src/commands/whoami/whoami.command.ts @@ -1,3 +1,4 @@ +import { withSidebar } from "../../command-internal/command-sidebar.ts"; import type * as CliCommand from "effect/cli/Command"; import { Command } from "effect/cli"; @@ -22,6 +23,7 @@ export const whoamiHandler = (flags: WhoamiFlags) => ); export const whoamiCommand = Command.make("whoami", config).pipe( + withSidebar({ category: "general" }), Command.withDescription("Show information about the currently logged-in user."), Command.withShortDescription("Show the current user"), Command.withExamples([ diff --git a/apps/cli/src/docs/docs-sidebar.ts b/apps/cli/src/docs/docs-sidebar.ts new file mode 100644 index 0000000000..0599ef5d3c --- /dev/null +++ b/apps/cli/src/docs/docs-sidebar.ts @@ -0,0 +1,109 @@ +import { Option } from "effect"; +import type { Command } from "effect/cli"; +import { DOCS_SIDEBAR_CATEGORIES, readSidebar } from "../command-internal/command-sidebar.ts"; +import type { DocsSidebarCategory } from "../command-internal/command-sidebar.ts"; +import { docsSummary, walkDocsCommands } from "./docs-spec.ts"; + +/** Hand-written pages listed above the command categories. */ +const DOCS_SIDEBAR_PAGES: ReadonlyArray<{ readonly id: string; readonly title: string }> = [ + { id: "introduction", title: "Introduction" }, + { id: "global-flags", title: "Global flags" }, +]; + +/** Longest sidebar title the docs site renders on one line. */ +const DOCS_SIDEBAR_TITLE_MAX_LENGTH = 50; + +interface DocsSidebarPage { + readonly title: string; + readonly id: string; + readonly slug: string; + readonly isFunc: false; + readonly type: "markdown"; +} + +interface DocsSidebarCommand { + readonly id: string; + readonly title: string; + readonly slug: string; + readonly type: "cli-command"; +} + +interface DocsSidebarSection { + readonly type: "category"; + readonly title: string; + readonly items: ReadonlyArray; +} + +export type DocsSidebarEntry = DocsSidebarPage | DocsSidebarSection; + +/** + * Builds the docs-site sidebar (`common-cli-sections.json`) from the published command tree. + * Every command is listed flat under its top-level command's category. + */ +export function buildDocsSidebar(root: Command.Command.Any): ReadonlyArray { + const sections = new Map>(); + const problems: Array = []; + let category: DocsSidebarCategory | undefined; + + walkDocsCommands(root, (command, path) => { + const id = path.join("-"); + const sidebar = readSidebar(command); + const declared = + Option.isSome(sidebar) && "category" in sidebar.value ? sidebar.value.category : undefined; + if (path.length === 2) { + category = declared; + if (category === undefined) { + problems.push( + `"${id}" has no sidebar category: annotate it with withSidebar({ category }).`, + ); + return; + } + } else if (declared !== undefined) { + problems.push(`"${id}" declares a sidebar category; only top-level commands may.`); + } + if (category === undefined) return; + + const title = + Option.isSome(sidebar) && sidebar.value.title !== undefined + ? sidebar.value.title + : docsSummary(command); + if (title.length > DOCS_SIDEBAR_TITLE_MAX_LENGTH) { + problems.push( + `"${id}" sidebar title is ${title.length} chars (max ${DOCS_SIDEBAR_TITLE_MAX_LENGTH}): set withSidebar({ title }) instead of changing the short description.`, + ); + } + + const items = sections.get(category) ?? []; + items.push({ id, title, slug: id, type: "cli-command" }); + sections.set(category, items); + }); + + for (const { id } of DOCS_SIDEBAR_CATEGORIES) { + if (!sections.has(id)) + problems.push( + `sidebar category "${id}" has no commands: remove it or annotate a command with it.`, + ); + } + if (problems.length > 0) { + throw new Error(`docs-sidebar.ts: the sidebar cannot be built:\n ${problems.join("\n ")}`); + } + + return [ + ...DOCS_SIDEBAR_PAGES.map(({ id, title }): DocsSidebarPage => ({ + title, + id, + slug: id, + isFunc: false, + type: "markdown", + })), + ...DOCS_SIDEBAR_CATEGORIES.map(({ id, title }): DocsSidebarSection => ({ + type: "category", + title, + items: sections.get(id) ?? [], + })), + ]; +} + +export function stringifyDocsSidebar(sidebar: ReadonlyArray): string { + return `${JSON.stringify(sidebar, null, 2)}\n`; +} diff --git a/apps/cli/src/docs/docs-sidebar.unit.test.ts b/apps/cli/src/docs/docs-sidebar.unit.test.ts new file mode 100644 index 0000000000..3930c67174 --- /dev/null +++ b/apps/cli/src/docs/docs-sidebar.unit.test.ts @@ -0,0 +1,144 @@ +import { describe, expect, it } from "@effect/vitest"; +import { Command } from "effect/cli"; +import { DOCS_SIDEBAR_CATEGORIES, withSidebar } from "../command-internal/command-sidebar.ts"; +import type { DocsSidebarCategory } from "../command-internal/command-sidebar.ts"; +import { rootCommand } from "../cli/root.ts"; +import { docsCommandTree } from "./docs-spec.ts"; +import { buildDocsSidebar } from "./docs-sidebar.ts"; + +interface SidebarNode { + readonly id?: string; + readonly title: string; + readonly items?: ReadonlyArray; +} + +function commandIds(nodes: ReadonlyArray): Array { + return nodes.flatMap((node) => [ + ...(node.id === undefined ? [] : [node.id]), + ...commandIds(node.items ?? []), + ]); +} + +function categoryStubs(omit?: DocsSidebarCategory) { + return DOCS_SIDEBAR_CATEGORIES.filter(({ id }) => id !== omit).map(({ id }) => + Command.make(id).pipe( + Command.withShortDescription(`Manage ${id}`), + withSidebar({ category: id }), + ), + ); +} + +describe("buildDocsSidebar", () => { + it("lists every published command once, under the categories in table order", () => { + const sidebar = buildDocsSidebar(rootCommand); + + expect(sidebar.map((entry) => entry.title)).toEqual([ + "Introduction", + "Global flags", + ...DOCS_SIDEBAR_CATEGORIES.map((category) => category.title), + ]); + const listed = commandIds(sidebar.filter((entry) => entry.type === "category")); + expect(listed.toSorted()).toEqual([...docsCommandTree(rootCommand).keys()].toSorted()); + }); + + it("places migration subcommands alphabetically after their parent", () => { + const sidebar = buildDocsSidebar(rootCommand); + const migrations = sidebar.find((entry) => entry.title === "Migrations"); + const ids = migrations?.type === "category" ? migrations.items.map((item) => item.id) : []; + + expect(ids[0]).toBe("supabase-migration"); + const subcommands = ids.slice(1); + expect(subcommands.length).toBeGreaterThan(0); + expect(subcommands.every((id) => id.startsWith("supabase-migration-"))).toBe(true); + expect(subcommands).toEqual(subcommands.toSorted()); + }); + + it("lists descendants flat under the inherited category with title overrides or short descriptions", () => { + const parent = Command.make("parent").pipe( + Command.withShortDescription("Parent description"), + withSidebar({ category: "general" }), + Command.withSubcommands([ + Command.make("group").pipe( + Command.withShortDescription("Group description"), + Command.withSubcommands([ + Command.make("child").pipe( + Command.withShortDescription("Child description"), + withSidebar({ title: "Child override" }), + ), + ]), + ), + ]), + ); + const root = Command.make("supabase").pipe( + Command.withSubcommands([...categoryStubs("general"), parent]), + ); + + const general = buildDocsSidebar(root).find((entry) => entry.title === "General"); + + expect(general?.type === "category" ? general.items : []).toEqual([ + { + id: "supabase-parent", + title: "Parent description", + slug: "supabase-parent", + type: "cli-command", + }, + { + id: "supabase-parent-group", + title: "Group description", + slug: "supabase-parent-group", + type: "cli-command", + }, + { + id: "supabase-parent-group-child", + title: "Child override", + slug: "supabase-parent-group-child", + type: "cli-command", + }, + ]); + }); + + it("rejects a subcommand that declares a category", () => { + const parent = Command.make("parent").pipe( + withSidebar({ category: "general" }), + Command.withSubcommands([Command.make("child").pipe(withSidebar({ category: "general" }))]), + ); + const root = Command.make("supabase").pipe( + Command.withSubcommands([...categoryStubs("general"), parent]), + ); + + expect(() => buildDocsSidebar(root)).toThrow( + /"supabase-parent-child" declares a sidebar category/, + ); + }); + + it("rejects an uncategorized top-level command", () => { + const root = Command.make("supabase").pipe( + Command.withSubcommands([ + ...categoryStubs(), + Command.make("orphan").pipe(Command.withShortDescription("Orphan")), + ]), + ); + + expect(() => buildDocsSidebar(root)).toThrow(/"supabase-orphan" has no sidebar category/); + }); + + it("rejects a title longer than 50 characters", () => { + const root = Command.make("supabase").pipe( + Command.withSubcommands([ + ...categoryStubs("general"), + Command.make("wordy").pipe( + Command.withShortDescription("x".repeat(51)), + withSidebar({ category: "general" }), + ), + ]), + ); + + expect(() => buildDocsSidebar(root)).toThrow(/"supabase-wordy" sidebar title is 51 chars/); + }); + + it("rejects an unused category", () => { + const root = Command.make("supabase").pipe(Command.withSubcommands(categoryStubs("testing"))); + + expect(() => buildDocsSidebar(root)).toThrow(/sidebar category "testing" has no commands/); + }); +}); diff --git a/apps/cli/src/docs/docs-spec.tables.ts b/apps/cli/src/docs/docs-spec.tables.ts index af5fa3e12c..85241bd7b5 100644 --- a/apps/cli/src/docs/docs-spec.tables.ts +++ b/apps/cli/src/docs/docs-spec.tables.ts @@ -1,68 +1,10 @@ import type { DocsFlag } from "./docs-spec.ts"; /** - * Static data the Effect command tree cannot express structurally: docs-site section tags, - * argument usage exceptions and query-specific output formats. - * `buildDocsSpec` fails the build on stale keys. + * Static data the Effect command tree cannot express structurally: argument usage exceptions + * and query-specific output formats. `buildDocsSpec` fails the build on stale keys. */ -export interface DocsInfoTag { - readonly id: string; - readonly title: string; -} - -export const DOCS_INFO_TAGS: ReadonlyArray = [ - { id: "quick-start", title: "Quick Start" }, - { id: "local-dev", title: "Local Development" }, - { id: "management-api", title: "Management APIs" }, - { id: "other-commands", title: "Additional Commands" }, -]; - -/** Docs-site section tag per top-level command. */ -export const DOCS_TAGS: Readonly>> = { - "supabase-bootstrap": ["quick-start"], - "supabase-backups": ["management-api"], - "supabase-branches": ["management-api"], - "supabase-completion": ["other-commands"], - "supabase-config": ["management-api"], - "supabase-db": ["local-dev"], - "supabase-domains": ["management-api"], - "supabase-encryption": ["management-api"], - "supabase-feedback": ["other-commands"], - "supabase-functions": ["management-api"], - "supabase-gen": ["local-dev"], - "supabase-init": ["local-dev"], - "supabase-inspect": ["local-dev"], - "supabase-issue": ["other-commands"], - "supabase-link": ["local-dev"], - "supabase-login": ["local-dev"], - "supabase-logout": ["local-dev"], - "supabase-logs": ["management-api", "local-dev"], - "supabase-migration": ["local-dev"], - "supabase-network-bans": ["management-api"], - "supabase-network-restrictions": ["management-api"], - "supabase-notebooks": ["management-api"], - "supabase-orgs": ["management-api"], - "supabase-postgres-config": ["management-api"], - "supabase-projects": ["management-api"], - "supabase-pull": ["other-commands"], - "supabase-secrets": ["management-api"], - "supabase-seed": ["local-dev"], - "supabase-services": ["local-dev"], - "supabase-snippets": ["management-api"], - "supabase-ssl-enforcement": ["management-api"], - "supabase-sso": ["management-api"], - "supabase-start": ["local-dev"], - "supabase-status": ["local-dev"], - "supabase-stop": ["local-dev"], - "supabase-storage": ["management-api"], - "supabase-telemetry": ["local-dev"], - "supabase-test": ["local-dev"], - "supabase-unlink": ["local-dev"], - "supabase-vanity-subdomains": ["management-api"], - "supabase-whoami": ["management-api"], -}; - /** * Flag docs injected into specific commands beyond what their Effect config * declares, keyed by doc id. `db query` reuses the global `-o, --output` diff --git a/apps/cli/src/docs/docs-spec.ts b/apps/cli/src/docs/docs-spec.ts index a3c747f47a..c705333c9d 100644 --- a/apps/cli/src/docs/docs-spec.ts +++ b/apps/cli/src/docs/docs-spec.ts @@ -14,14 +14,7 @@ import { unwrapParam } from "../command-internal/param-introspection.ts"; import { flagDefault, flagDocumentation } from "../command-internal/flag-documentation.ts"; import { isRemoteFlag } from "../command-internal/target/target-flags.ts"; import { remoteFlagName } from "../shared/output/target-help.ts"; -import { - DOCS_ARG_OVERRIDES, - DOCS_EXTRA_FLAGS, - DOCS_INFO_DESCRIPTION, - DOCS_INFO_TAGS, - DOCS_TAGS, -} from "./docs-spec.tables.ts"; -import type { DocsInfoTag } from "./docs-spec.tables.ts"; +import { DOCS_ARG_OVERRIDES, DOCS_EXTRA_FLAGS, DOCS_INFO_DESCRIPTION } from "./docs-spec.tables.ts"; /** * Builds the `clispec 001` document consumed by the supabase.com CLI reference @@ -59,7 +52,7 @@ export interface DocsCommand { readonly summary: string; readonly description: string; readonly examples?: ReadonlyArray; - readonly tags: ReadonlyArray; + readonly tags: ReadonlyArray; readonly links: ReadonlyArray; readonly usage?: string; readonly subcommands: ReadonlyArray; @@ -75,7 +68,7 @@ interface DocsInfo { readonly bugs: string; readonly spec: string; readonly description: string; - readonly tags: ReadonlyArray; + readonly tags: ReadonlyArray; } export interface DocsSpec { @@ -244,7 +237,8 @@ function docsVisibleChildren(command: Command.Command.Any): ReadonlyArray docsCompare(a.name, b.name)); } -function walkDocsCommands( +/** Visits every published command depth-first, children in byte-wise name order. */ +export function walkDocsCommands( root: Command.Command.Any, onCommand: ( command: Command.Command.Any, @@ -292,7 +286,7 @@ export function docsCommandTree( } /** First line of a command's long description, for the listing summary fallback. */ -function docsSummary(command: Command.Command.Any): string { +export function docsSummary(command: Command.Command.Any): string { if (command.shortDescription !== undefined) return command.shortDescription; const description = command.description ?? ""; const newline = description.indexOf("\n"); @@ -419,13 +413,6 @@ export function buildDocsSpec(input: DocsSpecInput): DocsSpec { ].join(" "); } - const tags = DOCS_TAGS[docId]; - if (tags === undefined && commandPath.length === 2) { - throw new Error( - `docs-spec.ts: top-level command "${docId}" has no DOCS_TAGS entry — add its docs-site section tag (or "other-commands") to docs-spec.tables.ts.`, - ); - } - const commandExamples = command.examples.length > 0 ? command.examples.map((example, index) => { @@ -445,7 +432,7 @@ export function buildDocsSpec(input: DocsSpecInput): DocsSpec { summary: docsSummary(command), description, ...(commandExamples === undefined ? {} : { examples: commandExamples }), - tags: tags ?? [], + tags: [], links: [], ...(usage === undefined ? {} : { usage }), subcommands: publishedChildren.map((child) => [...commandPath, child.name].join("-")), @@ -478,7 +465,7 @@ export function buildDocsSpec(input: DocsSpecInput): DocsSpec { bugs: "https://github.com/supabase/cli/issues", spec: "https://github.com/supabase/spec/cli_v1_commands.yaml", description: DOCS_INFO_DESCRIPTION, - tags: DOCS_INFO_TAGS, + tags: [], }, flags: rootFlags, commands, @@ -511,9 +498,6 @@ function validateDocsTables(seen: { readonly consumedExtraFlagIds: ReadonlySet; }): void { const stale: Array = []; - for (const id of Object.keys(DOCS_TAGS)) { - if (!seen.emittedIds.has(id)) stale.push(`DOCS_TAGS: "${id}"`); - } for (const id of Object.keys(DOCS_EXTRA_FLAGS)) { if (!seen.consumedExtraFlagIds.has(id)) stale.push(`DOCS_EXTRA_FLAGS: "${id}"`); } diff --git a/apps/cli/src/docs/docs-spec.unit.test.ts b/apps/cli/src/docs/docs-spec.unit.test.ts index 3ea019b392..cc20c3fde2 100644 --- a/apps/cli/src/docs/docs-spec.unit.test.ts +++ b/apps/cli/src/docs/docs-spec.unit.test.ts @@ -214,12 +214,6 @@ describe("buildDocsSpec", () => { expect(spec.clispec).toBe("001"); expect(spec.info.id).toBe("cli"); expect(spec.info.version).toBe("1.2.3"); - expect(spec.info.tags.map((tag) => tag.id)).toEqual([ - "quick-start", - "local-dev", - "management-api", - "other-commands", - ]); }); it("excludes gated Compute and Stack commands from the default docs spec", () => { @@ -273,13 +267,12 @@ describe("buildDocsSpec", () => { it("includes the TS-only completion and issue families", () => { const { byId } = builtSpec(); expect(byId.get("supabase-completion")?.subcommands).toContain("supabase-completion-zsh"); - expect(byId.get("supabase-issue")?.tags).toEqual(["other-commands"]); + expect(byId.get("supabase-issue")?.subcommands).toContain("supabase-issue-bug"); }); it("includes the top-level whoami command in the Management API reference", () => { const whoami = builtSpec().byId.get("supabase-whoami"); expect(whoami).toBeDefined(); - expect(whoami?.tags).toEqual(["management-api"]); expect(whoami?.usage).toBe("supabase whoami [flags]"); expect(whoami?.subcommands).toEqual([]); expect(whoami?.description).toBe("Show information about the currently logged-in user."); @@ -297,7 +290,6 @@ describe("buildDocsSpec", () => { const { byId, content } = builtSpec(); const link = byId.get("supabase-link"); expect(link).toBeDefined(); - expect(link?.tags).toEqual(["local-dev"]); expect(link?.usage).toBe("supabase link [ref-or-branch] [flags]"); expect(link?.flags.map((flag) => flag.id)).toEqual(["project-ref", "skip-pooler"]); expect(link?.description).toBe( @@ -546,14 +538,6 @@ describe("build guards fail loudly", () => { expect(() => buildDocsSpec({ root, ...emptyInput })).toThrow(/no --experimental global flag/); }); - it("throws for a top-level command without a docs section tag", () => { - const root = Command.make("supabase").pipe( - Command.withSubcommands([Command.make("not-a-real-command")]), - Command.withGlobalFlags([ExperimentalFlag]), - ); - expect(() => buildDocsSpec({ root, ...emptyInput })).toThrow(/no DOCS_TAGS entry/); - }); - it("throws listing stale static-table entries for a shrunken tree", () => { const root = Command.make("supabase").pipe( Command.withSubcommands([Command.make("link")]), From 3967ed81da8f92e3f8c56539ff1339c194f15a35 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 19 Nov 2026 12:00:38 -0700 Subject: [PATCH 2/2] chore(cli): address sidebar review findings --- apps/cli/scripts/generate-docs-sidebar.ts | 9 +++++++-- apps/cli/scripts/generate-docs-spec.ts | 4 ++++ apps/cli/src/command-internal/command-sidebar.ts | 2 +- apps/cli/src/commands/db/db.command.ts | 2 +- apps/cli/src/commands/db/diff/diff.command.ts | 2 -- apps/cli/src/commands/db/dump/dump.command.ts | 2 -- apps/cli/src/commands/db/pull/pull.command.ts | 2 -- .../commands/postgres-config/delete/delete.command.ts | 2 -- apps/cli/src/commands/start/start.command.ts | 2 +- apps/cli/src/commands/stop/stop.command.ts | 2 +- apps/cli/src/commands/storage/ls/ls.command.ts | 2 -- apps/cli/src/docs/docs-sidebar.ts | 8 ++++++-- apps/cli/src/docs/docs-sidebar.unit.test.ts | 11 +++++++++++ apps/cli/src/docs/docs-spec.unit.test.ts | 2 +- 14 files changed, 33 insertions(+), 19 deletions(-) diff --git a/apps/cli/scripts/generate-docs-sidebar.ts b/apps/cli/scripts/generate-docs-sidebar.ts index dd511d638d..69369c7f80 100644 --- a/apps/cli/scripts/generate-docs-sidebar.ts +++ b/apps/cli/scripts/generate-docs-sidebar.ts @@ -2,8 +2,13 @@ * Emits the docs-site CLI sidebar (`common-cli-sections.json`) from the Effect command tree. Run as * `bun scripts/generate-docs-sidebar.ts > common-cli-sections.json`. */ -import process from "node:process"; +import { BunRuntime } from "@effect/platform-bun"; +import { Console, Effect } from "effect"; import { rootCommand } from "../src/cli/root.ts"; import { buildDocsSidebar, stringifyDocsSidebar } from "../src/docs/docs-sidebar.ts"; -process.stdout.write(stringifyDocsSidebar(buildDocsSidebar(rootCommand))); +BunRuntime.runMain( + Effect.try(() => stringifyDocsSidebar(buildDocsSidebar(rootCommand))).pipe( + Effect.flatMap(Console.log), + ), +); diff --git a/apps/cli/scripts/generate-docs-spec.ts b/apps/cli/scripts/generate-docs-spec.ts index 286b4c9332..d194dcb0c3 100644 --- a/apps/cli/scripts/generate-docs-spec.ts +++ b/apps/cli/scripts/generate-docs-spec.ts @@ -12,6 +12,7 @@ import { Effect, Path } from "effect"; import process from "node:process"; import { readDocsContent } from "../src/docs/docs-spec.content.ts"; import { buildDocsSpec, stringifyDocsSpec } from "../src/docs/docs-spec.ts"; +import { buildDocsSidebar } from "../src/docs/docs-sidebar.ts"; import { rootCommand } from "../src/cli/root.ts"; function resolveVersion(): string { @@ -28,6 +29,9 @@ const content = await Effect.runPromise( ), ); +// The release publishes only the spec, so sidebar problems must fail it here. +buildDocsSidebar(rootCommand); + const spec = buildDocsSpec({ root: rootCommand, version: resolveVersion(), diff --git a/apps/cli/src/command-internal/command-sidebar.ts b/apps/cli/src/command-internal/command-sidebar.ts index 27c19dc516..9f9979b999 100644 --- a/apps/cli/src/command-internal/command-sidebar.ts +++ b/apps/cli/src/command-internal/command-sidebar.ts @@ -42,7 +42,7 @@ export type DocsSidebarCategory = (typeof DOCS_SIDEBAR_CATEGORIES)[number]["id"] */ export type CommandSidebar = | { readonly category: DocsSidebarCategory; readonly title?: string } - | { readonly title: string }; + | { readonly title: string; readonly category?: never }; export class CommandSidebarAnnotation extends Context.Service< CommandSidebarAnnotation, diff --git a/apps/cli/src/commands/db/db.command.ts b/apps/cli/src/commands/db/db.command.ts index 86d15f094e..8e31b6d3a9 100644 --- a/apps/cli/src/commands/db/db.command.ts +++ b/apps/cli/src/commands/db/db.command.ts @@ -15,7 +15,7 @@ import { dbRemoteCommand } from "./remote/remote.command.ts"; import { dbSchemaCommand } from "./schema/schema.command.ts"; export const dbCommand = Command.make("db").pipe( - withSidebar({ category: "database", title: "Manage local databases" }), + withSidebar({ category: "database" }), Command.withDescription("Manage Postgres databases."), Command.withShortDescription("Manage databases"), Command.withSubcommands([ diff --git a/apps/cli/src/commands/db/diff/diff.command.ts b/apps/cli/src/commands/db/diff/diff.command.ts index a499eb85ff..61f11e2155 100644 --- a/apps/cli/src/commands/db/diff/diff.command.ts +++ b/apps/cli/src/commands/db/diff/diff.command.ts @@ -1,4 +1,3 @@ -import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -117,7 +116,6 @@ const explicitBranchSide = (flag: "from" | "to") => }) as const; export const dbDiffCommand = Command.make("diff", config).pipe( - withSidebar({ title: "Diff local database" }), Command.withDescription( "Compares a shadow built from supabase/migrations with a live database (the local database by default, or the one --remote selects). Declarative files under supabase/schemas are not part of this baseline. Output is printed by default; in normal mode, -f names and saves the complete diff as a migration and does not filter objects. Explicit --from/--to output is flattened review SQL, not a portable apply script.", ), diff --git a/apps/cli/src/commands/db/dump/dump.command.ts b/apps/cli/src/commands/db/dump/dump.command.ts index 39263955a5..7c01983507 100644 --- a/apps/cli/src/commands/db/dump/dump.command.ts +++ b/apps/cli/src/commands/db/dump/dump.command.ts @@ -1,4 +1,3 @@ -import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -98,7 +97,6 @@ const config = { export type DbDumpFlags = CliCommand.Command.Config.Infer; export const dbDumpCommand = Command.make("dump", config).pipe( - withSidebar({ title: "Dump schema from remote database" }), Command.withDescription("Dumps data or schemas from a database."), Command.withShortDescription("Dumps data or schemas from a database"), Command.withExamples([ diff --git a/apps/cli/src/commands/db/pull/pull.command.ts b/apps/cli/src/commands/db/pull/pull.command.ts index bea069c916..2c8db65246 100644 --- a/apps/cli/src/commands/db/pull/pull.command.ts +++ b/apps/cli/src/commands/db/pull/pull.command.ts @@ -1,4 +1,3 @@ -import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { FlagDocumentation } from "../../../command-internal/flag-documentation.ts"; import { Effect, Layer, Option } from "effect"; import { Argument, Command, Flag } from "effect/cli"; @@ -100,7 +99,6 @@ const telemetryOptions = (flags: DbPullFlags) => ({ }); export const dbPullCommand = Command.make("pull", config).pipe( - withSidebar({ title: "Pull schema changes from remote database" }), Command.withDescription( "Migration mode compares supabase/migrations with the selected live database (the local database by default, or the one --remote selects), writes the complete difference as migration files, and records them in that database's migration history; a hosted database asks for confirmation first, or needs --yes in a non-interactive run. --declarative instead replaces the declarative schema tree and does not create migrations or update migration history.", ), diff --git a/apps/cli/src/commands/postgres-config/delete/delete.command.ts b/apps/cli/src/commands/postgres-config/delete/delete.command.ts index 6c53754fac..10988c3be9 100644 --- a/apps/cli/src/commands/postgres-config/delete/delete.command.ts +++ b/apps/cli/src/commands/postgres-config/delete/delete.command.ts @@ -1,4 +1,3 @@ -import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -43,7 +42,6 @@ const config = { export type PostgresConfigDeleteFlags = CliCommand.Command.Config.Infer; export const postgresConfigDeleteCommand = Command.make("delete", config).pipe( - withSidebar({ title: "Delete Postgres configurations" }), Command.withDescription("Delete specific Postgres database config overrides."), Command.withShortDescription("Delete Postgres database config overrides"), withPermissions( diff --git a/apps/cli/src/commands/start/start.command.ts b/apps/cli/src/commands/start/start.command.ts index 3326b58dd2..416f868d22 100644 --- a/apps/cli/src/commands/start/start.command.ts +++ b/apps/cli/src/commands/start/start.command.ts @@ -91,7 +91,7 @@ const startRuntimeLayer = Layer.mergeAll( ); export const startCommand = Command.make("start", config).pipe( - withSidebar({ category: "general", title: "Start a container" }), + withSidebar({ category: "general" }), Command.withDescription("Start containers for Supabase local development."), Command.withShortDescription("Start local Supabase stack"), withPermissions({ diff --git a/apps/cli/src/commands/stop/stop.command.ts b/apps/cli/src/commands/stop/stop.command.ts index 59d11634b5..996a7c94a9 100644 --- a/apps/cli/src/commands/stop/stop.command.ts +++ b/apps/cli/src/commands/stop/stop.command.ts @@ -53,7 +53,7 @@ const stopRuntimeLayer = Layer.mergeAll( ); export const stopCommand = Command.make("stop", config).pipe( - withSidebar({ category: "general", title: "Stop all containers" }), + withSidebar({ category: "general" }), Command.withDescription("Stop all local Supabase containers."), Command.withShortDescription("Stop all local Supabase containers"), Command.withExamples([ diff --git a/apps/cli/src/commands/storage/ls/ls.command.ts b/apps/cli/src/commands/storage/ls/ls.command.ts index 5092bdaf1d..32b6dc4e65 100644 --- a/apps/cli/src/commands/storage/ls/ls.command.ts +++ b/apps/cli/src/commands/storage/ls/ls.command.ts @@ -1,4 +1,3 @@ -import { withSidebar } from "../../../command-internal/command-sidebar.ts"; import { Effect } from "effect"; import { Argument, Command, Flag } from "effect/cli"; import type * as CliCommand from "effect/cli/Command"; @@ -30,7 +29,6 @@ const config = { export type StorageLsFlags = CliCommand.Command.Config.Infer; export const storageLsCommand = Command.make("ls", config).pipe( - withSidebar({ title: "Lists all Storage objects" }), Command.withDescription("List objects by path prefix."), Command.withShortDescription("List objects by path prefix"), Command.withExamples([ diff --git a/apps/cli/src/docs/docs-sidebar.ts b/apps/cli/src/docs/docs-sidebar.ts index 0599ef5d3c..caa821b441 100644 --- a/apps/cli/src/docs/docs-sidebar.ts +++ b/apps/cli/src/docs/docs-sidebar.ts @@ -67,7 +67,11 @@ export function buildDocsSidebar(root: Command.Command.Any): ReadonlyArray DOCS_SIDEBAR_TITLE_MAX_LENGTH) { + if (title.trim() === "") { + problems.push( + `"${id}" has an empty sidebar title: set withSidebar({ title }) or a short description.`, + ); + } else if (title.length > DOCS_SIDEBAR_TITLE_MAX_LENGTH) { problems.push( `"${id}" sidebar title is ${title.length} chars (max ${DOCS_SIDEBAR_TITLE_MAX_LENGTH}): set withSidebar({ title }) instead of changing the short description.`, ); @@ -105,5 +109,5 @@ export function buildDocsSidebar(root: Command.Command.Any): ReadonlyArray): string { - return `${JSON.stringify(sidebar, null, 2)}\n`; + return JSON.stringify(sidebar, null, 2); } diff --git a/apps/cli/src/docs/docs-sidebar.unit.test.ts b/apps/cli/src/docs/docs-sidebar.unit.test.ts index 3930c67174..3d3a5f39eb 100644 --- a/apps/cli/src/docs/docs-sidebar.unit.test.ts +++ b/apps/cli/src/docs/docs-sidebar.unit.test.ts @@ -136,6 +136,17 @@ describe("buildDocsSidebar", () => { expect(() => buildDocsSidebar(root)).toThrow(/"supabase-wordy" sidebar title is 51 chars/); }); + it("rejects a blank sidebar title", () => { + const root = Command.make("supabase").pipe( + Command.withSubcommands([ + ...categoryStubs("general"), + Command.make("blank").pipe(withSidebar({ category: "general", title: " " })), + ]), + ); + + expect(() => buildDocsSidebar(root)).toThrow(/"supabase-blank" has an empty sidebar title/); + }); + it("rejects an unused category", () => { const root = Command.make("supabase").pipe(Command.withSubcommands(categoryStubs("testing"))); diff --git a/apps/cli/src/docs/docs-spec.unit.test.ts b/apps/cli/src/docs/docs-spec.unit.test.ts index cc20c3fde2..9e5604bb5c 100644 --- a/apps/cli/src/docs/docs-spec.unit.test.ts +++ b/apps/cli/src/docs/docs-spec.unit.test.ts @@ -270,7 +270,7 @@ describe("buildDocsSpec", () => { expect(byId.get("supabase-issue")?.subcommands).toContain("supabase-issue-bug"); }); - it("includes the top-level whoami command in the Management API reference", () => { + it("includes the top-level whoami command with its usage and description", () => { const whoami = builtSpec().byId.get("supabase-whoami"); expect(whoami).toBeDefined(); expect(whoami?.usage).toBe("supabase whoami [flags]");