Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Command
Octocat-spinner-32 Resources
Octocat-spinner-32 KnplabsConsoleAutocompleteBundle.php
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
README.markdown

ConsoleAutocompleteBundle

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

Installation

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

If you use git submodules:

git submodule add git://github.com/knplabs/ConsoleAutocompleteBundle.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.

Contributors:

Something went wrong with that request. Please try again.