Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

ng completion configures shell autocomplete for Angular CLI commands and options. Run it in a supported Bash or Zsh shell, then restart the terminal—or source the generated script in the current session—to start using Tab suggestions.

What does ng completion do?

Angular CLI autocomplete can suggest commands and options as you type. When an argument has multiple possible values, it can also display available choices and their documentation. The ng completion script subcommand generates the real-time completion script for Bash and Zsh.

See Angular’s autocomplete guide and completion-script reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable autocomplete

Use the automatic setup

Angular CLI v14 and later can prompt you to configure autocomplete the first time you use the CLI. If you declined the prompt, run:

ng completion

The setup appends the completion configuration to your current shell’s existing configuration file, or creates one if needed. It does not change an already-running terminal session automatically.

Configure it manually

To choose where the completion script is loaded, add this command to the startup configuration for your shell:

source <(ng completion script)

For example, place it in the startup file used by your Bash or Zsh setup. The command runs Angular CLI to generate and load the script when the shell starts.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make it work in the current terminal

After automatic setup, open a new terminal session. To activate autocomplete without restarting, run the source command directly:

source <(ng completion script)

Then type ng followed by a space and press Tab to check for suggestions. Available results depend on what you have typed.

Supported shells and platforms

Angular documents autocomplete for Bash and Zsh on macOS and Linux. On Windows, its documented options are Git Bash and Windows Subsystem for Linux (WSL) using Bash or Zsh—not every Windows terminal or shell.

For Angular CLI installation and general command-line setup, see the Angular CLI overview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot “ng: command not found”

The completion setup invokes Angular CLI, so the ng executable must be installed and available on your shell’s PATH. If the shell cannot find it, verify that Angular CLI is installed and that its executable directory is on PATH. Angular’s guide suggests installing the CLI globally with npm:

npm install -g @angular/cli

After installation, open a new terminal and try ng completion again. If ng works but suggestions do not appear, confirm that you are using a documented shell and that the completion command is present in the shell startup configuration or has been sourced in the current session.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.