Install the CLI

Install the Rehearsal CLI from npm and check that it works.

The Rehearsal CLI runs your saved tests, reads their results and connects an app on your computer to Rehearsal. You create tests in the app, with Re:agent.

The CLI needs Node.js 24 or newer. Check your version with node --version.

Install Link to Install

Terminal
npm install -g @rehearsal-labs/cli

This installs two commands, rehearsal and rhl. They are the same program, and rhl is shorter to type. Help, examples and JSON output always say rehearsal.

Other package managers Link to Other package managers

Package managerCommand
pnpmpnpm add -g @rehearsal-labs/cli
Yarn 1yarn global add @rehearsal-labs/cli
Bunbun add -g @rehearsal-labs/cli

The CLI runs on Node.js whichever one installs it, so it still needs Node.js 24 or newer.

Check that it works Link to Check that it works

Terminal
rehearsal --version

This prints the version you installed. To see every command, run rehearsal help. Help works offline and without signing in.

Terminal
rehearsal helprehearsal help runsrehearsal help agent-workflow

rehearsal help agent-workflow is a page written for coding agents. It tells an agent how to find your tests, run them and read the results.

Log in Link to Log in

Terminal
rehearsal login

Your browser opens. Approve the request there, and the CLI is signed in. On a machine without a browser, run rehearsal login --no-browser. It prints a link that you open somewhere else.

Update Link to Update

Run the install command again. npm replaces the version you have with the newest one.

Terminal
npm install -g @rehearsal-labs/clirehearsal --version

Remove Link to Remove

Log out first. That ends the sign-in and deletes the file that holds it. Then remove the package.

Terminal
rehearsal logoutnpm uninstall -g @rehearsal-labs/cli

The CLI keeps your sign-in in ~/.config/rehearsal/credentials.json, or under $XDG_CONFIG_HOME when that is set. Only your user account can read the file.

Next steps Link to Next steps