Skip to content

Commit a50fd2f

Browse files
committed
Merge pull request #49 from VSEphpbb/cli-docs
Add documentation for Command Line Interface
2 parents 3b59578 + 35b4745 commit a50fd2f

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
===============
2+
Getting started
3+
===============
4+
5+
The command line interface (CLI) is a useful utility for phpBB administrators who have access to a shell (or SSH) on the server they run phpBB on, as well as for extension developers. It provides CLI commands for managing config values, extensions, running database migration, purging the cache, and more.
6+
7+
Most operating systems ship with a built in command line application. For Mac OS and Ubuntu it is called "Terminal" and for Windows it is called "Command Prompt". Third party software such as `PuTTY <http://www.putty.org>`_ and `iTerm <https://www.iterm2.com>`_ can also be used.
8+
9+
To use phpBB's CLI on a web server, you will need SSH access to your web server. You can find out from your web hosting company if they offer SSH access and how to log into your web server from the CLI.
10+
11+
Once you have accessed your web server via SSH, or if you are in a localhost development environment, you simply need to navigate to your phpBB forum directory via the ``cd`` command:
12+
13+
.. code-block:: console
14+
15+
$ cd path/to/phpBB
16+
17+
From there, issuing commands is simply a matter of calling phpBB's CLI application.
18+
19+
.. code-block:: console
20+
21+
$ php bin/phpbbcli.php
22+
23+
*If everything is working correctly, the above command should output information about the currently installed phpBB CLI console. If you receive an error message, make sure you have navigated into the root directory of your forum.*
24+
25+
General commands
26+
================
27+
28+
The ``list`` command will show a list of all available commands available for phpBB's CLI.
29+
30+
.. code-block:: console
31+
32+
$ php bin/phpbbcli.php list
33+
34+
The ``help`` command will display general help for using phpBB's CLI.
35+
36+
.. code-block:: console
37+
38+
$ php bin/phpbbcli.php help
39+
40+
Using commands
41+
==============
42+
43+
All phpBB commands (as described when running the ``list`` command) have integrated help documentation available within the CLI. Use the ``--help`` or ``-h`` option with any of phpBB's CLI commands to view detailed help for that command.
44+
45+
.. code-block:: console
46+
47+
$ php bin/phpbbcli.php config:set --help
48+
49+
The above command will display information about the arguments and options that can be used with the specified command, in this example ``config:set``. For example, the above command will output:
50+
51+
.. code-block:: console
52+
53+
Usage:
54+
config:set [-d|--dynamic] key value
55+
56+
Arguments or options shown inside of brackets indicates that they are optional to use. This shows us that the ``key`` and ``value`` arguments are required. However, the ``-d`` or ``--dynamic`` options available for this command are optional. Also note that ``-d`` is shorthand for ``--dynamic``. Most options have a shorthand equivalent.
57+
58+
General options
59+
===============
60+
61+
Common options that can be used with any of phpBB's CLI commands.
62+
63+
.. csv-table::
64+
:header: "Option", "Usage"
65+
:delim: |
66+
67+
--help (-h) | Display a help message
68+
--quiet (-q) | Do not output any message
69+
--verbose (-v,-vv,-vvv) | Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
70+
--version (-V) | Display this application version
71+
--ansi | Force ANSI (colors) output
72+
--no-ansi | Disable ANSI (colors) output
73+
--no-interaction (-n) | Do not ask any interactive question
74+
--safe-mode | Run in Safe Mode (without extensions)

development/cli/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Command Line Interface
2+
======================
3+
4+
phpBB ships with a set of Command Line Interface (CLI) tools that allow for easy control over administrative and development functions via console or terminal application.
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
getting_started

development/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Contents:
77
:maxdepth: 2
88

99
development/coding_guidelines
10+
cli/index
1011
extensions/index
1112
language/index
1213
migrations/index

0 commit comments

Comments
 (0)