Console command / Introduction
Bolt provides a powerful command line tool, based on the Symfony Console component.
Note: The bin/console
command is
merely a convenient tool for those that do prefer the command line. Its use is
not required for normal use.
Console is usually located at {site root}/bin/console
, and can be executed using your
PHP binary, for example to execute the cache:clear
Console command:
If you are familiar with working on the command line, you can perform tasks like 'clearing the cache' or 'updating the database' without having to use Bolt's web interface.
Basics¶
The command¶
Typing out a Console command is best done following this pattern:
Options and Arguments¶
Values passed to either can be required, a single value, or several values separated by a space character.
Options are the parameters that are suffixed with --
, e.g. --help
. Unlike
argument, options can also not contain a user supplied value.
Some example of how an example:command
command line would be built to be
executed by Console:
Default options¶
Console commands all have the following set of options that you can add to your command line:
The --help
option will give contextual help text, and is the most useful for
learning, or refreshing you memory on, command use.
For example, to see Console's base help:
Alternatively, to get the help text for the cache:clear
Console command:
Note: If for any reason Console generates an
exception when running, you can re-run the command with the -vvv
option to generate a backtrace to assist in finding the root cause of the
problem.
Available commands¶
To see a list of available commands for a given Bolt installation, simply run Console without any parameters:
Current List¶
Adding your own Console command¶
Bolt enables you to extend Console, and add your own command, via a Bolt extension, see the Console Console Commands section of the extension documentation for more information.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.