• Go 67.8%
  • Shell 24.6%
  • PowerShell 7.6%
Find a file
Oz ST 0d29f51e02
Some checks failed
Test & Lint / test (push) Failing after 1m0s
Add --sandbox flag, security check for SMS listener, update README
2026-03-08 13:16:39 +00:00
.ai/mcp Add sip caller-id command, fix lint errors, update docs 2026-03-08 09:22:26 +00:00
.forgejo/workflows Remoge tests from release.yaml 2026-03-08 12:37:23 +00:00
cmd/zadarma Add --sandbox flag, security check for SMS listener, update README 2026-03-08 13:16:39 +00:00
completions docs: sync README, SKILL, and shell completions with current CLI 2026-03-07 22:38:59 +00:00
internal Add --sandbox flag, security check for SMS listener, update README 2026-03-08 13:16:39 +00:00
release-notes Add release notes for v0.0.8 2026-03-08 12:52:20 +00:00
samples Clean PII: anonymize sample data, fix test script credentials, update gitignore 2026-03-08 09:59:55 +00:00
.gitignore Clean PII: anonymize sample data, fix test script credentials, update gitignore 2026-03-08 09:59:55 +00:00
.pre-commit-config.yaml Add pre-commit config, fix test lint issues 2026-03-08 09:41:43 +00:00
AGENTS.md Added AGENTS.md 2026-03-07 09:13:30 +00:00
go.mod Add direct command for virtual numbers API 2026-02-28 12:27:34 +01:00
go.sum feat(cli): upgrade to cobra framework and implement all API endpoints 2026-02-26 07:44:04 +01:00
NOTES.md Improve error handling and refactor SMS webhook commands 2026-03-06 18:01:44 +00:00
README.md Add --sandbox flag, security check for SMS listener, update README 2026-03-08 13:16:39 +00:00
renovate.json Add pre-commit config, fix test lint issues 2026-03-08 09:41:43 +00:00
SKILL.md Add sip caller-id command, fix lint errors, update docs 2026-03-08 09:22:26 +00:00
test_phone_command.sh Clean PII: anonymize sample data, fix test script credentials, update gitignore 2026-03-08 09:59:55 +00:00
USER_REQUIREMENTS.md Consolidate phone number commands and remove --json flag 2026-03-01 11:41:37 +00:00

Zadarma CLI

A Go command-line interface for the Zadarma VoIP API.

Features

  • Account balance lookup
  • SIP listing and status lookup
  • Phone/DID management commands:
    • List owned numbers
    • List available countries
    • List country destinations
    • Inspect a specific virtual number
  • SMS commands:
    • Send SMS
    • List valid senders
    • Get webhook URL
    • Set webhook URL and enable SMS hooks
    • Run a local listener for incoming SMS events
  • PBX info lookup (with optional filters)
  • Call statistics lookup (with optional filters)
  • Text (default) and JSON output (--output text|json)
  • Shell completion support (completion command)
  • Debug logging (--debug)

Installation

Build from source:

go build -o zadarma-cli ./cmd/zadarma

Authentication

Use environment variables (recommended):

export ZADARMA_API_KEY="your_api_key"
export ZADARMA_API_SECRET="your_api_secret"

Or pass per command:

zadarma-cli --key "KEY" --secret "SECRET" balance

Usage

zadarma-cli [command] [flags]

Global Flags

Flag Description
-h, --help Show help
-v, --version Show CLI version
-k, --key Zadarma API key
-s, --secret Zadarma API secret
-o, --output Output format: text (default) or json
-d, --debug Enable debug output

Command Reference

balance

  • zadarma-cli balance

sip

  • zadarma-cli sip list
  • zadarma-cli sip info <ID>
  • zadarma-cli sip caller-id --id <ID> --number <NUMBER>

phone

  • zadarma-cli phone list [number...]
  • zadarma-cli phone countries
  • zadarma-cli phone country <code>
  • zadarma-cli phone number <number>

sms

  • zadarma-cli sms send --phone <number> --message <text> [--sender <sender>]
  • zadarma-cli sms senders [phones]
  • zadarma-cli sms senders --phones <comma-separated>
  • zadarma-cli sms get-webhook
  • zadarma-cli sms set-webhook <WEBHOOK> [--port <port>]
  • zadarma-cli sms listen [--webhook <WEBHOOK>] [--port <port>]

pbx

  • zadarma-cli pbx info [--pbx-id <id>] [--numbers <comma-separated>]

statistics

  • zadarma-cli statistics [--start "YYYY-MM-DD HH:MM:SS"] [--end "YYYY-MM-DD HH:MM:SS"] [--sip <id>]

completion

  • zadarma-cli completion bash
  • zadarma-cli completion zsh
  • zadarma-cli completion fish
  • zadarma-cli completion powershell

Pre-generated scripts are available in completions/.

Example: JSON Output

zadarma-cli --output json phone list

For AI Agents

AI agents should use the SKILL.md file in this repository for CLI usage guidelines and best practices.

API Documentation

https://zadarma.com/en/support/api/

License

MIT