---
title: "Console commands (CLI)"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:symfony-console-commands@main"
source: "ApiOverview/CommandControllers/Index.rst"
rendered: "2026-09-21T11:24:09+00:00"
---

# Console commands (CLI) {#symfony-console-commands}

TYPO3 supports running scripts from the command line. This functionality is
especially useful for automating tasks such as cache clearing, maintenance,
and scheduling jobs.

System administrators and developers can use predefined commands to interact
with the TYPO3 installation directly from the terminal.

To learn how to run TYPO3 CLI commands in various environments (such as Composer
projects, Classic installations, DDEV, Docker, or remote servers), refer to
[How to run a command](https://docs.typo3.org/permalink/t3coreapi:how-to-run-a-command@main).

A list of available Core commands is provided here:
[List of Core console commands](https://docs.typo3.org/permalink/t3coreapi:symfony-console-commands-list@main).
Additional commands may be available depending on installed extensions.
The extension [`helhum/typo3-console`](https://packagist.org/packages/helhum/typo3-console) is frequently installed to
provide a wider range of CLI commands.

If you are developing your own TYPO3 extension, you can also create custom
console commands to provide functionality specific to your use case. These
commands integrate with the TYPO3 CLI and can be executed like any built-in
command.

For more information, see [Writing Custom Commands](https://docs.typo3.org/permalink/t3coreapi:writing-custom-commands@main).

**Table of contents**

-   [Command usage in terminal environments](https://docs.typo3.org/permalink/t3coreapi:command-usage-in-terminal-environments@main)
-   [Clearing the cache with cache:flush](https://docs.typo3.org/permalink/t3coreapi:clearing-the-cache-with-cache-flush@main)
-   [Viewing help for CLI commands](https://docs.typo3.org/permalink/t3coreapi:viewing-help-for-cli-commands@main)

**Read more**

-   [List Core commands](https://docs.typo3.org/permalink/t3coreapi:list-of-typo3-console-commands@main)
-   [Custom Commands](https://docs.typo3.org/permalink/t3coreapi:writing-custom-commands-1@main)
-   [Tutorial](https://docs.typo3.org/permalink/t3coreapi:tutorial-create-a-console-command-from-scratch@main)

## Command usage in terminal environments {#how-to-run-a-command}

To execute TYPO3 console commands, you need access to a terminal (command line
interface). You can run commands locally or on a remote server.

The entry point for running commands depends on the type of TYPO3 installation.

To display a list of all available commands, use the following:

**Composer mode**

```bash
vendor/bin/typo3
```

**Classic mode**

```bash
typo3/sysext/core/bin/typo3
```

**DDEV**

```bash
ddev typo3
```

**Core development in the Mono repository**

```bash
bin/typo3
```

### Local development environments {#how-to-run-a-command-local-development}

If you are working on a local development environment such as DDEV, MAMP, or a
native PHP installation, open a terminal and navigate to your project
directory. Then, run the command using the appropriate entry point for your
installation (Composer or Classic mode).

```bash
cd my-typo3-project
vendor/bin/typo3 list
```

#### Using the CLI with DDEV {#how-to-run-a-command-ddev}

If you are using DDEV, you can run TYPO3 commands from your host machine using
the `ddev typo3` shortcut. This automatically routes the command into
the correct container and environment.

For example, to flush all caches:

```bash
ddev typo3 cache:flush
```

You can use this shortcut with any TYPO3 CLI command:

```bash
ddev typo3 <your-command>
```

#### Using the CLI in Docker containers {#how-to-run-a-command-docker}

If you are using Docker directly (without DDEV or a wrapper), TYPO3 commands
must usually be executed **inside the container** that runs PHP and TYPO3.

First, open a shell inside the container. For example:

```bash
docker exec -it my_php_container bash
```

Replace `my_php_container` with the name of your running PHP container.

Once inside the container, navigate to the project directory and run the
command:

```bash
cd /var/www/html
vendor/bin/typo3 list
```

You typically **cannot run** TYPO3 commands from the host system unless the
project's PHP environment is directly accessible outside the container.

### Executing commands on remote servers via SSH {#how-to-run-a-command-remote-servers-ssh}

For TYPO3 installations on a remote server, you typically access the server
using SSH (Secure Shell).

Use the following command to connect:

```bash
ssh username@example.com
```

Replace `username` with your SSH username and `example.com` with the server
hostname or IP address.

Once logged in, navigate to your TYPO3 project directory and execute the
command. For example:

```bash
cd /var/www/my-typo3-site
vendor/bin/typo3 list
```

### Making the CLI entry point executable {#how-to-run-a-command-file-must-be-executable}

The TYPO3 command entry point (e.g. `vendor/bin/typo3`) must be marked as
**executable** in order to run it directly.

To make the file executable, run:

```bash
chmod +x vendor/bin/typo3
```

If you do not have permission to change the file mode or the file system is
read-only, you can run the script by calling the PHP interpreter explicitly:

```bash
php vendor/bin/typo3 list
```

This method works even if the file is not executable.

### Executing commands from the scheduler {#symfony-console-commands-scheduler}

By default, it is possible to run a command from the
[TYPO3 Scheduler](https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/Index.html#start)
as well. To do this, select the task **Execute console commands**
followed by your command in the **Schedulable Command** field.

> [!NOTE]
> You need to save and reopen the task to define command arguments.

In order to prevent commands from being set up as scheduler tasks,
see [Making a command non-schedulable](https://docs.typo3.org/permalink/t3coreapi:deactivating-the-command-in-scheduler@main).

### Using CLI commands in CI/CD pipelines {#how-to-run-a-command-ci-cd}

In continuous integration (CI) or continuous deployment (CD) pipelines, TYPO3
CLI commands can be used for tasks such as preparing the system, checking
configuration, or activating extensions (Classic mode).

See also chapter [CI/CD: Automatic deployment for TYPO3 Projects](https://docs.typo3.org/permalink/t3coreapi:ci-cd-for-typo3-projects@main).

The exact command entry point depends on your installation type. For example:

```bash
vendor/bin/typo3 list
```

Before you can run most TYPO3 CLI commands, ensure the following:

-   You have run `composer install` so that the `vendor/` directory and
    CLI entry point exist.
-   The PHP environment is set up (with extensions such as `pdo_mysql`).
-   The environment variable `TYPO3_CONTEXT` is set appropriately, such as
    `Production` or `Testing`.

> [!IMPORTANT]
> If no database is available during the pipeline (in a build-only step),
> many commands will not work. For example, `cache:flush` requires a
> database connection and will fail without one.

If you want to run commands such as `cache:flush` after deployment,
it is common to use the CI pipeline to connect to the remote server and
execute the command there using SSH:

```bash
ssh user@your-server.example.com 'cd /var/www/html && vendor/bin/typo3 cache:flush'
```

This pattern is often used in **post-deployment steps** to finalize setup in
the live environment.

## Clearing the cache with cache:flush {#command-cache-flush}

A common use case is to use a console command to flush all caches, for example
during development.

**Composer-based installation**

```bash
vendor/bin/typo3 cache:flush
```

**Classic mode installation (no Composer)**

```bash
typo3/sysext/core/bin/typo3 cache:flush
```

## Viewing help for CLI commands {#command-help}

Show help for the command:

**Composer mode**

```bash
vendor/bin/typo3 cache:flush -h
```

**Classic mode**

```bash
typo3/sysext/core/bin/typo3 cache:flush -h
```
