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