PHPackages                             asika/symfony-console-completion - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. asika/symfony-console-completion

ActiveLibrary[CLI &amp; Console](/categories/cli)

asika/symfony-console-completion
================================

Automatic BASH completion for Symfony Console Component based applications. This is a fork for Symfony 6.

0.12.3(3y ago)03.6kMITPHPPHP &gt;=8.0.2

Since Oct 29Pushed 3y agoCompare

[ Source](https://github.com/asika32764/symfony-console-completion)[ Packagist](https://packagist.org/packages/asika/symfony-console-completion)[ RSS](/packages/asika-symfony-console-completion/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (6)Used By (0)

BASH/ZSH auto-complete for Symfony Console applications (Fork for Symfony6)
===========================================================================

[](#bashzsh-auto-complete-for-symfony-console-applications-fork-for-symfony6)

This package provides automatic (tab) completion in BASH and ZSH for Symfony Console Component based applications. With zero configuration, this package allows completion of available command names and the options they provide. User code can define custom completion behaviour for argument and option values.

Example of zero-config use with Composer:

[![Composer BASH completion](https://camo.githubusercontent.com/5f7797651c9434914271f54a4d9a12a5078313feae262ddad814bc5101c874ce/68747470733a2f2f692e696d6775722e636f6d2f4d6f44576b62792e676966)](https://camo.githubusercontent.com/5f7797651c9434914271f54a4d9a12a5078313feae262ddad814bc5101c874ce/68747470733a2f2f692e696d6775722e636f6d2f4d6f44576b62792e676966)

Zero-config use
---------------

[](#zero-config-use)

If you don't need any custom completion behaviour, you can simply add the completion command to your application:

1. Install `stecman/symfony-console-completion` using [composer](https://getcomposer.org/) by running:

    ```
    $ composer require stecman/symfony-console-completion

    ```
2. For standalone Symfony Console applications, add an instance of `CompletionCommand` to your application's `Application::getDefaultCommands()` method:

    ```
    protected function getDefaultCommands()
    {
       //...
        $commands[] = new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand();
       //...
    }
    ```

    For Symfony Framework applications, register the `CompletionCommand` as a service in `app/config/services.yml`:

    ```
    services:
    #...
        console.completion_command:
          class: Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand
          tags:
              -  { name: console.command }
    #...
    ```
3. Register completion for your application by running one of the following in a terminal, replacing `[program]` with the command you use to run your application (eg. 'composer'):

    ```
    # BASH ~4.x, ZSH
    source addHandler(
    new Completion(
        Completion::ALL_COMMANDS,
        'package',
        Completion::ALL_TYPES,
        function() {
            // ...
        }
    )
);
```

Example completions
-------------------

[](#example-completions)

### Completing references from a Git repository

[](#completing-references-from-a-git-repository)

```
new Completion(
    Completion::ALL_COMMANDS,
    'ref',
    Completion::TYPE_OPTION,
    function () {
        $raw = shell_exec('git show-ref --abbr');
        if (preg_match_all('/refs\/(?:heads|tags)?\/?(.*)/', $raw, $matches)) {
            return $matches[1];
        }
    }
)
```

### Completing filesystem paths

[](#completing-filesystem-paths)

This library provides the completion implementation `ShellPathCompletion` which defers path completion to the shell's built-in path completion behaviour rather than implementing it in PHP, so that users get the path completion behaviour they expect from their shell.

```
new Completion\ShellPathCompletion(
    Completion::ALL_COMMANDS,
    'path',
    Completion::TYPE_OPTION
)
```

Behaviour notes
---------------

[](#behaviour-notes)

- Option shortcuts are not offered as completion options, however requesting completion (ie. pressing tab) on a valid option shortcut will complete.
- Completion is not implemented for the `--option="value"` style of passing a value to an option, however `--option value` and `--option "value"` work and are functionally identical.
- Value completion is always run for options marked as `InputOption::VALUE_OPTIONAL` since there is currently no way to determine the desired behaviour from the command line contents (ie. skip the optional value or complete for it)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

1290d ago

PHP version history (2 changes)0.12.0PHP &gt;=5.3.2

0.12.2PHP &gt;=8.0.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1639206?v=4)[Simon Asika](/maintainers/asika32764)[@asika32764](https://github.com/asika32764)

---

Top Contributors

[![stecman](https://avatars.githubusercontent.com/u/2230769?v=4)](https://github.com/stecman "stecman (112 commits)")[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (8 commits)")[![asika32764](https://avatars.githubusercontent.com/u/1639206?v=4)](https://github.com/asika32764 "asika32764 (6 commits)")[![VolCh](https://avatars.githubusercontent.com/u/396345?v=4)](https://github.com/VolCh "VolCh (5 commits)")[![pjcdawkins](https://avatars.githubusercontent.com/u/1465106?v=4)](https://github.com/pjcdawkins "pjcdawkins (3 commits)")[![AlexeyKosov](https://avatars.githubusercontent.com/u/8222004?v=4)](https://github.com/AlexeyKosov "AlexeyKosov (1 commits)")[![k0pernikus](https://avatars.githubusercontent.com/u/436935?v=4)](https://github.com/k0pernikus "k0pernikus (1 commits)")[![mhor](https://avatars.githubusercontent.com/u/4103719?v=4)](https://github.com/mhor "mhor (1 commits)")[![Programie](https://avatars.githubusercontent.com/u/1206521?v=4)](https://github.com/Programie "Programie (1 commits)")[![helhum](https://avatars.githubusercontent.com/u/904370?v=4)](https://github.com/helhum "helhum (1 commits)")[![CarsonF](https://avatars.githubusercontent.com/u/932566?v=4)](https://github.com/CarsonF "CarsonF (1 commits)")[![Chronoes](https://avatars.githubusercontent.com/u/9286920?v=4)](https://github.com/Chronoes "Chronoes (1 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (1 commits)")[![GwendolenLynch](https://avatars.githubusercontent.com/u/1427081?v=4)](https://github.com/GwendolenLynch "GwendolenLynch (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/asika-symfony-console-completion/health.svg)

```
[![Health](https://phpackages.com/badges/asika-symfony-console-completion/health.svg)](https://phpackages.com/packages/asika-symfony-console-completion)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
