CLI
Every rehearsal command, with its arguments and an example. The 28 commands, grouped by task.
The rehearsal command does everything the console does, from a terminal or a script. It is part of the
rehearsal-kit package. Commands print JSON, so you can pass the output to other tools.
pip install rehearsal-kit
rehearsal loginWithout an installation, run any command through uvx: uvx --from rehearsal-kit rehearsal login.
The CLI uses the server and key that rehearsal login saved. The environment variables REHEARSAL_URL and
REHEARSAL_API_KEY take precedence, which is what a CI job uses. When a command fails, the CLI prints the
server's message and a hint: see Errors.
All commands
Start
| Command | What it does |
|---|---|
rehearsal login | Sign in: approve this terminal in your browser, or paste an API key |
rehearsal whoami | Show the server, workspace and key this machine uses |
rehearsal logout | Forget the saved sign-in on this machine |
Applications and worlds
| Command | What it does |
|---|---|
rehearsal apps | Add, list and upload applications |
rehearsal build | Compile an application into a world |
rehearsal worlds | List practice worlds, their jobs, re-checks and bundles |
rehearsal jobs | Follow and control builds and other long jobs |
Agents and evaluations
| Command | What it does |
|---|---|
rehearsal profiles | List and create agent profiles (agent versions) |
rehearsal eval | Evaluate agent profiles on a world version |
rehearsal runs | Follow runs and read their episodes |
rehearsal compare | Compare agents within a run, or two runs on one world version |
rehearsal improve | Propose a revised agent profile from train/dev failures |
Data
| Command | What it does |
|---|---|
rehearsal export | Export verified trajectories as a dataset |
rehearsal artifacts | List and download exported files |
rehearsal export-example | Write examples/<app>/ from a published world version and its runs |
rehearsal export-replay | Save a job's or run's recorded events (already redacted) as a replay file |
AI assistants
| Command | What it does |
|---|---|
rehearsal mcp | Run the MCP server for AI assistants (stdio; uses your rehearsal login) |
rehearsal skill | Install the Rehearsal skill for Claude Code and other agents |
Run your own server
| Command | What it does |
|---|---|
rehearsal serve | Run the API and console |
rehearsal worker | Run a job worker |
rehearsal up | Apply database migrations; starts a local database in Docker only when no cloud database is set |
rehearsal migrate | Apply database migrations |
rehearsal bootstrap | Create an organisation, project, and admin API key |
rehearsal users | Console accounts (runs on the server) |
rehearsal openapi | Print the OpenAPI document |
rehearsal prices | Model prices from every source, for the configured model chains |
Coming soon
| Command | What it does |
|---|---|
rehearsal train | Train a model on a world with reinforcement learning |
rehearsal run-bundle | Start a world from an exported bundle on your own machine |
Two options work everywhere: rehearsal --version prints the installed version, and --help after any
command prints its arguments.
Start
rehearsal login
Sign in: approve this terminal in your browser, or paste an API key.
The terminal shows a confirmation code and opens the console. Check that the browser shows the same code, then choose Approve. The terminal receives a key with "Build and evaluate" access and saves it for your user only. See Sign in and keys.
rehearsal login [--url <url>] [--with-key] [--no-browser]| Argument | Default | Meaning |
|---|---|---|
--url <url> | Rehearsal server (default: REHEARSAL_URL, the last server you signed in to, or https://rehearsalkit.xyz) | |
--with-key | Paste an API key instead of approving in the browser (servers, CI) | |
--no-browser | Print the approval link instead of opening a browser. |
rehearsal login --url https://rehearsal.example.comSigning in to Rehearsal at https://rehearsal.example.com
Approve this sign-in in your browser:
https://rehearsal.example.com/app/cli-login/?code=ZKCZ-BVBS
Confirmation code: ZKCZ-BVBS (the browser shows the same code)
Waiting for approval (Ctrl+C to cancel)....
✓ Signed in to Acme (project default) at https://rehearsal.example.com.
Saved to ~/.config/rehearsal/config.json (readable by you only). The CLI, the Python SDK and the MCP server use it.
Next: rehearsal worlds listrehearsal login --url https://rehearsal.example.com --with-keyWith --with-key the terminal asks for a key and hides what you paste. Use it on a server or in CI, where no browser is at hand.
rehearsal whoami
Show the server, workspace and key this machine uses.
The key is shown by its prefix only.
rehearsal whoamirehearsal whoamiServer: https://rehearsal.example.com
Workspace: Acme (project default)
Key: rh_1a2b3c4d_… access: write, evaluator
Signed in: saved sign-in (~/.config/rehearsal/config.json)rehearsal logout
Forget the saved sign-in on this machine.
This removes the saved key from this machine only. To disable the key everywhere, revoke it on the console's API keys page.
rehearsal logoutrehearsal logoutSigned out. The saved key is removed from this machine; revoke it on the console's API keys page to disable it everywhere.Applications and worlds
rehearsal apps
Add, list and upload applications.
| Action | What it does |
|---|---|
rehearsal apps import-catalog | Register the bundled catalog of open-source applications |
rehearsal apps list | Applications in this workspace |
rehearsal apps add <name> [--git <git>] [--commit <commit>] [--path <path>] [--image <image>]... [--policies-file <policies_file>] | Add an application from a git repository or a local folder |
rehearsal apps upload <app_id> <archive> | Upload a .tar.gz of an application's source |
Arguments of rehearsal apps add:
| Argument | Default | Meaning |
|---|---|---|
<name> | required | A name for the application, unique in the workspace. |
--git <git> | Address of a public git repository. | |
--commit <commit> | The full commit SHA to pin. A branch name is not reproducible. | |
--path <path> | A folder on the server's own disk instead of a repository. It must be inside the server's REHEARSAL_SOURCE_ROOTS. | |
--image <image> | One service and its pinned image, as service=image:tag@sha256:.... Repeat it for each service. | |
--policies-file <policies_file> | A text file of rules the agent must follow, in plain words. |
Arguments of rehearsal apps upload:
| Argument | Default | Meaning |
|---|---|---|
<app_id> | required | Application id, from rehearsal apps list. |
<archive> | required | Path to a .tar.gz of the application's source. |
rehearsal apps add helpdesk --git https://github.com/you/app --commit 0123456789abcdef0123456789abcdef01234567 --image app=you/app:1.4@sha256:<digest> --policies-file policies.txt{
"id": "app_da77a395b6852c5e",
"project_id": "prj_7f4a9532b99af3d2",
"name": "helpdesk",
"connection_mode": "source",
"source": {
"kind": "git",
"url": "https://github.com/you/app",
"commit": "0123456789abcdef0123456789abcdef01234567"
},
"images": {
"app": "you/app:1.4@sha256:..."
},
"policies": "...",
"notes": "",
"created_at": "2026-10-10T20:49:54.962887+00:00",
"removed_at": null
}rehearsal apps list[
{
"id": "app_e184a0bb1120d4ce",
"name": "gitea",
"source": {
"ref": "v28.1.0",
"url": "https://github.com/go-gitea/gitea",
"kind": "git",
"commit": "4ebd5e319b6a9e629bfd7a04292a6fe85b08dee9"
},
"notes": "split=development; domain=code collaboration / issue tracking; license=MIT"
}
]rehearsal build
Compile an application into a world.
A build spends model budget and takes 1 to 3 hours. See Build a practice world.
rehearsal build <app_id> [--model <model>] [--budget <budget>] [--scenarios <scenarios>] [--watch]| Argument | Default | Meaning |
|---|---|---|
<app_id> | required | Application id, from rehearsal apps list. |
--model <model> | Model chain for the World Compiler, in place of the server's default. | |
--budget <budget> | Model spend in US dollars at which the build stops itself. | |
--scenarios <scenarios> | 8 | How many jobs to write. |
--watch | Stay attached and print each event until the build ends. |
rehearsal build <app_id> --budget 6 --watchThe command prints job_id, world_id, world_version_id and version, then one line for each event: the time, the event type and a summary.
rehearsal worlds
List practice worlds, their jobs, re-checks and bundles.
validate spends model budget: it tries each job once with a live agent.
| Action | What it does |
|---|---|
rehearsal worlds list | Worlds and their versions |
rehearsal worlds show <wv_id> | One world version |
rehearsal worlds scenarios <wv_id> | The jobs of a world version |
rehearsal worlds validate <wv_id> | Re-check every job of a published world |
rehearsal worlds bundle <wv_id> [--include-images] | Export a portable world bundle |
Arguments of rehearsal worlds bundle:
| Argument | Default | Meaning |
|---|---|---|
<wv_id> | required | World version id, from rehearsal worlds list. |
--include-images | Put the container images in the bundle, so it needs no registry. The file is much larger. |
rehearsal worlds listA workspace with no world prints []. Each world has a name, its application_id and its versions; each version has an id, a version number and a status.
rehearsal worlds scenarios <wv_id>Each job is printed with its id, slug, family, split and status.
rehearsal jobs
Follow and control builds and other long jobs.
retry restarts a failed or stopped job from its last saved step. Finished steps are not repeated.
| Action | What it does |
|---|---|
rehearsal jobs show <job_id> | Show a job |
rehearsal jobs watch <job_id> | Watch a job |
rehearsal jobs pause <job_id> | Pause a job |
rehearsal jobs resume <job_id> | Resume a job |
rehearsal jobs stop <job_id> | Stop a job |
rehearsal jobs retry <job_id> | Retry a job |
rehearsal jobs show <job_id>rehearsal jobs retry <job_id>Agents and evaluations
rehearsal profiles
List and create agent profiles (agent versions).
| Action | What it does |
|---|---|
rehearsal profiles list | Agent profiles and versions |
rehearsal profiles create <name> [--prompt-file <prompt_file>] [--model <model>] [--external] | Create an agent profile |
Arguments of rehearsal profiles create:
| Argument | Default | Meaning |
|---|---|---|
<name> | required | Name of the agent. A second profile with the same name becomes version 2. |
--prompt-file <prompt_file> | A text file with the agent's instructions (its system prompt). Without it, the platform default. | |
--model <model> | Model chain for this agent, in place of the server's default. | |
--external | Actions come from your own agent through the API. |
rehearsal profiles create support-agent --prompt-file instructions.txt{
"id": "prof_7f37a04a339513ca",
"project_id": "prj_7f4a9532b99af3d2",
"name": "support-agent",
"version": 1,
"spec": {
"name": "support-agent",
"version": 1,
"driver": "llm",
"system_prompt": "...",
"tool_guidance": {},
"model": null,
"temperature": 0.2,
"max_turns_per_actor": 25
},
"parent_id": null,
"created_by": "user",
"rationale": "",
"created_at": "2026-10-10T20:49:24.980272+00:00"
}rehearsal profiles listEach profile is printed with its id, name, version and created_by.
rehearsal eval
Evaluate agent profiles on a world version.
An evaluation spends model budget for each episode. Without --split or --repeats, every approved job runs twice. See Evaluate an agent.
rehearsal eval <wv_id> --profile <profile>... [--split <split>]... [--repeats <repeats>] [--budget <budget>] [--watch]| Argument | Default | Meaning |
|---|---|---|
<wv_id> | required | World version id, from rehearsal worlds list. |
--profile <profile> | required | Agent profile id. Repeat the option to compare several agents in one run. |
--split <split> | Train, dev or holdout; default every split. | |
--repeats <repeats> | Default 2. | |
--budget <budget> | Model spend in US dollars at which the run stops itself. | |
--watch | Stay attached, print each event, then print the summary. |
rehearsal eval <wv_id> --profile <profile_id> --split dev --repeats 2 --watchThe command prints run_id, job_id, episodes and shards, then one line for each event, then the summary of the run. Use Rehearsal in CI shows the summary's shape.
rehearsal runs
Follow runs and read their episodes.
| Action | What it does |
|---|---|
rehearsal runs show <run_id> | Status and scores of a run |
rehearsal runs watch <run_id> | Follow a run live |
rehearsal runs episodes <run_id> | One line per episode |
rehearsal runs episode <episode_id> | What happened in one episode |
rehearsal runs episodes <run_id>Each episode is printed with its id, scenario, split, profile, status, reward and termination.
rehearsal runs episode <episode_id>rehearsal runs show run_doesnotexistError (404): Run run_doesnotexist not found
Check the id: list what exists with 'rehearsal apps list', 'worlds list', 'profiles list' or 'runs show'.rehearsal compare
Compare agents within a run, or two runs on one world version.
rehearsal compare <run_a> [<run_b>]| Argument | Default | Meaning |
|---|---|---|
<run_a> | required | A run id. |
<run_b> | A second run id on the same world version. Without it, the agents inside run_a are compared. |
rehearsal compare <run_a> <run_b>rehearsal improve
Propose a revised agent profile from train/dev failures.
This spends a small amount of model budget. It reads only failed train and dev episodes. See Improve an agent.
rehearsal improve <profile_id> <run_id>| Argument | Default | Meaning |
|---|---|---|
<profile_id> | required | Agent profile id, from rehearsal profiles list. |
<run_id> | required | A finished run that has train or dev episodes of this agent. |
rehearsal improve <profile_id> <run_id>The command prints a job_id. Follow it with rehearsal jobs show <job_id>.
Data
rehearsal export
Export verified trajectories as a dataset.
rehearsal export <run_ids>... [--split <split>]...| Argument | Default | Meaning |
|---|---|---|
<run_ids> | required | One or more run ids. |
--split <split> | Which split to export. Repeat for several. Default: train. |
rehearsal export <run_id> --split trainThe command prints a job. The dataset then appears in rehearsal artifacts list.
rehearsal artifacts
List and download exported files.
| Action | What it does |
|---|---|
rehearsal artifacts list | Exported files |
rehearsal artifacts download <artifact_id> <dest> | Download one exported file |
Arguments of rehearsal artifacts download:
| Argument | Default | Meaning |
|---|---|---|
<artifact_id> | required | Exported file id, from rehearsal artifacts list. |
<dest> | required | Where to save the file. |
rehearsal artifacts listrehearsal artifacts download <artifact_id> dataset.jsonlrehearsal export-example
Write examples/<app>/ from a published world version and its runs.
rehearsal export-example <wv_id>| Argument | Default | Meaning |
|---|---|---|
<wv_id> | required | World version id, from rehearsal worlds list. |
rehearsal export-example <wv_id>rehearsal export-replay
Save a job's or run's recorded events (already redacted) as a replay file.
rehearsal export-replay <stream> <dest> [--episode <episode>]| Argument | Default | Meaning |
|---|---|---|
<stream> | required | Job_... or run_... id. |
<dest> | required | Where to save the replay file. |
--episode <episode> | Only this episode's events (runs) |
rehearsal export-replay <run_id> replay.jsonAI assistants
rehearsal mcp
Run the MCP server for AI assistants (stdio; uses your rehearsal login).
AI assistants start this command themselves. See AI assistants.
rehearsal mcprehearsal mcpThe server talks over standard input and output, so it prints nothing in a terminal. It needs the mcp extra: pip install 'rehearsal-kit[mcp]'.
rehearsal skill
Install the Rehearsal skill for Claude Code and other agents.
rehearsal skill <action> [--dir <dir>]| Argument | Default | Meaning |
|---|---|---|
<action> | required | install copies the skill into a skills folder. print writes it to the terminal. One of: install, print. |
--dir <dir> | Skills folder (default ~/.claude/skills) |
rehearsal skill install --dir ~/.claude/skillsRun your own server
These commands run on the server, not against it. They need the server extra: pip install 'rehearsal-kit[server]'.
rehearsal serve
Self-hosted only Run the API and console.
rehearsal serve [--host <host>] [--port <port>]| Argument | Default | Meaning |
|---|---|---|
--host <host> | 127.0.0.1 | Address to listen on. Use 0.0.0.0 only behind a proxy that adds HTTPS. |
--port <port> | 7800 | Port to listen on. |
rehearsal serve --host 127.0.0.1 --port 7800Rehearsal API on http://127.0.0.1:7800, database 127.0.0.1rehearsal worker
Self-hosted only Run a job worker.
Builds and evaluations run only while a worker is running. See Install with Docker Compose.
rehearsal worker [--kinds <kinds>] [--once]| Argument | Default | Meaning |
|---|---|---|
--kinds <kinds> | Comma-separated job kinds. | |
--once | Exit when the queue is empty. |
rehearsal worker --kinds world_buildWithout --kinds, the worker takes every kind of work: world_build, world_validate, evaluation, improvement, dataset_export and bundle_export.
rehearsal up
Self-hosted only Apply database migrations; starts a local database in Docker only when no cloud database is set.
On a server whose REHEARSAL_DATABASE_URL points at another machine, this only applies migrations.
rehearsal uprehearsal uprehearsal migrate
Self-hosted only Apply database migrations.
rehearsal migraterehearsal migraterehearsal bootstrap
Self-hosted only Create an organisation, project, and admin API key.
Run it once on a new server. The key is shown once: save it.
rehearsal bootstrap [--org <org>] [--project <project>]| Argument | Default | Meaning |
|---|---|---|
--org <org> | Local | Name of the organisation to create. |
--project <project> | default | Name of the project to create in it. |
rehearsal bootstrap --org Acme --project defaultproject: prj_7f4a9532b99af3d2
admin API key (shown once): rh_1a2b3c4d_...
export REHEARSAL_API_KEY=rh_1a2b3c4d_...rehearsal users
Self-hosted only Console accounts (runs on the server).
The console needs a person's account. This command creates one in the project you name.
| Action | What it does |
|---|---|
rehearsal users add <email> [--name <name>] --project <project> [--role <role>] [--no-password] | Give a person access to a project's organisation |
Arguments of rehearsal users add:
| Argument | Default | Meaning |
|---|---|---|
<email> | required | The person's email address. They sign in to the console with it. |
--name <name> | Display name. Without it, the part of the email before the @. | |
--project <project> | required | Project id, as printed by bootstrap. |
--role <role> | owner | What the person may do in the organisation. One of: owner, admin, member. |
--no-password | The person signs in with Google only. |
rehearsal users add you@example.com --project <project_id>Password (10+ characters):
Repeat:
you@example.com can sign in to the console as owner of project prj_7f4a9532b99af3d2.rehearsal openapi
Self-hosted only Print the OpenAPI document.
rehearsal openapirehearsal openapi > openapi.jsonrehearsal prices
Self-hosted only Model prices from every source, for the configured model chains.
rehearsal pricesrehearsal pricesFor each model chain, the command prints the price the server charges at, with its source and date, and the range that other hosts charge.
Coming soon
rehearsal train
Coming soon Train a model on a world with reinforcement learning.
Not built yet. The command prints a message that says so and exits.
rehearsal train <wv_id> [--base-model <base_model>] [--rounds <rounds>] [--rollouts <rollouts>] [--serve-url <serve_url>]| Argument | Default | Meaning |
|---|---|---|
<wv_id> | required | World version id, from rehearsal worlds list. |
--base-model <base_model> | Qwen/Qwen3-1.7B | Not used yet. |
--rounds <rounds> | 2 | Not used yet. |
--rollouts <rollouts> | 4 | Not used yet. |
--serve-url <serve_url> | http://127.0.0.1:8001/v1 | Not used yet. |
rehearsal train <wv_id>Training a model on your practice worlds (reinforcement learning) is coming soon. Every episode already ends with a verified score from the application's database; today you can export verified episodes as a dataset with `rehearsal export`, and improve an agent's instructions with `rehearsal improve`.rehearsal run-bundle
Coming soon Start a world from an exported bundle on your own machine.
Not built yet. The command prints a message that says so and exits.
rehearsal run-bundle <bundle>| Argument | Default | Meaning |
|---|---|---|
<bundle> | required | Not used yet. |
rehearsal run-bundle world.tarStarting a world from a bundle on your own machine is coming soon. Today, evaluate the published world through the server: rehearsal eval <world_version_id> --profile <agent_id>.Was this page helpful?