Directus Command-Line Interface (CLI) provides commands that allow you to perform various tasks such as installation, resetting a user's email, or upgrading the database to the most recent Directus schema.
You can use the help
command at any time to learn about available CLI actions:
# this will provide information about the current modules
php bin/directus help
To get more information on an specific command you can type "help" followed by the command:
# this provide information about the **install** module
php bin/directus help install
Includes commands to install and configure Directus.
Creates the config.php
and configuration.php
files.
IMPORTANT: This command will overwrite any existing
config.php
andconfiguration.php
files.
php bin/directus install:config -h <db_host> -n <db_name> -u <db_user> -p <db_pass> -d <directus_path>
db_host
- The database hostdb_name
- The database name (it must already exist)db_user
- The database user's namedb_pass
- The database user's passworddirectus_path
- (Optional) The Directus path inside the host. If Directus is installed within a subdirectory of the main host, that subdirectory is the <directus_path>.
Example: http://example.local
php bin/directus install:config -h localhost -n directus -u root -p pass
Example: http://example.local/directus
php bin/directus install:config -h localhost -n directus -u root -p pass -d directus
Creates all of the Directus Core tables based on the configuration files: /api/config.php
and /api/configuration.php
.
php bin/directus install:database
Create the default admin user and the site's default settings.
php bin/directus install:install -e <admin_email> -p <admin_password> -t <site_name>
admin_email
- The admin emailadmin_password
- The admin passwordsite_name
- The project title
Example:
php bin/directus install:install -e [email protected] -p password -t "Directus Example"
Includes commands to manage Directus users
php bin/directus user:password -e <user_email> -p <new_password>
user_email
- The user's emailnew_password
- The user's new password
Example:
php bin/directus user:password -e [email protected] -p newpassword
Includes commands to manage Directus languages files
php bin/directus language:diff