- Initialize new projects from templates (Handlebars & Nunjucks support)
- Create Moleculer services interactively
- Connect to a running Moleculer system with REPL
- Call service actions and emit events from the command line
- Start a local broker with REPL
- Node.js >= 22
npm install -g moleculer-cli# Init from an official template
moleculer init project my-first-project
# Init a module
moleculer init module my-module
# Init from a GitHub repo
moleculer init username/repo my-project
# Init from a local template
moleculer init ./my-template my-project
# Provide answers from a JSON file (non-interactive)
moleculer init project my-project --answers answers.json
# Provide answers inline
moleculer init project my-project --@name=my-project --@description="My project"
# Skip npm install
moleculer init project my-project --no-install# Create a service interactively
moleculer create service
# Create a named service
moleculer create service users
# Create a TypeScript service
moleculer create service users --typescriptStart a new ServiceBroker locally and switch to REPL mode.
moleculer start
# With custom config
moleculer start -c moleculer.config.js
# With hot-reload
moleculer start --hotStart a new ServiceBroker, connect to a transporter and switch to REPL mode.
# With TCP transporter
moleculer connect
# With NATS transporter
moleculer connect nats://localhost:4222
# With Redis transporter
moleculer connect redis://localhost
# With MQTT transporter
moleculer connect mqtt://localhost# Call an action via NATS
moleculer call greeter.hello -t nats://localhost:4222
# Call with parameters (JSON after --)
moleculer call math.add -t nats://localhost:4222 -- --a=5 --b=3# Emit an event
moleculer emit user.created -t nats://localhost:4222 -- --id=123
# Broadcast an event
moleculer emit user.created -t nats://localhost:4222 --broadcast -- --id=123Save a template URL under a short name for use with moleculer init.
# Create an alias
moleculer alias-template my-template https://github.com/user/repo
# Use the alias
moleculer init my-template my-projectPlease read our documentation on Moleculer site
The moleculer-cli project init command is based on vue-cli project.
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
Moleculer-cli is available under the MIT license.
Copyright (c) 2026 MoleculerJS
