@zindua/cli
v1.0.0
Published
Zindua CLI — send OTP, inspect project, list templates, diagnose API key from the terminal.
Maintainers
Readme
@zindua/cli
Terminal tools for Zindua: send OTP tests, inspect your project, list templates, and diagnose your API key. No dashboard required.
| | | |---|---| | API reference | zindua.run/developers | | Next.js starter | zindua.run/next | | SDK (Node) | @zindua/sdk |
npx @zindua/cli@latest doctorDo not confuse with @zindua/create-app — that scaffolds a Next.js app. This CLI talks to the Zindua API from your terminal.
Prerequisites
- Node.js 18+
- A Zindua project and API key (
znd_test_…for sandbox,znd_live_…for production) - At least one channel connected (email and/or WhatsApp) to actually deliver messages
Install / run
No global install required:
npx @zindua/cli@latest <command>Set your API key once:
export ZINDUA_API_KEY=znd_test_your_key_hereOr pass per command (avoid shell history on shared machines):
npx @zindua/cli@latest project --api-key "$ZINDUA_API_KEY"The CLI also reads .env and .env.local in the current directory.
Commands
Send a message
npx @zindua/cli@latest send \
--to [email protected] \
--template otp-verification \
--channel email \
--lang en \
--var code=482910 \
--var appName=MyAppWhatsApp (E.164 with +):
npx @zindua/cli@latest send \
--to +243812345678 \
--channel whatsapp \
--template otp-verification \
--var code=482910Inspect project
npx @zindua/cli@latest projectShows project name, plan, API key suffix, and channel status.
List templates
npx @zindua/cli@latest templates listDiagnose configuration
npx @zindua/cli@latest doctorChecks API key presence, format, GET /project, and channel readiness.
Connect site (WordPress binding)
npx @zindua/cli@latest connect --site https://myshop.comBinds your API key to a site URL (same flow as the WordPress plugin onboarding).
JSON output (CI / scripts)
Add --json to any command:
npx @zindua/cli@latest project --json
npx @zindua/cli@latest send --to [email protected] --template otp-verification --var code=123456 --jsonExit codes:
| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | API or validation error |
| 2 | Missing config (ZINDUA_API_KEY, required flags) |
Environment variables
| Variable | Required | Notes |
|----------|----------|-------|
| ZINDUA_API_KEY | Yes | From Dashboard → Projects |
| ZINDUA_API_BASE_URL | No | Default https://zindua.run/api/v1 |
| ZINDUA_SITE_URL | For bound keys | Sent as X-Zindua-Site-Url |
Never commit real API keys. Use env vars or CI secrets.
Security
- API key stays in your terminal environment — never logged by the CLI
- Validation runs locally via
@zindua/sdkbefore calling the API - Prefer
export ZINDUA_API_KEY=…over typing the key on the command line
Command cheat sheet
npx @zindua/cli@latest send --to [email protected] --template otp-verification --var code=482910
npx @zindua/cli@latest project
npx @zindua/cli@latest templates list
npx @zindua/cli@latest doctor
npx @zindua/cli@latest connect --site https://myshop.comRelated packages
| Package | Purpose |
|---------|---------|
| @zindua/create-app | Scaffold Next.js auth app |
| @zindua/sdk | Node.js SDK for your backend |
| zindua-connect | Official WordPress plugin |
