Usage
npx @vexblocks/cli init [options]Description
The init command creates a new VexBlocks project with a complete Turborepo monorepo structure. It sets up all necessary configuration files and prepares your project for development.
What It Does
Running this command will:
- Detect if you're in an existing Turborepo project
- Create a new project directory (if creating a new project)
- Set up the monorepo structure with apps and packages folders
- Generate configuration files (
package.json,turbo.json,pnpm-workspace.yaml) - Create a
vexblocks.jsonmanifest file - Set up environment variable templates
Interactive Setup
When you run init, you'll be guided through an interactive setup:
Choose Project Type
Select whether to create a new Turborepo project or add VexBlocks to an existing one.
If the CLI detects an existing turbo.json file, it will automatically skip to initializing in the current directory.
Enter Project Name
If creating a new project, you'll be prompted for a project name. The name must contain only lowercase letters, numbers, hyphens, and underscores.
Confirm Setup
Review the setup and confirm to proceed. The CLI will create all necessary files and directories.
Options
| Option | Type | Description |
|---|---|---|
--yes, -y | boolean | Skip all prompts and use defaults |
--cwd | string | Working directory for the command |
Examples
Create a New Project
npx @vexblocks/cli initThis will prompt you to create a new Turborepo project.
Initialize in Current Directory
If you already have a Turborepo project, navigate to its root and run:
npx @vexblocks/cli initSkip All Prompts
npx @vexblocks/cli init --yesGenerated Structure
After initialization, your project will have this structure:
my-vexblocks-project/
├── apps/ # Application packages
├── packages/ # Shared packages
├── .gitignore
├── .env.example # Environment variables template
├── package.json # Root package.json
├── pnpm-workspace.yaml # pnpm workspace config
├── turbo.json # Turborepo configuration
└── vexblocks.json # VexBlocks manifestEnvironment Variables
The CLI creates an .env.example file with all required environment variables:
# Convex
CONVEX_DEPLOYMENT=
NEXT_PUBLIC_CONVEX_URL=
# Better Auth
SITE_URL=http://localhost:3001
# Cloudflare Images (optional)
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_SECRET_TOKEN=
# Revalidation (optional)
REVALIDATE_SECRET=
FRONTEND_URL=http://localhost:3000Important: Copy .env.example to .env.local and fill in your actual values before running the project.
Next Steps
After initialization, you should:
- Navigate to your project directory:
cd my-vexblocks-project - Install dependencies:
pnpm install - Add VexBlocks packages:
npx @vexblocks/cli add all - Set up your Convex project
- Start development:
pnpm dev