Skip to content

Running Imposter with the CLI

There are many ways to run Imposter. This section describes using the command line interface (CLI) tool.

Other ways to run Imposter

Standalone mock server

Embedded in tests

CLI Features

  • Start mocks (imposter up)
  • Generate mock configuration from OpenAPI files (imposter scaffold)
  • Supports all plugins
  • Supports JVM and Docker engine types
  • Supports both 'core' and 'all' distributions

Installation

Prerequisites

You must have Docker or a JVM installed.

Homebrew

If you have Homebrew installed:

brew tap gatehill/imposter
brew install imposter

Shell script

Or, use this one liner (macOS and Linux only):

curl -L https://raw.githubusercontent.com/gatehill/imposter-cli/main/install/install_imposter.sh | bash -

Other installation options

See the full Installation instructions for your system.

Example

$ cd /path/to/config
$ imposter up

Starting server on port 8080...
Parsing configuration file: someapi-config.yaml
...
Mock server is up and running

Different distributions

The previous command starts Imposter using the 'core' distribution, which includes common plugins only. To use the 'all' distribution, which includes all plugins, use the -t (engine type) flag:

$ imposter up -t docker-all

CLI usage

See full usage instructions on Imposter CLI.


What's next