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