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: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.- Retell
- LiveKit
Make your Retell API key available as Set 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.
EGMA_RETELL_API_KEY in the terminal. List the available Retell agents, then register the one you want to test in Egma: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: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
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:
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:
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:
Start a run
SetEGMA_AGENT_ID and EGMA_CONNECTION_ID to the IDs in egma/config.yaml:
EGMA_RUN_ID to its ID and run:
Set up monitoring
For an agent already connected to Retell:--retell-agent and supply EGMA_RETELL_API_KEY. Stop Retell monitoring with:
1; they do not change the worker.
Use the CLI in CI
Create a key for the repository’s project: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.