← Back to Docs

Using the Emtrey CLI


The Emtrey CLI is a command-line tool that allows developers to connect their web application to the Emtrey service. The main purpose of the Emtrey CLI is to scan your web application for the latest changes, capture renders of these changes and send them to the Emtrey service for processing.


Before you can use Emtrey CLI, you will need to make sure that you have Node (and it’s accompanying package manager, npm) installed on your machine.

NOTE: You do not need to install emtrey globally (eg. npm i -g emtrey) if you have npm >= 5.2 installed on your machine.

How It Works

When you run Emtrey CLI on an application, it performs several important tasks:

  • Records the active git branch
  • Scans all known routes for changes
  • Renders views and takes a screen capture
  • Uploads all screen captures for run to Emtrey service

Once the Emtrey service has received the changes identified by Emtrey CLI, it begins to compare it against the previous run. This allows Emtrey to highlight the visual differences and queue them for review by you or your team.

Running the CLI

Before you run Emtrey CLI:
  1. Check out the branch you would like to compare to master or main.
  2. Start your web application locally.
  3. Once your application is up and running, you can run the Emtrey CLI using the following command from the root directory of your project:
npx emtrey@latest --port=<PORT>

where the port parameter tells Emtrey CLI the port number of your application running locally. For example, the default settings for a React application tells it to start running on port 8080.

NOTE: If you have customized the settings for your application, you will need to adjust the parameters shown in the above example.