> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Administering Joomla from the command line

> Discover how to automate Joomla admin tasks with command-line apps for cron jobs. Learn more here.

This article describes how to use Joomla's CLI (command-line interface) applications to do administration tasks from the command line. You can use these application scripts in cron jobs to automate common administration tasks.

## About Joomla's CLI applications

Unfortunately, Joomla does not have a complete CLI administration solution like [WP-CLI for WordPress](/docs/administering-wordpress-from-the-command-line) or [Drush for Drupal](/docs/using-drush-for-drupal). However, Joomla does include some application scripts that you can use to do common administrative tasks from the command line.

Because these applications are PHP scripts, you can run them automatically in cron jobs. For information about how to run PHP scripts from cron jobs, please see [this article](/docs/run-php-scripts-from-cron-jobs).

The following sections describe the CLI applications included with Joomla.

## Purging expired cache files

You can remove expired cache data by using the *garbagecron.php* application. By running this application periodically, you can keep the Joomla cache at a manageable size and reduce disk space usage.

To run this application, type the following commands:

```bash theme={null}
cd ~/public_html/cli
php garbagecron.php
```

<Note>
  If you installed Joomla in a subdirectory, change to that directory instead, and then change to the *cli* directory.
</Note>

For more information about this application, please visit [https://docs.joomla.org/Purging\_expired\_cache\_files](https://docs.joomla.org/Purging_expired_cache_files).

## Checking for extension updates

You can download extension update information by using the *update\_cron.php* application. By running this application periodically, you can make sure that the Joomla administration interface always has up-to-date information about available extension updates.

To run this application, type the following commands:

```bash theme={null}
cd ~/public_html/cli
php update_cron.php
```

<Note>
  If you installed Joomla in a subdirectory, change to that directory instead, and then change to the *cli* directory.
</Note>

## Deleting old files after an update

You can remove old files that remain after an update by using the *deletefiles.php* application. By running this application periodically, you can help reduce disk space usage and keep your Joomla installation streamlined.

To run this application, type the following commands:

```bash theme={null}
cd ~/public_html/cli
php deletefiles.php
```

<Note>
  If you installed Joomla in a subdirectory, change to that directory instead, and then change to the *cli* directory.
</Note>

## Managing Smart Search indexing

You can manage the [Smart Search indexing feature](https://docs.joomla.org/Smart_Search_quickstart_guide) by using the *finder\_indexer.php* application.

If you run this application with no arguments, it updates the search index incrementally. Alternatively, if you use the **--purge** option, it deletes and then rebuilds the entire index.

To run this application, type the following commands:

```bash theme={null}
cd ~/public_html/cli
php finder_indexer.php --purge
```

<Note>
  If you installed Joomla in a subdirectory, change to that directory instead, and then change to the *cli* directory.
</Note>

For more information about this application, please visit [https://docs.joomla.org/Setting\_up\_automatic\_Smart\_Search\_indexing](https://docs.joomla.org/Setting_up_automatic_Smart_Search_indexing).

## Writing your own CLI applications

You can also create your own Joomla CLI applications for custom tasks that you want to automate. To do this, we recommend using the Joomla Framework, an extensible, lightweight framework for PHP applications.

For more information about the Joomla Framework, please visit [https://framework.joomla.org](https://framework.joomla.org).

## Related articles

* [Cron jobs](/docs/cron-jobs)

* [Run PHP scripts from cron jobs](/docs/run-php-scripts-from-cron-jobs)
