<% title = 'command line' description = 'Command line parameters for starting mountebank' %> <%- include('../_header') -%>

Configuring mountebank

The basic command line structure is:

mb [command=start] [options...]

mountebank commands

As mountebank has grown in functionality, the number of commands and options has increased significantly. The links below attempt to simplify that configuration based on the core mountebank commands.

mb start
<%- include('cli/start') -%>
mb stop
<%- include('cli/stop') -%>
mb restart
<%- include('cli/restart') -%>
mb save
<%- include('cli/save') -%>
mb replay
<%- include('cli/replay') -%>
mb help
<%- include('cli/help') -%>

Saving test data: config files and formatters

Note that mb is not persistent by default. Absent the datadir or impostersRepository options, stopping and restarting mb will lose all stubs and all requests. The following two mb commands work in tandem to allow you to save and reload test data:

mb save --savefile mb.json --formatter path/to/module
mb restart --configfile mb.json --formatter path/to/module

The configfile sends a PUT command to /imposters. View the JSON contract to see what the contents should look like.

The formatter is optional. If specified, it gives you total control over the format of the test data saved to disk, which allows you to split the content in separate files or convert to a format used by other service virtualization tools. The links below describe the default formatter for configuration files as well as how to define a custom formatter.

Default config file parsing
<%- include('cli/configFiles') -%>
Custom formatters
<%- include('cli/customFormatters') -%>
<%- include('../_footer') -%>