withfig / autocomplete

IDE-style autocomplete for your existing terminal & shell
https://fig.io
MIT License
24.38k stars 5.4k forks source link

[npm] support private registry #2255

Open claneo opened 5 months ago

claneo commented 5 months ago

Sanity checks

What CLI tool does this relate to?

npm

Which statement makes the most sense?

There is a bug with this completion spec

Issue Details

Currently npm autocomplete uses api.npms.io to search package

https://github.com/withfig/autocomplete/blob/7922234c72777fc1a5be89699ad69be6720fa838/src/npm.ts#L32-L34

and registry.npmjs.org to search package version

https://github.com/withfig/autocomplete/blob/7922234c72777fc1a5be89699ad69be6720fa838/src/npm.ts#L48

Both api only support public npm registry.

My suggestion is to use npm --json search command for packages and npm --json info for versions.