Registry / devops / ngrpcli

ngrpcli

JSON →
library1.0.3jsnpmunverified

ngrpcli is a lightweight Node.js gRPC CLI client for making gRPC requests from the command line. Current stable version is 1.0.3. It allows users to specify a proto file, package, service, RPC method, URL, and JSON payload via command-line flags. Key differentiators: simple and minimal compared to full-featured gRPC clients like grpcurl, requires no interactive shell, and is written in TypeScript with NestJS. Releases are infrequent (last update in 2023).

npm install ngrpcli
INSTALL
IMPORT
SIG · NGRPCLI
N
ngrpcli
devopsjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import ngrpcli from 'ngrpcli'
const ngrpcli = require('ngrpcli')
Package is ESM-only; CommonJS require will fail.
run
import { run } from 'ngrpcli'
const { run } = require('ngrpcli')
ESM-only; named export 'run' is available.
NgrpcliOptions
import { NgrpcliOptions } from 'ngrpcli'
type NgrpcliOptions = ...
TypeScript type exported; wrong if using inline type without import.

Makes a gRPC call to localhost:5000 using a proto file, service, and RPC with JSON payload.

npx ngrpcli -u localhost:5000 -p mypackage -P ./proto/my.proto -s MyService -r MyRpc -d '{"key": "value"}'
Debug
Known issues
gotchaProto file path must be absolute or relative to current working directory; not resolved relative to package root.
fix
Use absolute path or path relative to where you run the CLI.
affects: >=1.0.0
gotchaPayload must be valid JSON string; non-JSON or malformed JSON will cause silent failure or incorrect request.
fix
Use double quotes for strings inside JSON (e.g., '{"key":"value"}') and escape properly.
affects: >=1.0.0
deprecatedThe --package flag is required but may be redundant if proto file defines package; future versions might infer it.
fix
Always provide --package if proto file does not have a 'package' statement.
affects: >=1.0.0
gotchaNode.js v18 or later is required; earlier versions will throw errors due to ESM and NestJS dependencies.
fix
Use Node.js v18+.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ngrpcli'
Global install not recognized or missing dependency.
fix
Install globally with 'npm i -g ngrpcli' or use 'npx ngrpcli'.
Error: ENOENT: no such file or directory, open './proto/my.proto'
Proto file path is incorrect or relative path not resolved from CWD.
fix
Use absolute path or ensure proto file exists relative to current working directory.
SyntaxError: Unexpected token ... in JSON at position 0
Payload is not valid JSON due to single quotes or missing quotes.
fix
Use valid JSON: wrap keys in double quotes and use double quotes for strings.
Error: 14 UNAVAILABLE: Connection refused
gRPC server is not running or URL is incorrect.
fix
Verify server is running and URL is correct (e.g., localhost:5000).
ReferenceError: require is not defined in ES module scope
Using require() when package is ESM-only.
fix
Use import syntax or switch to CommonJS by setting type: 'commonjs' in package.json (if applicable).
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
ngrpcli — npm install ngrpcli · libregistry