Use the bin field in package.json to specify the entrypoint javascript file for your CLI.

Add #!/usr/bin/env node to the top of your entrypoint js file.

Specify the files which need to be packaged with your app, using the files field of package.json

In README, provide an npm install command line which a consumer can use to install your app, for example it could point at a github repository, or a package uploaded to the npm registry, which you can create with npm pack.

Upon installing the app locally or globally, a script will be created in the path (or locally in node_modules/.bin), which will let your command line app be run conveniently.