---
title: "Feature: #106839 - Introduce shell auto-completion for the typo3 command"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-106839-1749197278"
source: "Changelog/14.0/Feature-106839-IntroduceShellAuto-completionForTheTypo3Script.rst"
typo3-version: "14.0"
typo3-major: 14
type: "feature"
issue: 106839
forge: "https://forge.typo3.org/issues/106839"
tags: ["CLI", "ext:core"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #106839 - Introduce shell auto-completion for the `typo3` command {#feature-106839-1749197278}

See [forge#106839](https://forge.typo3.org/issues/106839)

## Description {#description}

A new CLI command `vendor/bin/typo3 completion` has been added to the
`typo3` CLI dispatcher script.

This command enables **shell auto-completion** for supported shells, allowing
developers to use the `Tab` key to trigger command and option suggestions.

The `completion` command is provided by the
[`symfony/console`](https://packagist.org/packages/symfony/console) package and is not a custom implementation.

This ensures compatibility with ongoing improvements in the Symfony ecosystem
and benefits from a broad user base and community support.

### Supported shells {#supported-shells}

The command reports unsupported shells and lists available ones:

```bash
# bin/typo3 completion shell
Detected shell "shell", which is not supported by Symfony shell completion
(supported shells: "bash", "fish", "zsh").
```

### Installation modes {#installation-modes}

The command supports two installation modes — *static* and *dynamic*.
Run `vendor/bin/typo3 completion --help` to see detailed usage instructions and
the supported shells (bash, fish, zsh).

#### Static installation {#static-installation}

Dump the completion script to a file and source it manually or install it
globally, for example:

```bash
vendor/bin/typo3 completion bash | sudo tee /etc/bash_completion.d/typo3
```

Or dump the script to a local file and source it:

```bash
bin/typo3 completion bash > completion.sh
source completion.sh
```

To make it permanent, add the following line to your " /.bashrc" file:

**/.bashrc**

```bash
source /path/to/completion.sh
```

#### Dynamic installation {#dynamic-installation}

Add an `eval` line to your shell configuration file (for example `~/.bashrc`):

```bash
eval "$(/var/www/html/vendor/bin/typo3 completion bash)"
```

## Impact {#impact}

The `typo3` CLI dispatcher now supports shell auto-completion, improving
the user experience without affecting existing command usage.
This also lays the foundation for further enhancements such as improved
auto-completion for command options and arguments.

The following existing commands already provide completion for their arguments:

-   `redirects:cleanup`
-   `redirects:checkintegrity`
-   `styleguide:generate`

### Example {#example}

The following example shows how to add auto-completion support to a custom
Symfony console command:

**EXT:my_extension/Classes/Command/GreetCommand.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Input\InputArgument;

#[AsCommand(
    name: 'myextension:greet',
)]
class GreetCommand extends Command
{
    protected function configure(): void
    {
        $this
            ->addArgument(
                'names',
                InputArgument::IS_ARRAY,
                'Who do you want to greet (separate multiple names with a space)?',
                null,
                function (CompletionInput $input): array {
                    // Value already typed by the user, e.g. "myextension:greet Fa"
                    // before pressing Tab — this will contain "Fa"
                    $currentValue = $input->getCompletionValue();

                    // Example of available usernames
                    $availableUsernames = ['jane', 'jon'];

                    return $availableUsernames;
                }
            );
    }
}
```

For more details, see [Symfony Console Adding Argument Option Value Completion](https://symfony.com/doc/7.2/console/input.html#adding-argument-option-value-completion)
and also for testing purpose see [Testing the Completion script](https://symfony.com/doc/7.2/console/input.html#testing-the-completion-script).
