@jsnhengine/cli
v0.1.4
Published
Command-line interface for JSNH Engine Lab — call any of the 73 modular APIs from your terminal, CI, or shell scripts
Maintainers
Readme
@jsnhengine/cli
Command-line interface for JSNH Engine Lab — 73 modular APIs accessible from your terminal, shell scripts, CI/CD pipelines, and Makefiles. Pay per token, no subscriptions.
$ jsnh email-validator --email [email protected]
{
"is_valid": true,
"is_disposable": false,
"has_mx": true,
"score": 0.92
}
$ jsnh ip-geolocation --ip 8.8.8.8 -o raw | jq .country
"United States"
$ echo "DE123456789,FR12345678901,ESB12345678" | tr ',' '\n' | while read vat; do
jsnh vat-validator --vat_number "$vat" -o raw
doneInstall
npm install -g @jsnhengine/cli
# or
pnpm add -g @jsnhengine/cli
# or
brew install jsnh-maker/tap/jsnh # coming soonSetup
1. Get an API key
Sign up at jsnhengine.com — 1,000 free tokens on signup.
2. Configure auth
jsnh config set apiKey jsnhk_your_key_here
# or
export JSNH_API_KEY=jsnhk_your_key_here
# or
jsnh --api-key jsnhk_... email-validator --email [email protected]The key is stored in ~/.jsnh/config.json.
3. Verify
jsnh config show
jsnh modules listUsage
Discover modules
$ jsnh modules list
$ jsnh modules list --category Validation
$ jsnh modules describe email-validatorCall any module
The CLI auto-generates a subcommand per endpoint with flags matching the OpenAPI request schema:
$ jsnh email-validator --email [email protected]
$ jsnh vat-validator --vat_number ESB12345678
$ jsnh iban-validator --iban DE89370400440532013000
$ jsnh ip-geolocation --ip 8.8.8.8
$ jsnh ssl-cert-check --domain google.com
$ jsnh bin-lookup --card_number 4532015112830366Output formats
| Flag | Format | Use case |
|---|---|---|
| -o json (default) | Pretty JSON | Human reading in terminal |
| -o raw | Single-line JSON | Pipe to jq, grep, file |
| -o table | Key:value rows | Quick inspect, no JSON noise |
Verbose mode
$ jsnh -v email-validator --email [email protected]
→ POST /api/v1/email-validator
body: {"email":"[email protected]"}
✓ 1 token(s) used. Module: email-validator.
{
"is_valid": true,
...
}Custom origin / timeout
$ jsnh --origin https://staging.jsnhengine.com email-validator --email [email protected]
$ jsnh --timeout 60000 ai-web-scraper --url https://example.comPipeline examples
Validate a CSV column
$ csvtool col 2 customers.csv | tail -n +2 | while read email; do
result=$(jsnh email-validator --email "$email" -o raw)
valid=$(echo "$result" | jq -r .is_valid)
echo "$email,$valid"
done > validated.csvFail a CI build if a VAT is invalid
# .github/workflows/checkout.yml
- run: |
result=$(jsnh vat-validator --vat_number "${{ env.CUSTOMER_VAT }}" -o raw)
valid=$(echo "$result" | jq -r .is_valid)
[ "$valid" = "true" ] || { echo "Invalid VAT"; exit 1; }
env:
JSNH_API_KEY: ${{ secrets.JSNH_API_KEY }}Geolocate request IPs and group by country
$ tail -1000 access.log | awk '{print $1}' | sort -u | while read ip; do
jsnh ip-geolocation --ip "$ip" -o raw | jq -r .country
done | sort | uniq -c | sort -rnExit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Generic error (bad args, missing key, network) |
| 2 | API returned success: false |
| 3 | Unexpected internal error |
License
MIT
