Command-line tool
@dialgem/cli: manage agents, phone numbers and calls from your terminal, and test a prompt with a text chat instead of a phone call.
@dialgem/cli is a command-line tool for Dialgem. It is a thin layer over the TypeScript SDK, so it can reach exactly the routes the SDK can. Use it for quick checks, scripts and CI.
It needs Node 20 or later.
Install
npm install -g @dialgem/cliThis installs the dialgem command.
Sign in
Create an API key, then:
dialgem loginIt asks for the key and saves it to ~/.dialgem/config.json, readable only by you. To skip the prompt, pass --key. dialgem whoami shows which organization and key are in use, and dialgem logout forgets the saved key.
Set DIALGEM_API_KEY to override the saved key, which is the right way to supply one in CI. DIALGEM_CONFIG_DIR moves the folder the config file lives in. Give the key only the scopes the commands you run need.
Agents
dialgem agents list
dialgem agents get AGENT_ID
dialgem agents create --name "Front desk" \
--prompt "You answer for a dental clinic." --voice VOICE_ID
dialgem agents update AGENT_ID --first-message "Hello!" --data '{"temperature":0.3}'
dialgem agents publish AGENT_ID
dialgem agents versions AGENT_ID
dialgem agents delete AGENT_ID
dialgem voicescreate and update take --name, --prompt, --voice, --first-message, --llm-model and --language. For any other field, use --data with inline JSON, or @file.json to read it from a file. Field names are the API's own, as in Prompt agents. publish freezes the current draft as a numbered version.
Test with text
dialgem chat AGENT_ID "Do you have anything on Friday?"Sends one message to the agent and prints its reply. It tests a prompt without placing a phone call. See Text chat.
Phone numbers
dialgem numbers list
dialgem numbers search --area-code 415
dialgem numbers buy +14155550100
dialgem numbers assign NUMBER_ID --agent AGENT_ID
dialgem numbers delete NUMBER_IDsearch also takes --country (default US), --contains and --limit. assign accepts --version to pin a published agent version.
numbers buy charges your account. It only works when number purchase is switched on for you.
Calls
dialgem calls start --from +14155550100 --to +14155550123 --agent AGENT_ID
dialgem calls list --status completed --limit 10
dialgem calls get CALL_ID --text
dialgem calls stop CALL_ID
dialgem calls delete CALL_IDcalls start takes --vars (inline JSON or @file.json) for variables. calls list filters by --agent, --status and --direction. calls get --text prints just the transcript.
calls start dials a real number and uses credit. Use a test number while you are scripting.
Output and errors
Output is a table in a terminal and JSON when piped to another command or when you pass --json, so it works in scripts:
dialgem calls list --json | jq '.[0].id'Errors are printed to standard error and the command exits with code 1.
Source
The code is at github.com/DialgemAI/dialgem-cli under the Apache-2.0 license. For an AI assistant instead of a terminal, see the MCP server.