Skip to content

Commit f377e77

Browse files
authored
Merge pull request #1159 from nep/patch-13
Revise CLI usage documentation to remove `hello`
2 parents 64d8883 + 718677e commit f377e77

1 file changed

Lines changed: 48 additions & 39 deletions

File tree

docs/cli/usage.md

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
11
# CLI Usage
22

3-
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:
44

5-
`$ php system/ee/eecli.php hello`
5+
`$ php system/ee/eecli.php version`
66

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.
88

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:
1210

1311
```
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
2015
```
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.
2117

22-
Commands are also able to take interaction:
18+
`$ ./system/ee/eecli.php version`
2319

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:
2621

27-
Hello world
28-
What's your name? Andy
29-
Pleasure to meet you, Andy!
3022
```
23+
$ php system/ee/eecli.php make:addon
3124
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+
```
3529

3630
## List All Commands
3731

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:
3933

4034
`php system/ee/eecli.php list`
4135

@@ -44,41 +38,56 @@ This will return a basic list of all available system and user-generated command
4438
```
4539
$ php system/ee/eecli.php list
4640
41+
------------------------------------------------------------------
4742
| Command | Description |
4843
------------------------------------------------------------------
49-
| hello | The most basic of commands |
5044
| list | Lists all available commands |
51-
| update | Updates ExpressionEngine |
45+
| addons:install | Installs add-on and all its components |
46+
| backup:database | Backup the database |
47+
| channels:list | Lists all channels in the system |
5248
| cache:clear | Clears all ExpressionEngine caches |
49+
| config:config | Updates config values in config.php file |
5350
...
5451
```
5552

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:
60+
61+
`$ php eecli.php config:config -c cli_enabled -v n`
62+
63+
(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+
5667
## Get Help
5768

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
5970

6071
```
61-
$ php system/ee/eecli.php hello -h
72+
$ php system/ee/eecli.php config:config -h
6273
6374
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
6576
6677
USAGE
67-
Hello World php eecli.php hello
78+
Update Config Values php eecli.php config:config -c is_system_on -v n
6879
6980
DESCRIPTION
70-
The most basic of commands
81+
Updates config values in config.php file
7182
7283
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
8087
81-
--confirm
82-
-c
83-
Test the confirmation
88+
--value=<value>
89+
-v <value>
90+
The value to set the config item to
8491
```
92+
93+
Additional details may also be available here in the ExpressionEngine Docs or on the add-on developer's website.

0 commit comments

Comments
 (0)