You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commands can be called in the terminal of your choice in the format of:
3
+
Commands to control and report on many of the core operations of ExpressionEngine can be issued via the terminal of your choice in the format of:
4
4
5
-
`$ php system/ee/eecli.php hello`
5
+
`$ php system/ee/eecli.php version`
6
6
7
-
This will call `eecli` with a command of `hello`. This is the Hello World of ExpressionEngine commands, and will display:
7
+
Assuming you're in the directory that contains the system folder, this will have `php` use ExpressionEngine's Command Line Interface tool, `eecli`, to run the `version` command.
8
8
9
-
`Hello world`
10
-
11
-
Commands can also request confirmation:
9
+
This is the most basic of ExpressionEngine commands, and will display something similar to:
12
10
13
11
```
14
-
$ php system/ee/eecli.php hello -c
15
-
16
-
Hello world
17
-
Are you liking these questions? (yes/no) [no]
18
-
yes
19
-
That's good to hear!
12
+
ExpressionEngine Version: 7.5.25
13
+
Build: 20260623
14
+
PHP Version: 8.2.32
20
15
```
16
+
You may also be able to use the CLI with PHP implied. Command line usage is a broad topic, and the details of your system may vary.
21
17
22
-
Commands are also able to take interaction:
18
+
`$ ./system/ee/eecli.php version`
23
19
24
-
```
25
-
$ php system/ee/eecli.php hello -i
20
+
Commands can be interactive and ask you questions as they run. For example, this command will walk you through setting up the files and framework for a custom EE add-on:
26
21
27
-
Hello world
28
-
What's your name? Andy
29
-
Pleasure to meet you, Andy!
30
22
```
23
+
$ php system/ee/eecli.php make:addon
31
24
32
-
WARN: **Important:** The CLI is available to every user that has SSH or terminal access to your site's webserver. It does not handle authorization inside ExpressionEngine and is relying on your server's authorization method instead.
33
-
34
-
If you want to disable CLI globally, it can be done by setting `cli_enabled`[configuration override](general/system-configuration-overrides.md#cli_enabled) to `n`.
25
+
Let's build your add-on!
26
+
What is the name of your add-on?
27
+
etc.
28
+
```
35
29
36
30
## List All Commands
37
31
38
-
To view a list of all available commands, you may use the list command:
32
+
To view a list of all available commands, use the list command:
39
33
40
34
`php system/ee/eecli.php list`
41
35
@@ -44,41 +38,56 @@ This will return a basic list of all available system and user-generated command
| addons:install | Installs add-on and all its components |
46
+
| backup:database | Backup the database |
47
+
| channels:list | Lists all channels in the system |
52
48
| cache:clear | Clears all ExpressionEngine caches |
49
+
| config:config | Updates config values in config.php file |
53
50
...
54
51
```
55
52
53
+
## Command Line Security
54
+
55
+
WARN: **Important:** Unless disabled, the CLI is enabled by default and available to any person who has SSH or terminal access to your site's web server and who can run PHP scripts. The CLI does not handle authorization using ExpressionEngine's member system. It relies entirely on your server's authorization methods and simply treats a CLI user as a generic superuser.
56
+
57
+
EE is available via the CLI even when EE is set to offline mode -- this mirrors a superadmin's access permissions in the control panel and makes it possible to perform maintenance and upgrades when a site is offline.
58
+
59
+
If you want to disable CLI globally, this can be done by setting `cli_enabled`[configuration override](general/system-configuration-overrides.md#cli_enabled) to `n` or by running the following command:
(This would be a poor choice of command to use to test the CLI.)
64
+
65
+
You can also enable and disable the CLI from [Security & Privacy Settings](control-panel/settings/security-privacy.md#enable-the-command-line-interface) in the Control Panel.
66
+
56
67
## Get Help
57
68
58
-
You can get help information on any command by using the `--help` or `-h` parameter when running the command.
69
+
You can get help information for any command by using the `--help` or `-h` parameter
59
70
60
71
```
61
-
$ php system/ee/eecli.php hello -h
72
+
$ php system/ee/eecli.php config:config -h
62
73
63
74
SUMMARY
64
-
Hello World -- This is a sample command used to test the CLI
75
+
Update Config Values -- Gives the ability to update config values
65
76
66
77
USAGE
67
-
Hello World php eecli.php hello
78
+
Update Config Values php eecli.php config:config -c is_system_on -v n
68
79
69
80
DESCRIPTION
70
-
The most basic of commands
81
+
Updates config values in config.php file
71
82
72
83
OPTIONS
73
-
--verbose
74
-
-v
75
-
Hello world, but longer
76
-
77
-
--interactive
78
-
-i
79
-
Let's interact!
84
+
--config-variable=<value>
85
+
-c <value>
86
+
The config item to modify
80
87
81
-
--confirm
82
-
-c
83
-
Test the confirmation
88
+
--value=<value>
89
+
-v <value>
90
+
The value to set the config item to
84
91
```
92
+
93
+
Additional details may also be available here in the ExpressionEngine Docs or on the add-on developer's website.
0 commit comments