Overview
The VexBlocks CLI is a powerful tool that helps you scaffold, manage, and upgrade your VexBlocks CMS projects. It handles everything from initial setup to package management and updates.
Installation
The CLI is distributed via npm and can be run using npx without installation:
npx @vexblocks/cli [command]Or install it globally for frequent use:
npm install -g @vexblocks/cliNote: We recommend using npx to always use the latest version.
Available Commands
init
Initialize a new VexBlocks project with Turborepo structure
npx @vexblocks/cli initadd
Add VexBlocks packages (CMS, backend, shared utilities) to your project
npx @vexblocks/cli add [package]upgrade
Upgrade VexBlocks packages to the latest version
npx @vexblocks/cli upgradediff
Compare your local packages with the latest version from the repository
npx @vexblocks/cli diffGlobal Options
All commands support the following global options:
| Option | Description |
|---|---|
--yes, -y | Skip all prompts and use default values |
--cwd | Set the working directory for the command |
--help, -h | Display help for the command |
Project Structure
VexBlocks projects follow a Turborepo monorepo structure:
my-project/
├── apps/
│ └── cms/ # CMS Dashboard (Next.js)
├── packages/
│ ├── backend/ # Convex backend
│ ├── cms-shared/ # Shared utilities & types
│ └── type-generator/ # Type generation tool
├── package.json
├── turbo.json
└── vexblocks.json # VexBlocks manifestManifest File
The vexblocks.json file tracks installed packages and versions:
{
"version": "1.0.0",
"packages": {
"cms": {
"version": "1.0.0",
"installedAt": "2024-01-15T10:30:00.000Z",
"path": "apps/cms"
},
"backend": {
"version": "1.0.0",
"installedAt": "2024-01-15T10:30:00.000Z",
"path": "packages/backend"
}
}
}Important: Some files are protected and won't be overwritten during upgrades:
packages/backend/vexblocks.config.tspackages/backend/.envpackages/cms-shared/src/types/generated.ts