completion
ng completion [options]Setting up autocompletion configures your terminal, so pressing the <TAB> key while in the middle
of typing will display various commands and options available to you. This makes it very easy to
discover and use CLI commands without lots of memorization.
Automated setup
The CLI should prompt and ask to set up autocompletion for you the first time you use it (v14+). Simply answer "Yes" and the CLI will take care of the rest.
$ ng serve
? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands will show possible options and autocomplete arguments. (Enabling autocompletion will modify configuration files in your home directory.) Yes
Appended `source <(ng completion script)` to `/home/my-username/.bashrc`. Restart your terminal or run:
source <(ng completion script)
to autocomplete `ng` commands.
# Serve output...
If you already refused the prompt, it won't ask again. But you can run ng completion to
do the same thing automatically.
This modifies your terminal environment to load Angular CLI autocompletion, but can't update your
current terminal session. Either restart it or run source <(ng completion script) directly to
enable autocompletion in your current session.
Test it out by typing ng ser<TAB> and it should autocomplete to ng serve. Ambiguous arguments
will show all possible options and their documentation, such as ng generate <TAB>.