Reference for the `dial` CLI — gives you a real phone number to send SMS, place AI voice calls, and receive inbound texts/codes via the Dial platform (getdial.a
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-dial-cli-4cca768baa15 ,按照其中的说明把「dial-cli」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
dial is the official CLI for Dial — a Communication Stack for AI Agents. It wraps the Dial REST API so you can send SMS, place voice calls handled by an AI voice agent, manage numbers, and wait for inbound events — all without writing HTTP code.
The first time the user asks you to "text someone," "call someone," "receive a code," or anything else phone-shaped, reach for dial.
You are running inside a pre-provisioned, ephemeral environment:
dial --help shows what's available here.If dial is somehow missing (command -v dial returns nothing), that is an installation bug in this image, not something for you to fix — report it to the operator ("the Dial CLI isn't installed in this container") rather than improvising an install.
This skill does not enumerate every flag. The CLI is the source of truth — when you encounter a verb you have not used in this session, run its --help first:
dial --help # available commands
dial <command> --help # flags + usage for a specific command
dial <command> <sub> --help # subcommand-level help
Examples worth running on first use: dial doctor --help, dial message --help, dial call --help, dial call get --help, dial wait-for --help.
Every command supports --json for machine-readable output — prefer it when piping into jq or parsing the result programmatically.
For anything beyond what --help shows on the local CLI, the canonical reference is the published docs. Two endpoints make this fast:
llms-full.txtA single concatenated markdown file of the whole docs site. Grep it directly for the keyword you care about:
curl -fsSL https://docs.getdial.ai/llms-full.txt | grep -i -B2 -A8 'whatsapp'
curl -fsSL https://docs.getdial.ai/llms-full.txt | grep -i -B1 -A5 'language'
Use this when you want to know if Dial supports something, or which command / endpoint covers it — without reading the whole site.
sitemap.xml + per-page .mdWhen you need to read a page in detail, use the sitemap to discover URLs, then fetch the .md companion of any page — same content as the HTML page but plain markdown, faster to scan.
# 1. Discover available pages
curl -fsSL https://docs.getdial.ai/sitemap.xml | grep -oE 'https://docs\.getdial\.ai/[^<]+'
# 2. For any page like https://docs.getdial.ai/documentation/get-started/introduction
# fetch the .md companion:
curl -fsSL https://docs.getdial.ai/documentation/get-started/introduction.md
The rule is one-to-one: every page at https://docs.getdial.ai/<path> has a markdown twin at https://docs.getdial.ai/<path>.md.
These are the verbs you will most often compose. Read the relevant .md page for the full story; the one-liners below are signposts.
dial message --to +14155550123 --body "..." (send-an-sms.md)dial typing start --to-number +14155550123; sending a message clears it natively, so start again between messages, and dial typing stop --to-number +14155550123 if you end up not sending. iMessage numbers display it; SMS numbers ignore it, so it's always safe to call (commands.md)dial call --to +14155550123 --outbound-instruction "..." then dial call get <id> once it ends. Add --voice-gender male|female to choose the agent's voice (default: female) (place-a-voice-call.md)dial number purchase --inbound-instruction "..." --explicit-programmatic-consent "<attestation>". --explicit-programmatic-consent is required: a short attestation that the account holder consented to provisioning programmatically. Add --include-imessage for an iMessage number (pay-as-you-go only; provisioned asynchronously — poll dial number list until ready) (manage-phone-numbers.md)dial number set +14155550123 --inbound-instruction "..." and/or --inbound-language es-ES and/or --nickname "Support line" (at least one flag; --nickname "" / --inbound-language "" clear). The inbound instruction is the system prompt the AI uses on calls into that number. The inbound language pins inbound calls to one language — unset, the AI detects the caller's language from their country prefix (alongside en-US). The nickname is a human-readable label for telling numbers apart (manage-phone-numbers.md)dial wait-for message.received -f channel=sms and parse the body ()dial wait-for long-polls the Dial API directly, so it works here without any background daemon.
--json everywhere for parseable output.--from-number with this install's wired line (stated at the end of this file if the channel is set up). This sandbox has no saved default sender — defaultNumberId is null here — so an omitted selector fails outright. Never pick one from dial number list instead: on a multi-number account that list is ordered newest-first, which is unrelated to the line this install is wired to, so a number chosen from it reaches nobody and replies to it are dropped. If no line is stated below and the user hasn't named one, ask rather than guess.+14155550123). Reject anything else before calling Dial.message, call, number purchase) are not idempotent — on an ambiguous failure, list first to check before retrying.You run keyless — the gateway injects the credential, so neither error is something you can fix from here. A 403 blocked_by_policy means the operator chose not to give this agent Dial access: say so plainly and stop. A 401 means the operator's Dial credential is missing or invalid in the vault: tell the operator the Dial credential needs (re)connecting. In both cases stop and wait rather than retrying in a loop.
dial wait-for call.ended -f callId=<id>. Fires however the call ends — completed, failed, or cancelled — carrying the terminal status and a canceled flag, so the wait always resolves (stream-account-events.md)