@content-workers/cli
v1.0.1
Published
Content Workers CLI - Command line interface for Content Workers CMS
Maintainers
Readme
@content-workers/cli
Standalone CLI for Content Workers CMS - a lightweight command-line interface that doesn't require installing the full core package.
Installation
Global Installation
npm install -g @content-workers/cliUse with npx (no installation required)
npx @content-workers/cli devUsage
The CLI provides essential commands for Content Workers projects:
# Start development server
cw dev
# Build for production
cw build
# Serve production build
cw serve
# Run database migrations
cw migrateCommands
cw dev
Start the development server with hot reload.
Options:
-p, --port <port>- Port to run the server on (default: 6545)-h, --host <host>- Host to bind the server to (default: localhost)
cw build
Build the application for production.
Options:
--no-minify- Disable minification
cw serve
Serve the production build.
Options:
-p, --port <port>- Port to run the server on (default: 6545)-h, --host <host>- Host to bind the server to (default: localhost)
cw migrate
Run database migrations.
Options:
--rollback- Rollback the last migration--reset- Reset all migrations--fresh- Drop all tables and re-run migrations
Dependencies
The CLI automatically checks for required dependencies and provides helpful installation instructions if they're missing:
Required for all commands:
@content-workers/core- Main CMS engine
Required for development/production:
@content-workers/node-adapter- Node.js runtime adapter
Required for migrations:
- A database adapter:
@content-workers/sqlite-adapter(recommended for development)@content-workers/postgres-adapter(recommended for production)@content-workers/libsql-adapter(for Turso/LibSQL)
Configuration
The CLI looks for configuration files in this order:
cw.config.tscw.config.jscw.config.mjs
Example Setup
# Install CLI globally
npm install -g @content-workers/cli
# Create new project directory
mkdir my-cms && cd my-cms
# Install core dependencies
npm install @content-workers/core @content-workers/node-adapter @content-workers/sqlite-adapter
# Create configuration file
# (see Content Workers documentation for config examples)
# Start development
cw devvs @content-workers/core
| Package | Size | Use Case |
|---------|------|----------|
| @content-workers/cli | ~120KB | Just need CLI commands |
| @content-workers/core | ~2MB+ | Full CMS engine + CLI |
Choose @content-workers/cli if you:
- Only need CLI functionality
- Want faster installation
- Are building deployment scripts
- Prefer minimal dependencies
Choose @content-workers/core if you:
- Need the full CMS engine
- Are building plugins or extensions
- Want everything in one package
License
BSL-1.0 (Business Source License)
