Command line

AgentCall CLI: Phone Numbers for AI Agents in Your Terminal

The AgentCall CLI gives developers and coding agents all 62 AgentCall tools from a terminal: phone numbers, SMS, OTP codes, AI voice calls, call memory and schedules. An agent can look up one tool at a time instead of loading the full tool list, which is about 45,000 tokens, into its context.

Install the AgentCall CLI

The CLI requires Node.js 20 or later.

npm install -g @agentcall/cli
agentcall login
agentcall whoami

Or run it once without installing:

npx @agentcall/cli tools otp

Log In with Your AgentCall API Key

Create a key on the API Keys page, then run agentcall login and paste it at the hidden prompt. The CLI checks the key before saving it to a file only your user account can read.

The CLI uses AGENTCALL_API_KEY first, then the saved key. API keys are never accepted as command-line flags, because arguments can appear in shell history and process listings.

Non-interactive setup
printf '%s' "$AGENTCALL_API_KEY" | agentcall login

The saved key is at %APPDATA%\agentcall\config.json on Windows and ~/.config/agentcall/config.json on macOS and Linux. Run agentcall logout to delete it.

Discover AgentCall Tools on Demand

Search the catalog, then read only the tool you need.

agentcall tools sms
agentcall schema send_sms
agentcall schema send_sms --json

CLI Commands for Phone Numbers, SMS and Calls

CommandWhat it does
agentcall tools [search]List or search all tools
agentcall schema <tool>Show one tool's flags and JSON Schema
agentcall tool <tool_name> [flags]Run any tool
agentcall numbers list|get|provision|label|releaseManage phone numbers
agentcall sms send|inbox|get|threads|thread|replySend and read texts
agentcall otp wait|listReceive verification codes
agentcall calls list|get|start|ai|hangup|transcript|reportPlace and inspect calls
agentcall usage [--period YYYY-MM]Show usage and costs
agentcall plan [upgrade]Show your plan or get a Pro checkout link
agentcall login|whoami|logoutManage the saved API key
Examples
agentcall numbers list
agentcall sms inbox num_abc123 --limit 5
agentcall otp wait num_abc123 --timeout 90000

# Preview an action, then run it
agentcall sms send --from +14155550100 --to +14155550101 --body "Your table is ready" --dry-run
agentcall sms send --from +14155550100 --to +14155550101 --body "Your table is ready"

Pass CLI Flags and JSON Input

Each tool input becomes a flag. numberId is --number-id, and --numberId also works.

agentcall tool get_inbox --number-id num_abc123 --limit 10 --otp-only
agentcall tool initiate_call --from +14155550100 --to +14155550101 --no-record
agentcall tool create_webhook --url https://example.com/hook --events sms.inbound --events call.transcript
  • Booleans: --record, --no-record or --record=false.
  • Lists: repeat the flag.
  • Clear a nullable field: --label null.
  • A value that starts with dashes: --body=--hello.

Six tools have nested inputs: configure_inbound_ai, update_number_label, initiate_ai_call, create_webhook, update_contact and create_schedule. They also accept JSON from a file or stdin, and flags override the JSON.

agentcall tool initiate_ai_call --input call.json --dry-run
cat call.json | agentcall tool initiate_ai_call --input - --yes

Confirmation and Safety for Coding Agents

Actions that spend money, contact someone or remove data ask first. In a non-interactive run they stop with exit code 4 unless --yes is passed.

  • 27 read-only tools run directly.
  • 12 tools that only change your own records or settings run directly.
  • 23 tools need confirmation, including all 10 destructive tools.

The other 13 tools that need confirmation are:

provision_number, send_sms, reply_to_sms_conversation, initiate_call, initiate_ai_call, synthesize_speech, create_schedule, upgrade_to_pro, request_agentfm_callback, configure_inbound_ai, set_premium_voice, create_webhook, rotate_webhook_secret.

--dry-run shows the tool and arguments without calling it and needs no API key. Plan limits and abuse controls still apply on the server to every request.

The CLI does not replay a write that could run twice. If a write ends with exit code 7, it may have completed, so check its state before running it again.

JSON Output and Exit Codes for Scripts

With --json, stdout contains one JSON document and errors go to stderr.

Success
{ "ok": true, "tool": "get_plan", "data": { "plan": "pro" }, "warnings": [] }
Error
{
  "ok": false,
  "error": {
    "code": "plan_limit_voice_ai",
    "message": "Outbound AI requires Pro.",
    "exitCode": 5,
    "statusCode": 403,
    "upgradeUrl": "https://agentcall.co/billing",
    "upgradeToolName": "upgrade_to_pro",
    "hint": "Upgrade at https://agentcall.co/billing"
  }
}
Exit codeMeaning
0Success
1General or API error
2Invalid command, flags or input
3Missing or rejected API key
4Confirmation required or declined. Nothing ran
5Plan limit. See upgradeUrl
6Rate limited
7Network failure, timeout, or a write with an unknown outcome
8Not found

AgentCall CLI Environment Variables

VariablePurpose
AGENTCALL_API_KEYAPI key. Takes priority over a saved key
AGENTCALL_BASE_URLAPI URL override. Must be https, or http on localhost
AGENTCALL_TIMEOUT_MSPer-request timeout in milliseconds
AGENTCALL_CONFIG_DIRDirectory for the saved key

AgentCall CLI vs MCP Server vs Node.js SDK

OptionBest forRequires
CLICoding agents, shell scripts and quick tasks in a terminalNode.js 20+
Hosted MCPClaude Desktop, Cursor, Windsurf and other MCP clientsNone
Node.js SDKCalling AgentCall from your own application codeNode.js
REST APIAny language or platformNone

The CLI uses the same tool catalog as the AgentCall MCP server, so both expose the same 62 tools.