@schmadev/cli 1.0.0 → 1.0.2
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/.turbo/turbo-build.log +10 -0
- package/README.md +51 -0
- package/dist/index.js +2 -2
- package/package.json +11 -11
- package/src/commands/generate.ts +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
$ tsup
|
|
2
|
+
CLI Building entry: src/index.ts
|
|
3
|
+
CLI Using tsconfig: tsconfig.json
|
|
4
|
+
CLI tsup v8.5.1
|
|
5
|
+
CLI Using tsup config: /Users/balajim/Documents/Vibe-CMS/packages/cli/tsup.config.ts
|
|
6
|
+
CLI Target: es2022
|
|
7
|
+
CLI Cleaning output folder
|
|
8
|
+
ESM Build start
|
|
9
|
+
ESM dist/index.js 11.91 KB
|
|
10
|
+
ESM ⚡️ Build success in 32ms
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @schmadev/cli
|
|
2
|
+
|
|
3
|
+
The official command-line interface for [Schma](https://schma.dev).
|
|
4
|
+
|
|
5
|
+
Schma is the flexible headless CMS that lets you Bring Your Own Database (BYOD) and Bring Your Own AI Keys (BYOK). This CLI provides powerful tools to interact with your Schma workspaces directly from your terminal.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Normally, you run the CLI via `npx` or include it as a `devDependency` in your project.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -D @schmadev/cli
|
|
13
|
+
# or
|
|
14
|
+
pnpm add -D @schmadev/cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
### `generate`
|
|
20
|
+
Syncs your remote Schma content types down to your local codebase and generates strict TypeScript definitions. This ensures your SDK calls are completely type-safe.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @schmadev/cli generate
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### `login`
|
|
27
|
+
Authenticates your local development environment with your Schma account.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @schmadev/cli login
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### `link`
|
|
34
|
+
Links your current directory to a specific Schma workspace and generates the necessary configuration files.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @schmadev/cli link
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Setup
|
|
41
|
+
|
|
42
|
+
When running commands, the CLI expects a valid `.env` file containing your `SCHMA_API_KEY`, or it will prompt you to log in.
|
|
43
|
+
|
|
44
|
+
If you haven't started a project yet, we recommend using the initialization wizard instead:
|
|
45
|
+
```bash
|
|
46
|
+
npm create schma@latest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
For the full CLI reference, visit [docs.schma.dev](https://docs.schma.dev).
|
package/dist/index.js
CHANGED
|
@@ -170,9 +170,9 @@ async function generateCommand(options) {
|
|
|
170
170
|
process.exit(1);
|
|
171
171
|
}
|
|
172
172
|
console.log(pc2.cyan(`Fetching schemas for tenant '${tenantSlug}'...`));
|
|
173
|
-
const apiUrl = process.env.SCHMA_API_URL || projectConfig.apiUrl || "https://schma-
|
|
173
|
+
const apiUrl = process.env.SCHMA_API_URL || projectConfig.apiUrl || "https://schma-api-production.up.railway.app";
|
|
174
174
|
const client = createClient({
|
|
175
|
-
apiUrl,
|
|
175
|
+
baseUrl: apiUrl,
|
|
176
176
|
tenantSlug,
|
|
177
177
|
apiKey
|
|
178
178
|
});
|
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schmadev/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Schma Developer CLI",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"schma": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "vitest run",
|
|
12
|
+
"build": "tsup",
|
|
13
|
+
"dev": "tsup --watch",
|
|
14
|
+
"lint": "eslint \"src/**/*.ts*\"",
|
|
15
|
+
"clean": "rm -rf dist"
|
|
16
|
+
},
|
|
10
17
|
"dependencies": {
|
|
11
|
-
"@schmadev/client": "
|
|
18
|
+
"@schmadev/client": "workspace:*",
|
|
12
19
|
"commander": "^12.1.0",
|
|
13
20
|
"dotenv": "^16.4.5",
|
|
14
21
|
"gradient-string": "^3.0.0",
|
|
@@ -17,18 +24,11 @@
|
|
|
17
24
|
"zod": "^4.6.5"
|
|
18
25
|
},
|
|
19
26
|
"devDependencies": {
|
|
20
|
-
"@schmadev/typescript-config": "
|
|
27
|
+
"@schmadev/typescript-config": "workspace:*",
|
|
21
28
|
"@types/gradient-string": "^1.1.6",
|
|
22
29
|
"@types/node": "^20.14.9",
|
|
23
30
|
"@types/prompts": "^2.4.9",
|
|
24
31
|
"tsup": "^8.3.0",
|
|
25
32
|
"typescript": "^5.6.2"
|
|
26
|
-
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"test": "vitest run",
|
|
29
|
-
"build": "tsup",
|
|
30
|
-
"dev": "tsup --watch",
|
|
31
|
-
"lint": "eslint \"src/**/*.ts*\"",
|
|
32
|
-
"clean": "rm -rf dist"
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}
|
package/src/commands/generate.ts
CHANGED
|
@@ -54,10 +54,10 @@ export async function generateCommand(options: { tenant?: string, out: string })
|
|
|
54
54
|
|
|
55
55
|
console.log(pc.cyan(`Fetching schemas for tenant '${tenantSlug}'...`));
|
|
56
56
|
|
|
57
|
-
const apiUrl = process.env.SCHMA_API_URL || projectConfig.apiUrl || "https://schma-
|
|
57
|
+
const apiUrl = process.env.SCHMA_API_URL || projectConfig.apiUrl || "https://schma-api-production.up.railway.app";
|
|
58
58
|
|
|
59
59
|
const client = createClient({
|
|
60
|
-
apiUrl,
|
|
60
|
+
baseUrl: apiUrl,
|
|
61
61
|
tenantSlug,
|
|
62
62
|
apiKey,
|
|
63
63
|
});
|