@conloca/cli
v0.1.16
Published
Command-line interface for Conloca content management.
Readme
@conloca/cli
Command-line interface for Conloca content management.
Installation
npm install -g @conloca/cli
# or
bun add -g @conloca/cliUsage
Initialize Content Structure
Initialize a new Conloca content structure for a site:
conloca init <directory> <site>This command will:
- Create the content directory structure
- Create directories for the specified site
- Create or update the sites.json configuration file
- Set up the blocks/shared directory for shared components
Example:
conloca init . defaultAstro Integration
Set up Astro integration with Puck components and configuration:
conloca astro setup [path]This command will generate:
src/puck.config.tsx- Puck component configurationsrc/components/Layout.tsx- Layout HOC with grid/flex supportsrc/components/Section.tsx- Section wrapper componentsrc/components/puck/Heading.tsx- Heading componentsrc/components/puck/Text.tsx- Text componentsrc/components/puck/Flex.tsx- Flex layout componentsrc/components/puck/Grid.tsx- Grid layout componentsrc/schemas/data.ts- Example Zod schemas for data collections
Note: Routes are now handled automatically by the Astro plugin. Configure routing in your
astro.config.mjswithconlocaCMS({ routing: true }).
Examples:
# Set up in current directory
conloca astro setup
# Set up in a specific project
conloca astro setup ./my-astro-projectVerify Content
Verify content files in a directory, automatically repairing any files missing required fields:
conloca verify <directory>This command will:
- Check all content files in the specified directory
- Automatically repair files missing required fields (id, created, modified)
- Report any errors found
- Display a summary of verified content items
Quick Start
# 1. Create a new Astro project (if you don't have one)
npm create astro@latest my-site
cd my-site
# 2. Install Conloca packages
npm install @conloca/astro-cms @conloca/content-api @conloca/mdx @measured/puck
# 3. Initialize content structure
conloca init . default
# 4. Set up Astro integration (components + Puck config)
conloca astro setup
# 5. Configure routing in astro.config.mjs:
# import { conlocaCMS } from '@conloca/astro-cms';
# export default defineConfig({
# integrations: [conlocaCMS({ routing: true })]
# });
# 6. Start your dev server
npm run dev
# 7. Visit /__cms to edit pagesDevelopment
Building
bun run buildTesting
bun testThe CLI is bundled into a single executable file using Bun's build system.
