Command Line Interface (CLI)
retestr.ai provides a powerful Command Line Interface (CLI) to help you manage your tests and view results directly from your terminal.
Installation
The CLI is available as an npm package. You can install it globally or use it via npx.
npm install -g @vts/cli
# or
pnpm add -g @vts/cli
Authentication
Before you can use the CLI, you need to authenticate with your retestr.ai account.
retestr login
This command will prompt you for your email and password (or API Key) and save your credentials securely to your local configuration.
Configuration
You can manage your CLI configuration using the config command.
# List all configuration
retestr config list
# Set the API server URL (if using a self-hosted instance)
retestr config set serverUrl https://retestr.mycompany.com
# Get a specific configuration value
retestr config get serverUrl
Viewing Diffs (TUI)
One of the most powerful features of the CLI is the Terminal-Based Diff Viewer. This allows you to inspect visual regressions without leaving your terminal, which is perfect for "Test on Commit" workflows.
To view the diff for a specific test run:
retestr view-diff <run-id>
How it works
The CLI downloads the Baseline, Actual, and Diff images for any failed tests in the run and renders them directly in your terminal using high-density block characters (or the iTerm2 image protocol if supported).
Controls
- Baseline / Actual / Diff: Use
Left/Rightarrow keys to toggle between the different image layers. - Zoom: Use
+/-to zoom in and out (if supported by your terminal emulator). - Quit: Press
qorEscto exit the viewer.

Running Tests
Coming soon: You will be able to trigger test runs directly from the CLI using retestr run.