Docs LATEST

CLI Commands

Using the command-line interface.

CLI

VelvetCMS includes a CLI tool for common tasks. Run commands from your project root.

Basic Usage #

./velvet <command> [options] [arguments]

List all commands:

./velvet list

Get help for a command:

./velvet help migrate
./velvet migrate --help

Common Commands #

Setup & Development #

./velvet install              # Bootstrap directories and sample content
./velvet serve                # Start development server
./velvet serve --port=8080    # Custom port

Database #

./velvet migrate              # Run pending migrations
./velvet migrate --force      # Run in production without confirmation

Cache & Config #

./velvet cache:clear          # Clear application cache
./velvet config:cache         # Cache configuration for production
./velvet config:clear         # Clear cached configuration
./velvet route:cache          # Cache routes for production
./velvet route:clear          # Clear cached routes

Modules #

./velvet module:list          # Show all modules
./velvet module:discover      # Rebuild module manifest

Scheduling #

./velvet schedule:run         # Run due scheduled tasks

Content #

./velvet page:list            # List all pages
./velvet page:make about      # Create a new page
./velvet page:publish about   # Publish a draft

Options Format #

Options use these formats:

--option=value    # Key-value
--flag            # Boolean flag
-f                # Short flag

Examples:

./velvet serve --host=0.0.0.0 --port=8000
./velvet page:make hello --title="Hello World" --status=draft
./velvet config:get app.debug
./velvet config:set app.debug false

Multi-Tenancy #

When working with tenants, set the tenant context:

TENANCY_TENANT=acme ./velvet cache:clear
TENANCY_TENANT=acme ./velvet migrate

Exit Codes #

Code Meaning
0 Success
1 General error
2 Invalid usage

Creating Custom Commands #

Generate a command scaffold:

./velvet make:command SendNewsletter

See Command List for all available commands.