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
- As a Lambda function in AWS - see Imposter AWS Lambda
- As a Docker container - see Imposter Docker container
- As a JAR file on the JVM - see Imposter JAR file
Embedded in tests
- Embedded within your Java/Kotlin/Scala/JVM unit tests - see JVM bindings
- Embedded within your JavaScript/Node.js unit tests - see JavaScript bindings
Within your CI/CD pipeline
- Use the Imposter GitHub Actions to start and stop Imposter during your CI/CD pipeline.
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 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:
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
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:
CLI usage
See full usage instructions on Imposter CLI.
What's next
- Learn how to use Imposter with the Configuration guide.