CLI

The Phonic CLI maps every API endpoint to a subcommand, so you can call Phonic without writing code — handy for scripting, CI, or an AI coding agent that shells out directly.

Install

$npm install -g @phonic-ai/cli

Or run it without installing:

$npx @phonic-ai/cli --help

Authenticate

$export PHONIC_API_KEY="your_api_key"

A .env file in the working directory also works — the CLI loads it automatically.

Usage

Every API resource is a subcommand:

$phonic <resource> <method>
$phonic <resource> <method> --json '{"key": "value"}'

Run phonic --help or phonic <resource> --help to see what’s available.

Useful flags

FlagDescription
--dry-runValidate the request locally and print the HTTP request without sending it
--json <JSON|->Supply a request body as JSON (or - to read stdin)
--format <json|table|yaml|csv>Output format (default json)
--page-allAuto-paginate and stream results as NDJSON
-q, --quietSuppress stdout output on success

See the phonic-cli repo for the full command reference, environment variables, and shell completion.