forked from supabase/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.command.ts
More file actions
42 lines (40 loc) · 1.68 KB
/
Copy pathinit.command.ts
File metadata and controls
42 lines (40 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { BunServices } from "@effect/platform-bun";
import { Command, Flag } from "effect/unstable/cli";
import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts";
import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts";
import { withCommandInstrumentation } from "../../../shared/telemetry/command-instrumentation.ts";
import { init } from "./init.handler.ts";
const config = {
interactive: Flag.boolean("interactive").pipe(
Flag.withDescription("Enables interactive mode to configure IDE settings."),
Flag.withAlias("i"),
),
experimental: Flag.boolean("experimental").pipe(Flag.withHidden),
useOrioledb: Flag.boolean("use-orioledb").pipe(
Flag.withDescription("Use OrioleDB storage engine for Postgres."),
),
force: Flag.boolean("force").pipe(
Flag.withDescription("Overwrite existing supabase/config.toml."),
),
} as const;
export const initCommand = Command.make("init", config).pipe(
Command.withDescription(
"Initialize a local Supabase project.\n\nCreates supabase/config.toml, supabase/.gitignore, and optionally IDE settings for local development.",
),
Command.withShortDescription("Initialize local Supabase project"),
Command.withExamples([
{
command: "supabase init",
description: "Create a Supabase project scaffold in the current directory",
},
{
command: "supabase init --force",
description: "Overwrite an existing local Supabase config",
},
]),
Command.withHandler((flags) =>
init(flags).pipe(withCommandInstrumentation({ flags }), withJsonErrorHandling),
),
Command.provide(commandRuntimeLayer(["init"])),
Command.provide(BunServices.layer),
);