Skip to content

nwire CLI

bash
pnpm exec nwire <command> [args]
# or globally:
pnpm add -g @nwire/cli
nwire <command>

Commands

nwire dev

Boots dev-all topology + opens Studio in parallel.

bash
nwire dev
# equivalent to:
#   NWIRE_TOPOLOGY=dev-all pnpm exec vite-node apps/run.ts &
#   cd packages/nwire-studio && pnpm dev

Watches modules/**, apps/**, packages/nwire-*/src/** and restarts the wire on save. Studio's HMR handles its own reloads.

nwire run <wire>

Runs a single wire topology. Resolves apps/topologies/<wire>.topology.ts.

bash
nwire run lms              # → apps/topologies/lms.topology.ts
nwire run prod-split       # → apps/topologies/prod-split.topology.ts

Equivalent to NWIRE_TOPOLOGY=<wire> pnpm exec vite-node apps/run.ts.

nwire cache

Builds .nwire/*.json static reflection cache from your apps.

bash
nwire cache
# wrote 4 apps, 9 modules, 25 actions, 23 events, 18 routes to .nwire/

Studio reads from this cache via Vite middleware at /__nwire/manifest.json. Run after adding/renaming actions, modules, etc. (nwire dev runs it automatically on first start.)

nwire call <action> '<json-input>'

Dispatches an action via the running learnflow-please wire. Single-shot.

bash
nwire call submissions.submit-answer \
  '{"studentId":"avi","exerciseId":"ex-1","answer":"alef"}'

Useful for shell scripts, smoke tests, cron-replacements during dev. Equivalent to a curl against /_nwire/dispatch but typed.

nwire please [...args]

Passthrough to the @nwire/please runner. Use for arbitrary scripts that need the runtime booted.

bash
nwire please scripts/reseed.ts --tenant school-tlv

nwire ls

Lists every wire (topology) and every action grouped by app + module.

bash
nwire ls

# wires:
#   dev-all      (all 4 apps, in-memory bus)
#   lms          (lms-only)
#   lx           (lx-only)
#   competency   (competency-only)
#
# actions:
#   learnflow/submissions
#     submissions.submit-answer
#     submissions.flag-for-review
#     submissions.grade-submission
#     …
#   learnflow/enrollments
#     enrollments.enroll-student
#     …

nwire studio

Launches Studio (@nwire/studio) on port 7777. Builds the static cache first if needed.

nwire help

Lists every command + flag.

Conventions

Env varPurpose
NWIRE_TOPOLOGYTopology name to run (overrides argv)
NWIRE_INSPECT_URLWhere Studio's /_nwire/* proxy points by default
PORTOverride topology's HTTP port

See also

MIT licensed.