Skip to main content
Flags, output formats and exit codes that apply to every command, plus settings and fixes. For errors, jump to Troubleshooting.

Global flags

These flags work on any command (plivo <command> [flags]), with the exceptions noted. --map and --version belong on the root command. --explain is not a global flag. It narrates in plain English what a command will do before running it, and exists only on api, account applications create, auth whoami, voice calls make, messaging sms send, messaging whatsapp send, messaging mms send, numbers buy, numbers release and verify sessions create. Every other command rejects it.

Output and exit codes

Most commands return a success object or an error object. Streaming commands are the exception: ask -o json and ask -o jsonl both emit JSON Lines, while diagnose -o json emits one result and diagnose -o jsonl emits events. See Get help and Diagnose a call.

Output formats

Pick fields with JMESPath

--query runs a JMESPath expression (a query language for selecting fields in JSON) on the JSON envelope before it is printed, and implies -o json. It also works with -o jsonl, -o yaml and -o csv. On plivo api, --query keeps its own meaning: a URL parameter as key=value.
  • The dates are examples: a call range must be within the last 90 days and no longer than 31 days.
  • An invalid expression is refused with BAD_FLAG and exit code 1, before any request. An expression whose result grows too large, or that runs too long, ends with an error.
  • An expression that fails only on the result: after a send, buy, create or other write, the request has already gone through, so the CLI prints the unfiltered result with a warning on stderr and exits 0. Don’t run the command again. On a read, it exits 1 with BAD_FLAG.

Lists and paging

Most paged lists take --limit (1 to 20, default 20) and --offset (0 or more); invalid values are refused before any request. account usage is an exception: its limit is 1 to 1000, defaults to 100, and it has no --offset. Live calls and multiparty participants have no paging flags. --all reads every page into one result, and meta.next is null once every page is read. It stops after 100 pages (2,000 rows at --limit 20) with a warning and sets meta.truncated: true. A rate-limited page is retried for up to 61 seconds; if it still fails, the rows read so far are printed with meta.truncated: true and the command exits 4. --all can’t be combined with --offset, and numbers search doesn’t take it. A filter value a list doesn’t accept, such as a mistyped --status or --direction, is refused with the allowed values instead of returning an empty list. Date filters are described on the Voice, Messaging and Make and control calls pages.

Success envelope

With -o json, API reads place the response under data, with secrets redacted. A typical list:
Single resources sit directly under data. Most lists use data.objects, but Verify sessions use data.sessions, masking sessions data.response.objects, live call IDs data.calls, and usage rows data.usage. An empty list is [], not null. Action commands print a result too (hangups, transfers, play, speak and DTMF, stream and recording stops, conference and multiparty actions, number release and update, and application, endpoint and subaccount updates and deletes): the API’s response, or the ID and what was done, such as { "data": { "call_uuid": "<call_uuid>", "hung_up": true } }. --dry-run prints its preview on stderr, not stdout. IDs in the URL are escaped as they are when sent, so a # or ? in an ID can’t cut the path short. Local and workflow commands (streams test, streams simulate, streams forward, upgrade, config telemetry) honor -o json too: one summary on stdout, progress on stderr.

Secrets in output

Auth tokens and passwords read [REDACTED] in every output format and in plivo api output: a subaccount’s auth_token and new_auth_token, and an endpoint’s password. Keys and their order stay the same. account subaccounts create still shows the new token once. Add --show-secrets to see the values.

Error envelope

Errors go to stderr as JSON and the process exits non-zero:
  • Switch on code, never on message text. The HTTP status decides the code. When the API rejected the request, context.upstream holds its own response as {status, body}.
  • retryable says whether sending the same request again is safe. A network failure (NETWORK_ERROR: connection refused, DNS, connection cut) or timeout (UPSTREAM_TIMEOUT) exits 3, and is retryable: true only on a read (GET). After a failed write the request may have gone through, so check before sending it again.
  • The CLI doesn’t follow redirects: a 3xx exits 3 and names where it pointed. A mistyped subcommand or a stray argument fails with BAD_INPUT and a suggestion, even with --help.

