1 ---
2 title: npm-completion
3 section: 1
4 description: Tab Completion for npm
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/commands/npm-completion.md
8 redirect_from:
9 - /cli-documentation/v6/cli-commands/completion
10 - /cli-documentation/v6/cli-commands/npm-completion
11 - /cli-documentation/v6/commands/completion
12 - /cli-documentation/v6/commands/npm-completion
13 - /cli-documentation/v6/completion
14 - /cli-documentation/v6/npm-completion
15 - /cli/v6/cli-commands/completion
16 - /cli/v6/cli-commands/npm-completion
17 - /cli/v6/commands/completion
18 - /cli/v6/completion
19 - /cli/v6/npm-completion
20 ---
21
22 ### Synopsis
23
24 ```bash
25 source <(npm completion)
26 ```
27
28 ### Description
29
30 Enables tab-completion in all npm commands.
31
32 The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available everywhere:
33
34 ```bash
35 npm completion >> ~/.bashrc
36 npm completion >> ~/.zshrc
37 ```
38
39 You may of course also pipe the output of `npm completion` to a file such as `/usr/local/etc/bash_completion.d/npm` or `/etc/bash_completion.d/npm` if you have a system that will read that file for you.
40
41 When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the environment, `npm completion` acts in "plumbing mode", and outputs completions based on the arguments.
42
43 ### See Also
44
45 - [npm developers](/cli/v6/using-npm/developers)
46 - [npm](/cli/v6/commands/npm)