Server rental store

Command line interface

Command Line Interface (CLI) for MediaWiki Administrators

The Command Line Interface (CLI) is a powerful tool for managing a MediaWiki installation, particularly for server administrators. While the web-based interface provides many administrative functions, the CLI allows for automation, scripting, and access to features not available through the web interface. This article will cover the basics of using the CLI with MediaWiki 1.40, focusing on common tasks and providing examples.

Accessing the CLI

The primary method for accessing the MediaWiki CLI is through SSH (Secure Shell) access to the server hosting your MediaWiki installation. You'll need a user account with appropriate permissions. Once logged in via SSH, you'll typically navigate to the directory containing `maintenance/`, which is located within your MediaWiki installation directory.

For example, if your MediaWiki installation is in `/var/www/mediawiki`, you would use the following command:

```bash cd /var/www/mediawiki/maintenance ```

From this directory, you can execute various maintenance scripts. Ensure that the web server user (e.g., `www-data`, `apache`) has appropriate read/write permissions to the `maintenance/` directory and the `config/` directory containing `LocalSettings.php`. Incorrect permissions are a common source of errors. See Manual:Configuration settings for more information on `LocalSettings.php`.

Common CLI Scripts

MediaWiki provides a range of maintenance scripts. Here's a breakdown of some of the most frequently used ones:

⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️