Exit codes

Safety

  • voice calls make, messaging * send, numbers buy, numbers release, resource deletes and mutating plivo api calls require --yes, checked locally. --yes is not a universal billing or account-change gate: lookup is billed without it, and updates can change routing without it.
  • --dry-run previews a change without applying it. Some previews still read account data: voice streams readiness --dry-run runs account checks but doesn’t request the answer URL, and SIP delete previews read dependent resources.
  • Local commands preview too: auth use, auth remove, logout, config set, config telemetry, login, upgrade, voice streams test and docs --refresh describe the action without changing local state. ask -i refuses --dry-run.
  • SIP trunking deletes read everything that depends on the object first, and refuse to delete something in use unless you add --force to --yes. Preview such a delete with --dry-run --force. See SIP trunking.

Configuration keys

plivo config <subcommand> views and changes settings in ~/.plivo/config.toml. Two commands changing the file at once don’t lose a change: each waits up to 10 seconds for the other. The feedback switches take 0, false, off or no. The feedback prompt never shows when output is piped, or while telemetry or feedback sending is off.

Read the docs from the terminal

plivo docs reads the Plivo documentation from the shell. It needs no login, so it works before you log in, in CI containers, and in coding agents. For an answer with sources, use plivo ask.
Text is cached under ~/.plivo/cache for a day. If the network is down, the CLI serves the old cache. --refresh skips the cache, on plivo docs and all three subcommands; if a refresh fails, the CLI names the error and the cache’s age. Without the CLI, add .md to any docs URL for plain Markdown. Two index files, which plivo docs also reads, cover the whole site for LLMs and agents:

Open the console or docs

plivo open opens the matching console or docs page in your browser, and prints the URL first in case no browser opens. No login is needed: the browser’s console session applies. --dry-run prints the URL and opens nothing; -o json returns {url, opened}.

Feedback and bug reports

plivo feedback sends a 1 to 5 rating and an optional comment, interactively or with --rating and --message. Phone numbers, emails, card numbers, IP addresses, bearer tokens, and Indian PAN and Aadhaar numbers are removed from comments before sending. Don’t type other personal data or secrets into a comment. plivo feedback --bug sends your comment plus the last failed command, kept in ~/.plivo/last-error.json: its command path, exit code, error code, request ID, CLI version and OS, never its arguments or the error text. The report is printed exactly as it will be sent, and you confirm first. Without a terminal pass --yes, or --dry-run to only print it. If sending fails, the CLI prints a prefilled GitHub issue link.

Telemetry

The CLI sends a little usage data with each request so Plivo can see which commands are used, what fails, and which versions are in use. It is on by default; you can turn the identity part off at any time. Sent on every request:
  • CLI version, operating system and architecture (for the upgrade hint and compatibility), plus Client-Type: cli and Client-Version headers. These are sent even with telemetry off; they name the client, not you.
  • The command name (for example voice calls list), never its arguments or flag values.
  • With identity telemetry on: the account’s Auth ID, the logged-in user’s email, the account region, and a user identifier, to see usage per person within an organization.
  • plivo feedback also sends the rating and comment you type.
Never sent: your auth token, API keys or passwords; phone numbers, call or message UUIDs, message bodies, audio or recordings; URLs you pass to commands (answer, WebSocket, callback); flag values, file contents, or anything from your Plivo account data. Turn it off:
PLIVO_FEEDBACK_TELEMETRY=0 also disables plivo feedback submission.

Troubleshooting

Login, requests and output

Numbers and SIP trunking

Calls and Audio Streaming

Still stuck

Ask with plivo ask "<what you see>". To report a CLI bug, run plivo feedback --bug, which attaches the last failed command (never its arguments). Send other feedback with plivo feedback, or open an issue on the issue tracker. The CLI is open source under the Apache-2.0 license: github.com/plivo/plivo-cli.