Skip to main content
The egma-cli package installs the egma command. Use it from the repository that contains your voice agent.

Install

Install Node.js 22 or newer, then run:
Run the same install command to update the CLI. If you use a coding agent, install the Egma skills too.

Sign in and initialize

login opens a browser for approval. Select the project that this terminal will use. Outside an initialized repository, the default instance is https://app.egma.ai. For self-hosted Egma, give both commands your instance URL:
init connects the repository to an existing project and pulls its agents, connections, suites, and tests. It creates egma/config.yaml and egma/tests/. It does not create a project. If your credential can access several projects, init lists their IDs. Run egma init --project with the ID you want. A login already scoped to a project does not take --project. Running init again for the same project refreshes the repository. A repository already connected to another project is left unchanged.

Connect an agent

An agent identifies your LiveKit worker or Retell agent in Egma. A connection tells Egma how to reach it for a simulation. Register the agent, then add a connection.
Make your Retell API key available as EGMA_RETELL_API_KEY in the terminal. List the available Retell agents, then register the one you want to test in Egma:
Set EGMA_AGENT_ID to the Egma ID printed by register and RETELL_AGENT_ID to the provider ID from the options list. Add a chat connection:
The first connection saves the Retell agent ID and credential in Egma. Later setup can reuse them. For the other Retell connection choices, see Retell.
The connection command prints its Egma connection ID and refreshes egma/config.yaml. Use those IDs when you start a run. Add --name to give a connection a display name.

Create a suite and a test

Each direct directory under egma/tests/ is one suite. The CLI writes its suite.yaml with the suite ID and name. Create egma/tests/appointment-booking/no-availability.md:
Use a persona name from egma persona list. Match each mock name and response shape to your agent’s real tool. This example assumes check_availability returns an object with a slots array. LiveKit simulations require the Python or JavaScript hook. Tools without a matching mock run their real implementations. Their calls are still recorded from the agent’s point of view. A call answered by a test mock is marked mocked in the transcript.

Test file fields

For Retell startup data, add:
For LiveKit, use job_dispatch_metadata instead. The worker reads that value as JSON from ctx.job.metadata. Put only the field your platform uses in the test. See Write a test for test design and Personas for persona selection. Test files select personas. Model and voice settings belong to the project and are edited in Personas. First use saves the persona’s default settings; all tests selecting that persona share the saved values. pull and push keep the selection in the file without copying those settings into it.

Sync with Egma

push validates the repository and submits all its suites and tests as one update. If validation or a remote conflict prevents the update, no part of that remote change is applied. A successful push writes the saved IDs and versions back to your files. pull refreshes remote content and keeps local drafts, including locally edited tests. Read its report for files it kept. If a push reports a conflict, pull the current state, reconcile the changes it identifies, and push again. Use the CLI to delete a synced test or suite:
These commands remove the remote resource before removing local files. If Egma refuses the deletion, the local files stay. You can remove an unpushed test draft directly from your repository.

Start a run

Set EGMA_AGENT_ID and EGMA_CONNECTION_ID to the IDs in egma/config.yaml:
This command pushes the repository first, then starts one run of the complete suite against the selected connection. A failed push prevents the run from starting. Open the printed results URL. The command returns after the run starts; its success exit code does not mean the simulations have finished or passed. See Start and follow a run. To cancel a run, set EGMA_RUN_ID to its ID and run:

Set up monitoring

For an agent already connected to Retell:
The command reuses the agent’s saved Retell identity and credential. For a new monitoring-only agent, also pass --retell-agent and supply EGMA_RETELL_API_KEY. Stop Retell monitoring with:
For LiveKit, add the monitoring hook to your worker using the Python SDK or JavaScript SDK. The CLI’s LiveKit monitoring commands return setup guidance and exit with code 1; they do not change the worker.

Use the CLI in CI

Create a key for the repository’s project:
The key is shown once and is not saved by this command. Store it in your CI secret store as EGMA_API_KEY. Commit egma/config.yaml, suite files, and tests; keep credentials out of Git. The CLI uses EGMA_API_KEY when it is set, so CI does not need browser login. Use Automate tests in CI to wait for completion and make a release decision with the API.

Command reference

Append --help to any command to see its arguments and options. Use --cwd to run a command against another repository.

Credentials and repository settings

Connection setup also accepts provider credentials as JSON through --credentials-stdin. It uses a stored provider credential first; otherwise, standard input takes precedence over environment values. Run egma agent connection add --help for the supported fields. Only login, logout, and init accept --url. Other repository commands use the origin in egma/config.yaml. logout does not remove this folder or revoke a key supplied through EGMA_API_KEY.

Exit codes

The CLI has no JSON output mode or command that waits for a run’s grades. Use the API reference for scripts that need structured results.