@conloca/cli
Overview
@conloca/cli provides command-line tools for managing Conloca content. Use it to initialize content directory
structures, scaffold Astro integration files, and verify content integrity.
Installation
bun add -g @conloca/cli
Or run without installing:
bunx @conloca/cli --help
Commands
conloca init
Initialize a new Conloca content structure inside a project directory.
conloca init <directory> <site>
Arguments:
| Argument | Description |
|---|---|
directory | Path to the project directory where content/ should be created |
site | Site name (e.g., default, blog) |
What it creates inside <directory>:
content/content/<site>/pages/content/blocks/shared/content/sites.json
Note:
conloca initalways creates acontent/directory inside the path you pass. If you runconloca init ./content default, the result will be./content/content/....
Example:
# Initialize content in current directory for 'default' site
conloca init . default
# Initialize content in a specific project directory for 'blog' site
conloca init ./my-astro-project blog
conloca verify
Verify content files in an existing Conloca content/ directory and auto-repair missing required fields.
conloca verify <directory>
Arguments:
| Argument | Description |
|---|---|
directory | Path to the content/ directory to verify |
What it does:
- Scans all VXJSON and MDX content files
- Checks for required fields (
id,created,modified) - Auto-repairs files with missing fields
- Reports errors and displays a summary
Example:
conloca verify ./content
conloca astro setup
Scaffold Astro integration files for a Conloca CMS project.
conloca astro setup [path]
Arguments:
| Argument | Description | Default |
|---|---|---|
path | Astro project directory | . (current directory) |
Options:
| Flag | Description | Default |
|---|---|---|
-s, --site <name> | Target site name | default |
Note: The
--siteflag is accepted but silently ignored.conloca astro setupalways configures thedefaultsite.
What it generates:
| File | Purpose |
|---|---|
src/puck.config.tsx | Puck component configuration with starter components |
src/components/Layout.tsx | Layout component with grid/flex support |
src/components/Section.tsx | Section wrapper component |
src/components/puck/HeadingComponent.tsx | Heading render component |
src/components/puck/Heading.tsx | Heading Puck config |
src/components/puck/TextComponent.tsx | Text render component |
src/components/puck/Text.tsx | Text Puck config |
src/components/puck/Flex.tsx | Flex layout Puck component |
src/components/puck/Grid.tsx | Grid layout Puck component |
src/schemas/data.ts | Example Zod schemas for data collections |
Examples:
# Set up in current directory
conloca astro setup
# Set up in a specific project
conloca astro setup ./my-astro-project
# Set up for a specific site
conloca astro setup ./my-astro-project --site blog
Global Options
| Flag | Short | Description |
|---|---|---|
--help | -h | Show help message |
--site <name> | -s | Target site name (default: default) |
Note: For
conloca astro setup, the--siteflag is accepted but silently ignored — the command always configures thedefaultsite.
Quick Start
# 1. Create a new Astro project
bun create astro@latest my-site
cd my-site
# 2. Install Conloca packages
bun add @conloca/astro-cms
# 3. Initialize content structure
bunx @conloca/cli init . default
# 4. Scaffold Astro integration
bunx @conloca/cli astro setup
# 5. Add conlocaCMS to astro.config.mjs (see @conloca/astro-cms docs)
# 6. Start development
bun run dev
# 7. Open /__cms in your browser