1 ---
2 title: npm-completion
3 section: 1
4 description: Tab Completion for npm
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-completion.md
8 redirect_from:
9 - /cli-commands/completion
10 - /cli-commands/npm-completion
11 - /cli-documentation/cli-commands/completion
12 - /cli-documentation/cli-commands/npm-completion
13 - /cli-documentation/commands/completion
14 - /cli-documentation/commands/npm-completion
15 - /cli-documentation/completion
16 - /cli-documentation/npm-completion
17 - /cli-documentation/v11/cli-commands/completion
18 - /cli-documentation/v11/cli-commands/npm-completion
19 - /cli-documentation/v11/commands/completion
20 - /cli-documentation/v11/commands/npm-completion
21 - /cli-documentation/v11/completion
22 - /cli-documentation/v11/npm-completion
23 - /cli/cli-commands/completion
24 - /cli/cli-commands/npm-completion
25 - /cli/commands/completion
26 - /cli/commands/npm-completion
27 - /cli/completion
28 - /cli/npm-completion
29 - /cli/v11/cli-commands/completion
30 - /cli/v11/cli-commands/npm-completion
31 - /cli/v11/commands/completion
32 - /cli/v11/completion
33 - /cli/v11/npm-completion
34 - /commands/completion
35 - /commands/npm-completion
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm completion
42 ```
43
44 Note: This command is unaware of workspaces.
45
46 ### Description
47
48 Enables tab-completion in all npm commands.
49
50 The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available everywhere:
51
52 ```bash
53 npm completion >> ~/.bashrc
54 npm completion >> ~/.zshrc
55 ```
56
57 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.
58
59 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.
60
61 ### See Also
62
63 - [npm developers](/cli/v11/using-npm/developers)
64 - [npm](/cli/v11/commands/npm)