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

Within your CI/CD pipeline

CLI Features

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

Installation

Prerequisites

The CLI itself has no dependencies. Additional prerequisites depend on the engine type you choose to run Imposter with:

  • Native binary (default from Imposter 5.x onwards) — no dependencies.
  • Docker — requires Docker to be installed.
  • JVM — requires a JVM to be installed. The JVM engine is only available for Imposter 4.x and earlier.

Homebrew

If you have Homebrew installed:

brew tap imposter-project/imposter
brew install imposter
Homebrew installation troubleshooting

If you previously installed Imposter using Homebrew from the deprecated tap gatehill/imposter, you may need to run the following command to update your Homebrew installation:

brew untap gatehill/imposter
brew tap imposter-project/imposter

Shell script

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

curl -L https://raw.githubusercontent.com/imposter-project/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

Engine types

The CLI can run Imposter using different engines. Choose the one that suits your environment:

Engine type Flag value Prerequisites Notes
Native binary native None Default from Imposter 5.x onwards. No dependencies.
Docker docker Docker Runs Imposter inside a Docker container.
JVM jvm JVM Imposter 4.x and earlier only.

Use the -t (engine type) flag to choose the engine:

$ imposter up -t docker

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, append -all to the engine type:

$ imposter up -t docker-all

CLI usage

See full usage instructions on Imposter CLI.


What's next