rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

[RRFC] add bash/zsh completion to npx

Open fleytman opened this issue 3 years ago • 3 comments

Motivation ("The Why")

It is convenient when you can press tab in the console and get a list of commands. This is how almost all console programs work.

Example

This could simplify the use of npx.

How

Current Behaviour

It not working.

Desired Behaviour

npx rea -> npx react-native npx react-native r -> npx react-native run- npx react-native run-android --co -> npx react-native run-android --configuration

References

(https://github.com/npm/cli/issues/4577)

fleytman avatar Mar 17 '22 20:03 fleytman

Wouldn't this mean that tab-completion has to contact the registry? npx doesn't just run with local and global bins, but with "anything on npmjs.org"

ljharb avatar Mar 17 '22 20:03 ljharb

Wouldn't this mean that tab-completion has to contact the registry? npx doesn't just run with local and global bins, but with "anything on npmjs.org"

that or include an index of 1,910,640 (more the moment after I write this) package names with npx :P

bnb avatar Mar 22 '22 18:03 bnb

I think this could be fairly robust if it used the npx specific cache, and/or known bins when done in a project directory.

lukekarrys avatar Apr 10 '22 19:04 lukekarrys