PHPackages                             bamarni/symfony-console-autocomplete - 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. bamarni/symfony-console-autocomplete

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

bamarni/symfony-console-autocomplete
====================================

Shell completion for Symfony Console based scripts

v1.5.5(3y ago)494451.0k↓49.6%33[5 issues](https://github.com/bamarni/symfony-console-autocomplete/issues)[3 PRs](https://github.com/bamarni/symfony-console-autocomplete/pulls)2MITPHPPHP ^7.1|^8.0CI failing

Since Dec 13Pushed 4w ago7 watchersCompare

[ Source](https://github.com/bamarni/symfony-console-autocomplete)[ Packagist](https://packagist.org/packages/bamarni/symfony-console-autocomplete)[ RSS](/packages/bamarni-symfony-console-autocomplete/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (3)Versions (30)Used By (2)

Symfony console autocomplete
============================

[](#symfony-console-autocomplete)

[![GitHub CI Status](https://camo.githubusercontent.com/a350e5eb80ab9d7f12279fa5d57d5928442b974e716d76ac3d6015a974bc6714/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652f43492e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562)](https://github.com/bamarni/symfony-console-autocomplete/actions/workflows/ci.yml)[![GitHub Issues](https://camo.githubusercontent.com/c910f47e60fcb73cc26b75d5d2f9e7f4cfc71f3c68dc988b6e922e603aa2697a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562)](https://github.com/bamarni/symfony-console-autocomplete/issues)[![Build Status](https://camo.githubusercontent.com/84567f2b23466b7929c0d055ea7364b54d6a4bc3178df7b2642f1f93af73492f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d747261766973)](https://travis-ci.org/bamarni/symfony-console-autocomplete)

[![PHP Version](https://camo.githubusercontent.com/7d94aaa38f1baac3a16294fde0692b371e7c46073a9d4c84cf43fee52e986350/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/bamarni/symfony-console-autocomplete)[![Stable Version](https://camo.githubusercontent.com/ddaafe199ac903439e5be68b3a380b0dbca16f25d620d8f908ab4223e084142a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d4c6174657374)](https://packagist.org/packages/bamarni/symfony-console-autocomplete)

[![Total Downloads](https://camo.githubusercontent.com/a2e55a78285b792e8e8e63b98e23bd00d38650dc19d89321526d859057c3de2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d546f74616c2b646f776e6c6f616473)](https://packagist.org/packages/bamarni/symfony-console-autocomplete)[![Monthly Downloads](https://camo.githubusercontent.com/e5fc3787f00f77e27fece7a891250a804d4b4e5f2de0090b3d0c306420176885/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d4d6f6e74686c792b646f776e6c6f616473)](https://packagist.org/packages/bamarni/symfony-console-autocomplete)[![Daily Downloads](https://camo.githubusercontent.com/e7ee3dc19cdb96c6302ded3af1084c18aeb9fb6ec9a6bc88ca4dae949b1823d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574652e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d4461696c792b646f776e6c6f616473)](https://packagist.org/packages/bamarni/symfony-console-autocomplete)[![Packagist Stars](https://camo.githubusercontent.com/7df5e869f5dcc0cd723ea34694f3f5c3f07a7c27964794761d80549e98dcfec2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f62616d61726e692f73796d666f6e792d636f6e736f6c652d6175746f636f6d706c6574653f7374796c653d666f722d7468652d6261646765)](https://github.com/bamarni/symfony-console-autocomplete)

Enables shell autocompletion for tools based on the [Symfony Console](http://symfony.com/doc/master/components/console/introduction.html)(Symfony framework, Composer, PHPSpec, Behat, etc.)

[![screenshot of symfony-console-autocomplete in action: zsh autocompletion for composer (press tab two times)](https://cloud.githubusercontent.com/assets/1205386/12221229/ecbda408-b791-11e5-8b2f-524763250a53.png)](https://cloud.githubusercontent.com/assets/1205386/12221229/ecbda408-b791-11e5-8b2f-524763250a53.png)

Prerequisites
-------------

[](#prerequisites)

- Make sure the global composer project is configured properly with your shell. Notably, the composer global bin directory needs to be in your path. See  for instructions on how todo that.
- If you're using bash, you'll have to make sure [programmable completion functions](https://github.com/scop/bash-completion) are available. Linux distributions usually ship it and enable it by default. On Mac OSX, you can install it with brew (`brew install bash-completion`) and enable it by adding `source $(brew --prefix)/etc/bash_completion` at the end of your `.bashrc`.

Installation
------------

[](#installation)

Install the tool globally with Composer :

```
composer global require bamarni/symfony-console-autocomplete

```

Quick setup
-----------

[](#quick-setup)

Add the following line at the end of your shell configuration file (`~/.bash_profile` or `~/.zshrc`) :

```
eval "$(symfony-autocomplete)"

```

Close / re-open your terminal window and you're ready to go!

Note that quick setup only works for [supported tools](#supported-tools).

Static setup
------------

[](#static-setup)

If you don't like all the magic from the quick setup and want to go with a more standard way, you can dump a static completion file for a given tool :

```
symfony-autocomplete composer

```

This will print the completion script for Composer to stdout. The output should be saved at a specific location depending on your OS / setup. Here are a few examples :

```
# BASH - Ubuntu / Debian
symfony-autocomplete composer | sudo tee /etc/bash_completion.d/composer

# BASH - Mac OSX (with Homebrew "bash-completion")
symfony-autocomplete composer > $(brew --prefix)/etc/bash_completion.d/composer

# ZSH - Config file
symfony-autocomplete composer > ~/.composer_completion && echo "source ~/.composer_completion" >> ~/.zshrc

# FISH
symfony-autocomplete --shell=fish composer > ~/.config/fish/completions/composer.fish

```

If you are running an environment that does not have automatic execution of PHP scripts, then you will need to call PHP and the script in question :

```
symfony-autocomplete "php ./artisan"

```

General tips
------------

[](#general-tips)

### Update

[](#update)

To update the tool to a new version use :

```
composer global update bamarni/symfony-console-autocomplete

```

### Symfony framework completion

[](#symfony-framework-completion)

In order to get completion running, you shouldn't prepend `php` at the beginning of the command :

```
app/console [TAB]

```

Tips for Bash users
-------------------

[](#tips-for-bash-users)

### Alias support

[](#alias-support)

By default, completion for your aliases won't be enabled. If you're using aliases (e.g. "c" for "composer", "pspec" for "phpspec", etc.), you have to pass them explicitly :

```
symfony-autocomplete --aliases=c --aliases=pspec

```

Tips for Docker users
---------------------

[](#tips-for-docker-users)

### Defining the `SHELL` environment variable

[](#defining-the-shell-environment-variable)

If you connect to your container using something similar to `docker exec -it container bash` then you may find that the completions cannot be built due to an inability to locate the `SHELL`environment variable. This has been reported in [\#32](https://github.com/bamarni/symfony-console-autocomplete/issues/32)

A solution is to supply the `SHELL` environment variable as part of the `docker exec` command:

```
docker exec -e SHELL=bash -it container bash

```

Supported tools
---------------

[](#supported-tools)

All tools using the Symfony Console component are supported.

However, [quick setup](#quick-setup) only works if the entrypoint is named `console` or in the following list of tools:

- [Acquia CLI (acli)](https://github.com/acquia/cli)
- [Behat](https://docs.behat.org/en/latest/)
- [Composer](https://getcomposer.org/)
- [Deployer](https://deployer.org/)
- [Laravel Artisan](https://laravel.com/docs/8.x/artisan)
- [Magento 2 console](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/cli-cmds/cli-howto.html)
- [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
- [phpspec](http://www.phpspec.net/en/stable/)
- [Roadiz](https://www.roadiz.io/)
- [Robo](https://github.com/consolidation/Robo)

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance62

Regular maintenance activity

Popularity56

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~98 days

Total

27

Last Release

1291d ago

PHP version history (3 changes)v1.4.0PHP ^7.0

v1.4.1PHP ^7.0|^8.0

v1.5.3PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5aaeb479031edf14ed54ebd48015a9146be0f0ed7745adf3efbaf4edb0659bd1?d=identicon)[bamarni](/maintainers/bamarni)

---

Top Contributors

[![bamarni](https://avatars.githubusercontent.com/u/1205386?v=4)](https://github.com/bamarni "bamarni (42 commits)")[![rquadling](https://avatars.githubusercontent.com/u/12801?v=4)](https://github.com/rquadling "rquadling (23 commits)")[![ktomk](https://avatars.githubusercontent.com/u/352517?v=4)](https://github.com/ktomk "ktomk (14 commits)")[![danepowell](https://avatars.githubusercontent.com/u/1984514?v=4)](https://github.com/danepowell "danepowell (6 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (4 commits)")[![brainexe](https://avatars.githubusercontent.com/u/1894271?v=4)](https://github.com/brainexe "brainexe (3 commits)")[![TomaszGasior](https://avatars.githubusercontent.com/u/1395027?v=4)](https://github.com/TomaszGasior "TomaszGasior (3 commits)")[![jfcherng](https://avatars.githubusercontent.com/u/6594915?v=4)](https://github.com/jfcherng "jfcherng (3 commits)")[![andytson-inviqa](https://avatars.githubusercontent.com/u/11387086?v=4)](https://github.com/andytson-inviqa "andytson-inviqa (3 commits)")[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (2 commits)")[![vworldat](https://avatars.githubusercontent.com/u/650955?v=4)](https://github.com/vworldat "vworldat (1 commits)")[![bbatsche](https://avatars.githubusercontent.com/u/500909?v=4)](https://github.com/bbatsche "bbatsche (1 commits)")[![h3xx](https://avatars.githubusercontent.com/u/615684?v=4)](https://github.com/h3xx "h3xx (1 commits)")[![jnkowa-gfk](https://avatars.githubusercontent.com/u/16591768?v=4)](https://github.com/jnkowa-gfk "jnkowa-gfk (1 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (1 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (1 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (1 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (1 commits)")[![ambroisemaupate](https://avatars.githubusercontent.com/u/380026?v=4)](https://github.com/ambroisemaupate "ambroisemaupate (1 commits)")

---

Tags

autocompletionbashbehatcompletioncomposerfish-shellphpphpspecsymfonysymfony-consolezsh

### Embed Badge

![Health badge](/badges/bamarni-symfony-console-autocomplete/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M572](/packages/shopware-core)[whatsdiff/whatsdiff

See what's changed in your project's dependencies

771.2k](/packages/whatsdiff-whatsdiff)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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