php bin/console completion

Dump the shell completion script

Usage

completion [--debug] [--] [<shell>]

Arguments

shell   The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given 

Options

      --debug   Tail the completion debug log 

Help

The completion command dumps the shell completion script required
to use shell autocompletion (currently, bash and fish completion is supported).

Static installation
-------------------

Dump the script to a global completion file and restart your shell:

    bin/console completion  | sudo tee /etc/bash_completion.d/console

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

    bin/console completion  > completion.sh

    # source the file whenever you use the project
    source completion.sh

    # or add this line at the end of your "~/.bashrc" file:
    source /path/to/completion.sh

Dynamic installation
--------------------

Add this to the end of your shell configuration file (e.g. "~/.bashrc"):

    eval "$(/app/bin/console completion )"