Skip to main content
Version: 2.0.0

Native Commands

Craft CMS includes a variety of native commands to help you manage your site. Below is a list of some commonly used native Craft CMS console commands.

Running Migrations

To apply database migrations:

php craft migrate/all

To create a new migration:

php craft migrate/create <migration_name>

Clearing Caches

To clear all caches:

php craft clear-caches/all

To clear a specific cache (e.g., template caches):

php craft clear-caches/template

Managing Users

To create a new user:

php craft users/create <username> <email> <password>

To activate a user:

php craft users/activate <user_id>

Managing Plugins

To install a plugin:

php craft plugin/install <plugin_handle>

To uninstall a plugin:

php craft plugin/uninstall <plugin_handle>

Project Configuration

To sync project config changes:

php craft project-config/sync

To export the current project config:

php craft project-config/write

For more details on each command, you can always run:

php craft help <command>

This will provide you with information on how to use the command and what options are available.