@izapai/wizard
v0.2.1
Published
Developer setup wizard for iZap integrations, MCP clients, and scaffolds.
Maintainers
Readme
iZap Wizard
@izapai/wizard is a developer-facing setup tool for adding iZap to an existing
stack. It is intentionally recipe-driven first: deterministic file generation,
small explicit edits, dry-run support, and source-backed scaffolds.
Install & run
Run it without installing:
npx @izapai/wizard # interactive wizard (on a TTY)
npx @izapai/wizard run "add iZap MCP" # same, with a stated goal
npx @izapai/wizard plan "connect an AI client"
npx @izapai/wizard mcp add
npx @izapai/wizard --versionInteractive mode
Running izap-wizard with no command on a terminal launches a full-screen,
PostHog-style wizard. It first detects your stack and shows a pre-flight
confirmation — Directory / Framework / Recipe — with a menu (↑↓ navigate,
enter select, q/esc/ctrl-d cancel): Continue, Change framework
(override the detected framework — the picker shows display names and marks the
detected one), or Cancel. Nothing is written until you choose Continue;
--yes skips the prompt.
After you confirm, it runs the real pipeline end-to-end with a live task
checklist, tips panel, spinner, progress bar, and Status / Logs / Reference
tabs (↹/arrow keys switch tab, q quit) — detect → audit → pick recipe → find
edit points → scaffold → write the integration brief → verify.
It degrades gracefully: in a pipe or CI (no TTY), or with --plain, it prints
the same steps line-by-line and exits. Without a TTY there is no confirmation
menu, so writing requires explicit consent: absent --yes (or --dry-run)
the run previews the full plan and exits non-zero instead of writing files.
--dry-run previews without writing; --fast skips the animation pacing.
izap-wizard run --plain --dry-run "add iZap MCP" # preview, rc 0
izap-wizard run --plain "add iZap MCP" # preview + rc 1: add --yes to apply
izap-wizard run --plain --yes "add iZap MCP" # appliesSafe writes
Every recipe runs through the same write-safety layer:
- Never clobbers your edits. If a target file exists with content that
differs from what the recipe generates, the run stops with the conflicting
paths listed and rc 1. Re-run with
--forceto overwrite deliberately. .env.examplefiles union-merge. Your existing lines win; only missing keys are appended — so recipes sharing an--output-diraccumulate keys in any order instead of last-writer-wins..mcp.jsonmerges, never replaces. Foreign servers are preserved, and a malformed.mcp.jsonaborts the run instead of being silently overwritten.- No-ops say so. Re-running an already-applied recipe reports
Already up to date — no changes.instead of pretending to apply. - Writes stay inside
--target-root. An--output-dirthat escapes the project root is refused.
Or install the izap-wizard binary globally:
npm install -g @izapai/wizard
izap-wizard doctorCurrent commands
Running from source uses node src/bin.mjs; a published install exposes the
same surface as izap-wizard.
node src/bin.mjs list # add --json for machine-readable output
node src/bin.mjs plan
node src/bin.mjs ai "add iZap MCP to my Next.js app"
node src/bin.mjs audit
node src/bin.mjs doctor # rc 0 on warnings; --strict makes them fatal
node src/bin.mjs mcp add --dry-run
node src/bin.mjs mcp client --stack typescript --dry-run
node src/bin.mjs mcp client --stack python --dry-run
node src/bin.mjs rest client --stack typescript --dry-run
node src/bin.mjs rest client --stack python --dry-run
node src/bin.mjs rest client --stack typescript --auth oauth --dry-run
node src/bin.mjs rest client --stack python --auth oauth --dry-run
node src/bin.mjs webhook receiver --stack typescript --dry-run
node src/bin.mjs webhook receiver --stack python --dry-run
node src/bin.mjs webhook register --stack typescript --dry-run
node src/bin.mjs webhook register --stack python --dry-run
node src/bin.mjs sse client --stack typescript --dry-run
node src/bin.mjs sse client --stack python --dry-run
node src/bin.mjs templates --stack typescript --dry-run
node src/bin.mjs transmissions --stack python --dry-run
node src/bin.mjs send --stack typescript --dry-run
node src/bin.mjs whatsapp connect --dry-runPlatform surfaces
iZap is more than analytics/MCP. The same JWT + business-id header drives three
messaging surfaces the wizard can scaffold:
templates— manage WhatsApp message templates (GET/POST /api/v1/whatsapp_templates,POST .../sync). TS + Python.transmissions— send WhatsApp broadcasts: preview → confirm → status (/api/v1/transmissions/...). TS + Python.send— send a message or approved template into a live chat (POST /api/v1/chats/{chat_id}/messagesand.../messages/template). TS + Python.webhook receiver— verify inbound deliveries withizap-webhook-signature(v1=HMAC-SHA256 of{timestamp}.{raw_body}), reject stale timestamps, and dedupe onizap-webhook-id. TS + Python.webhook register—POST /api/v1/webhook-endpoints/{business_id}and write the one-timesigning_secretto.envasIZAP_WEBHOOK_SECRET. TS + Python.whatsapp connect— generate a WhatsApp Business onboarding page wired into the detected framework (Next.js app/pages route, else a static page). It runs Meta Embedded Signup and forwards the code toPOST /api/v1/businesses/{id}/whatsapp_cloud/registerthrough a server-side proxy soIZAP_JWTnever reaches the browser.
izap-wizard whatsapp connect # scaffolds app/whatsapp/page.tsx (+ server route) on Next.jsYou can also target another directory:
node src/bin.mjs mcp add --target-root /path/to/project
node src/bin.mjs mcp client --stack typescript --output-dir integrations/izapAI-assisted mode (agent handoff)
izap-wizard ai "<goal>" does not call an LLM and needs no API key. It runs the
same deterministic detection + planner, adds framework-specific edit points
(where iZap meets your existing code), and writes an izap-integration-brief.md
you hand to a coding agent (Claude Code, Cursor, or an MCP-connected agent) — or
follow yourself:
$ izap-wizard ai "add iZap MCP to my Next.js app"
Wrote izap-integration-brief.md
├─ detected: next, app router
├─ recipe: mcp-add
├─ edit points:
│ app/api/izap/route.ts (add a Route Handler that calls the iZap client)
│ .env.local (add the iZap env keys — names only)
└─ paste into Claude Code / Cursor to apply--dry-run prints the brief instead of writing it; --json emits the
machine-readable plan for programmatic/MCP consumption.
Detected frameworks (for edit points): Next.js (app/pages router), NestJS, Remix, SvelteKit, Nuxt, Astro, Express/Fastify, Vite, FastAPI, Django, Flask, Rails, Laravel, and Gin. The brief also embeds a language-appropriate "call iZap server-side" snippet. Anything else falls back to a generic edit point.
Implemented in 0.2.1
- Webhook receivers implement the published signing contract:
izap-webhook-signature: v1=<hex>over{timestamp}.{raw_body}, 300s replay window, idempotency onizap-webhook-id webhook registerscaffolds a TS/Python client forPOST /api/v1/webhook-endpoints/{business_id}
Implemented in 0.2.0
Field-QA driven fixes on top of 0.1.0:
- Overwrite protection: recipes refuse to clobber edited files (
--forceto override) .env.exampleunion-merge across recipes sharing an--output-dir- Malformed
.mcp.jsonaborts instead of being replaced; no-op runs report "already up to date" - Goal→recipe ranking: word-boundary matching, notification/reminder vocabulary, and goal-matched recipes always outrank unmatched stack priors
- Quickstart calls
GET /api/v1/auth/users/me(returns your profile with yourbusinesses; the oldGET /api/v1/businessesexample was a POST-only route and 405'd) - TypeScript scaffolds ship a strict
tsconfig.json,@types/node, typed code, and atypecheckscript —tsc --noEmitpasses out of the box - Python/TS clients set request timeouts and surface API error bodies; errors print as one-liners, not stack traces
- Transmissions demos stop at the preview unless run with
--confirm - Webhook receivers validate
IZAP_WEBHOOK_SECRETat boot (no silent request black-hole) and reply with real JSON - Non-TTY
runwithout--yespreviews and exits non-zero instead of writing - TUI input hardening: chunked/CRLF keys,
esc/ctrl-dcancel, stdin EOF exits cleanly; framework picker shows display names and marks the detected framework - Monorepo detection: both stacks report their frameworks (backend primary), Django detects
via
requirements.txt/manage.py, and unverified edit points are marked "create this file" whatsapp connecton non-Next stacks: framework-appropriate env naming plus a concrete backend proxy snippet (Django/FastAPI/Flask/Express)- Flag validation (
--stack/--env/--auth), friendly--target-rooterrors,doctor --strict,list --json, and arepositoryfield on the npm package
Implemented in 0.1.0
- Project detection for mixed Node/Python repos
- Read-only planning mode with recipe recommendations
- Read-only
auditanddoctorcommands for setup inspection .mcp.jsoninstallation/merge for the iZap MCP server- TypeScript MCP client scaffold
- Python MCP client scaffold
- TypeScript REST client scaffold (JWT bootstrap)
- Python REST client scaffold (JWT bootstrap)
- TypeScript REST client scaffold (OAuth 2.0 + PKCE)
- Python REST client scaffold (OAuth 2.0 + PKCE)
- TypeScript webhook receiver scaffold
- Python webhook receiver scaffold
- TypeScript SSE client scaffold
- Python SSE client scaffold
- Dry-run previews for every write
--versionand end-to-end CLI smoke tests- Publishable package (
bin,files,publishConfig, LICENSE) - AI-assisted
aicommand: agent-handoff integration brief (no LLM/API key) - Interactive full-screen wizard (
run/ bare launch) with plain + dry-run fallback - Interactive
--speed slow|normal|fastpacing control - Framework detection across 14 stacks with per-framework brief snippets
- CI publish workflow (push a
wizard-v<version>tag) - Pre-flight confirmation gate (Continue / Change framework / Cancel) before any write
- WhatsApp templates + transmissions (broadcasts) clients (TS + Python)
- WhatsApp Business connect page (Meta Embedded Signup → iZap register), framework-aware
Sources of truth
This scaffold is grounded in the public iZap developer docs:
- https://devs.izap.ai/en/api-reference/mcp
- https://devs.izap.ai/en/api-reference/authentication
- https://devs.izap.ai/en/api-reference/endpoints
- https://devs.izap.ai/en/api-reference/introduction
- https://devs.izap.ai/en/api-reference/webhooks
Design constraints
- Do not read
.envvalues - Never write secrets automatically
- Prefer idempotent writes and explicit merge behavior
- Show planned file changes before applying when
--dry-runis set - Keep recipes small, composable, and easy to audit
Near-term roadmap
- Optional live-LLM
ai --livemode for direct file edits - More edit-point heuristics per framework
Contributing
Issues and pull requests are welcome at versariai/izap-wizard — see CONTRIBUTING.md. Report security issues privately per SECURITY.md.
