@hekbobo/hello-cli
v0.1.1
Published
A simple hello world CLI.
Readme
hello-cli
Simple "hello world" CLI.
Run locally
node .\bin\hello.js
node .\bin\hello.js Alice
node .\bin\hello.js --helpInstall as a command (dev)
npm link
hello
hello Alice
hello --versionPublish & install via npm
This package is published as a scoped package: @hekbobo/hello-cli.
Publish
npm login
npm publish --access publicInstall (global)
npm i -g @hekbobo/hello-cli
hello
hello AliceRun without installing
npx @hekbobo/hello-cli AliceIf npm install says Not Found
- Confirm you are installing the exact package name:
@hekbobo/hello-cli(scoped packages must include the@scope/prefix). - Confirm your npm registry points at the official npm registry:
npm config get registryIf it is not https://registry.npmjs.org/, either switch it back or install with an explicit registry:
npm i -g @hekbobo/hello-cli --registry=https://registry.npmjs.org/Build executables (multi-platform)
This project uses Node.js. To produce a single-file executable for different platforms, you can use pkg.
Install packager
npm i -D pkgBuild for multiple targets
Build Windows + macOS + Linux (x64):
npx pkg -t node18-win-x64,node18-macos-x64,node18-linux-x64 -o dist/hello .Build Windows (x64 + arm64):
npx pkg -t node18-win-x64,node18-win-arm64 -o dist/hello .Common targets
- Windows:
node18-win-x64,node18-win-arm64 - macOS:
node18-macos-x64,node18-macos-arm64 - Linux:
node18-linux-x64,node18-linux-arm64
Notes
- Cross-building is not always reliable for every target (especially macOS). For best results, build macOS binaries on a macOS machine/CI runner.
- If you add extra runtime files (templates/config/etc.), you may need to configure
pkgassets inpackage.json.
