Skip to content
This Symfony2 bundle provides a simple way of autocompleting your commands in your shell.
PHP Shell
Pull request Compare This branch is 19 commits behind KnpLabs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This bundle provides a simple way of autocompleting your commands in your shell.


Download the bundle and put it under the Knplabs/ namespace.

If you use git submodules:

git submodule add git:// src/Bundle/Knplabs/ConsoleAutocompleteBundle

Then, like for any other bundle, include it in your Kernel class:

public function registerBundles()
    $bundles = array(
        // enable third-party bundles
        new Bundle\Knplabs\ConsoleAutocompleteBundle\KnplabsConsoleAutocompleteBundle(),

        // register your bundles


The first time you install ConsoleAutocompleteBundle in a project, you should add Resources/Shells/symfony2-completion.bash in your bash profile (in ~/.bash_profile on MacOS):

source /path-to-symfony2-completion.bash

That's it! Now when you type:

./app/console doc[TAB], you should see an autocompletion of the command name.

./app/console doctrine:data:load --[TAB], you should see an autocompletion of the option names.

Valid executable names are:

  • console
  • console-dev
  • console-prod
  • console-staging
  • console-test
  • Symfony

If none of these names do it for you, you can enable completion for your own executable. Add this line to your bash profile, just below where you sourced symfony2-completion.bash:

complete -F _console my-console-name

Copyright & Credits

ConsoleAutocompleteBundle Copyright (c) 2011 knpLabs.
See LICENSE for details.


Something went wrong with that request. Please try again.