@vexblocks/cli 1.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,199 @@
1
+ # VexBlocks CLI
2
+
3
+ A command-line tool for adding **VexBlocks Headless CMS** to your Turborepo project.
4
+
5
+ Similar to Shadcn, VexBlocks CLI copies source files into your project, giving you full ownership while allowing managed updates.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ # Using npx (recommended)
11
+ npx @vexblocks/cli init
12
+
13
+ # Or install globally
14
+ npm install -g @vexblocks/cli
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # 1. Initialize a new project
21
+ npx @vexblocks/cli init
22
+
23
+ # 2. Add all CMS packages
24
+ npx @vexblocks/cli add all
25
+
26
+ # 3. Install dependencies
27
+ pnpm install
28
+
29
+ # 4. Set up Convex
30
+ cd packages/backend && npx convex dev
31
+
32
+ # 5. Start development
33
+ pnpm dev
34
+ ```
35
+
36
+ ## Commands
37
+
38
+ ### `vexblocks init`
39
+
40
+ Initialize a new VexBlocks project or add VexBlocks to an existing Turborepo.
41
+
42
+ ```bash
43
+ npx @vexblocks/cli init
44
+ npx @vexblocks/cli init --cwd ./my-project
45
+ ```
46
+
47
+ ### `vexblocks add`
48
+
49
+ Add VexBlocks packages to your project.
50
+
51
+ ```bash
52
+ # Add all packages
53
+ npx @vexblocks/cli add all
54
+
55
+ # Add specific packages
56
+ npx @vexblocks/cli add cms
57
+ npx @vexblocks/cli add backend shared
58
+
59
+ # Skip confirmation prompts
60
+ npx @vexblocks/cli add all --yes
61
+
62
+ # Overwrite existing files
63
+ npx @vexblocks/cli add cms --overwrite
64
+ ```
65
+
66
+ **Available packages:**
67
+
68
+ | Package | Description | Path |
69
+ | --------- | ---------------------------------------------- | ------------------------- |
70
+ | `cms` | CMS Dashboard (Next.js admin interface) | `apps/cms` |
71
+ | `backend` | Convex backend with CMS functions | `packages/backend` |
72
+ | `shared` | Shared utilities and preview SDK | `packages/cms-shared` |
73
+ | `types` | TypeScript type generator | `packages/type-generator` |
74
+ | `all` | All packages | - |
75
+
76
+ ### `vexblocks upgrade`
77
+
78
+ Upgrade VexBlocks packages to the latest version.
79
+
80
+ ```bash
81
+ # Check for updates
82
+ npx @vexblocks/cli upgrade --check
83
+
84
+ # Upgrade all packages
85
+ npx @vexblocks/cli upgrade
86
+
87
+ # Upgrade specific package
88
+ npx @vexblocks/cli upgrade cms
89
+
90
+ # Force upgrade (skip conflict detection)
91
+ npx @vexblocks/cli upgrade --force
92
+ ```
93
+
94
+ ### `vexblocks diff`
95
+
96
+ Show differences between local files and the latest version.
97
+
98
+ ```bash
99
+ npx @vexblocks/cli diff cms
100
+ npx @vexblocks/cli diff backend
101
+ ```
102
+
103
+ ## Project Structure
104
+
105
+ After running `vexblocks add all`, your project will have:
106
+
107
+ ```
108
+ your-project/
109
+ ├── apps/
110
+ │ └── cms/ # CMS Dashboard (managed)
111
+ │ ├── app/
112
+ │ ├── components/
113
+ │ └── lib/
114
+ ├── packages/
115
+ │ ├── backend/ # Convex Backend
116
+ │ │ ├── convex/
117
+ │ │ │ ├── cms/ # CMS functions (managed)
118
+ │ │ │ └── schema.cms.ts # CMS schema tables
119
+ │ │ └── better-auth/
120
+ │ ├── cms-shared/ # Shared utilities (managed)
121
+ │ └── type-generator/ # Type generator (managed)
122
+ ├── turbo.json
123
+ ├── vexblocks.json # VexBlocks manifest
124
+ └── package.json
125
+ ```
126
+
127
+ ## Managed Packages
128
+
129
+ The following packages are **managed** by VexBlocks and shouldn't be edited:
130
+
131
+ - `apps/cms` - CMS Dashboard
132
+ - `packages/cms-shared` - Shared utilities
133
+ - `packages/type-generator` - Type generator
134
+
135
+ These packages will be overwritten on upgrade. If you need to customize them:
136
+
137
+ 1. Use the extension points provided (components, hooks)
138
+ 2. Fork the package and manage it yourself
139
+
140
+ ## Environment Variables
141
+
142
+ ### Required
143
+
144
+ ```bash
145
+ # Convex
146
+ CONVEX_DEPLOYMENT=your-deployment
147
+ NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud
148
+
149
+ # Better Auth
150
+ SITE_URL=http://localhost:3001
151
+ ```
152
+
153
+ ### Optional (for media library)
154
+
155
+ ```bash
156
+ # Cloudflare Images
157
+ CLOUDFLARE_ACCOUNT_ID=your-account-id
158
+ CLOUDFLARE_SECRET_TOKEN=your-api-token
159
+
160
+ # ISR Revalidation
161
+ REVALIDATE_SECRET=your-secret
162
+ FRONTEND_URL=http://localhost:3000
163
+ ```
164
+
165
+ ## Existing Convex Projects
166
+
167
+ If you already have a Convex project with a `schema.ts`:
168
+
169
+ 1. Run `npx @vexblocks/cli add backend`
170
+ 2. The CLI will:
171
+ - Create a backup of your schema
172
+ - Add `schema.cms.ts` with CMS tables
173
+ - Add instructions for merging
174
+
175
+ 3. Update your `schema.ts`:
176
+
177
+ ```typescript
178
+ import { defineSchema } from "convex/server"
179
+ import { cmsSchemaExports } from "./schema.cms"
180
+
181
+ export default defineSchema({
182
+ // Your existing tables
183
+ products,
184
+ orders,
185
+
186
+ // VexBlocks CMS tables
187
+ ...cmsSchemaExports,
188
+ })
189
+ ```
190
+
191
+ ## Documentation
192
+
193
+ - [VexBlocks Documentation](https://vexblocks.dev/docs)
194
+ - [CMS Usage Guide](./CMS_USAGE_GUIDE.md)
195
+ - [API Reference](https://vexblocks.dev/docs/api)
196
+
197
+ ## License
198
+
199
+ MIT
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node