pecunia-cli 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Better Auth CLI
2
+
3
+ Better Auth comes with a built-in CLI to help you manage the database schema
4
+ needed for both core functionality and plugins.
5
+
6
+ ### **Init**
7
+
8
+ The CLI includes an `init` command to add Better Auth to your project.
9
+
10
+ ```bash title="terminal"
11
+ npx @better-auth/cli@latest init
12
+ ```
13
+
14
+ ### **Generate**
15
+
16
+ The `generate` command creates the schema required by Better Auth.
17
+ If you’re using a database adapter like Prisma or Drizzle, this command will
18
+ generate the right schema for your ORM.
19
+ If you’re using the built-in Kysely adapter, it will generate an SQL file you
20
+ can run directly on your database.
21
+
22
+ ```bash title="terminal"
23
+ npx @better-auth/cli@latest generate
24
+ ```
25
+
26
+ ### **Migrate**
27
+
28
+ The `migrate` command applies the Better Auth schema directly to your database.
29
+ This is available if you’re using the built-in Kysely adapter.
30
+ For other adapters, you’ll need to apply the schema using your ORM’s migration
31
+ tool.
32
+
33
+ ```bash title="terminal"
34
+ npx @better-auth/cli@latest migrate
35
+ ```
36
+
37
+ ### **Secret**
38
+
39
+ The CLI also provides a way to generate a secret key for your Better Auth
40
+ instance.
41
+
42
+ ```bash title="terminal"
43
+ npx @better-auth/cli@latest secret
44
+ ```
45
+
46
+ ## License
47
+
48
+ MIT
package/dist/api.d.mts ADDED
@@ -0,0 +1,43 @@
1
+ import { DBAdapter, DBAdapter as DBAdapter$1, PecuniaOptions } from "@pecunia/core";
2
+
3
+ //#region src/generators/types.d.ts
4
+ interface SchemaGeneratorResult {
5
+ code?: string;
6
+ fileName: string;
7
+ overwrite?: boolean;
8
+ append?: boolean;
9
+ }
10
+ interface SchemaGenerator {
11
+ <Options extends PecuniaOptions>(opts: {
12
+ file?: string;
13
+ adapter: DBAdapter$1;
14
+ options: Options;
15
+ }): Promise<SchemaGeneratorResult>;
16
+ }
17
+ //#endregion
18
+ //#region src/generators/index.d.ts
19
+ declare const adapters: {
20
+ prisma: SchemaGenerator;
21
+ drizzle: SchemaGenerator;
22
+ kysely: SchemaGenerator;
23
+ };
24
+ declare const generateSchema: (opts: {
25
+ adapter: DBAdapter$1;
26
+ file?: string;
27
+ options: PecuniaOptions;
28
+ }) => Promise<SchemaGeneratorResult | {
29
+ code: string;
30
+ fileName: string;
31
+ overwrite: boolean | undefined;
32
+ }>;
33
+ //#endregion
34
+ //#region src/generators/drizzle.d.ts
35
+ declare const generateDrizzleSchema: SchemaGenerator;
36
+ //#endregion
37
+ //#region src/generators/kysely.d.ts
38
+ declare const generateKyselySchema: SchemaGenerator;
39
+ //#endregion
40
+ //#region src/generators/prisma.d.ts
41
+ declare const generatePrismaSchema: SchemaGenerator;
42
+ //#endregion
43
+ export { type DBAdapter, type SchemaGenerator, type SchemaGeneratorResult, adapters, generateDrizzleSchema, generateKyselySchema, generatePrismaSchema, generateSchema };
package/dist/api.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { a as generateKyselySchema, n as generateSchema, o as generateDrizzleSchema, r as generatePrismaSchema, t as adapters } from "./generators-xnsg6Fwk.mjs";
2
+
3
+ export { adapters, generateDrizzleSchema, generateKyselySchema, generatePrismaSchema, generateSchema };