Installation
npm install -g @trunkbeam/cli
Or run it without installing via npx @trunkbeam/cli. Requires Node.js 20 or newer.
Log in
trunkbeam login
login opens the browser to confirm. On servers without a browser, set the environment variable instead:
export TRUNKBEAM_API_KEY=tb_live_…
Keep several accounts apart with profiles, for example trunkbeam login --profile client-a and then --profile client-a on every command.
Global options
| Option | Effect |
|---|---|
--json | JSON output for scripts |
--yes | Skip confirmations, for example when buying |
--profile <name> | Use another account |
--help | Help for any command |
Commands
| Command | What it does |
|---|---|
signup | Create an account |
login, logout | Log the CLI in or out |
status | Verification status of your account |
verify --docs <file> | Submit documents |
addresses list, addresses add | Addresses for more area codes |
numbers search --area <code> | Search available numbers |
numbers buy <number> --sip <uri> | Buy a number and connect it |
numbers list | Your numbers with status |
numbers update <number> --sip <uri> | Change the target |
numbers release <number> | Cancel a number at month end |
transfer allow <number> --to <targets> | Allowed targets for SIP REFER |
trunks create --name <name> | Credentials for outbound calls |
calls list | Recent calls with duration and cost |
prices | Current price list |
usage --month <YYYY-MM> | Usage and cost for a month |
keys create, keys list, keys revoke | Manage API keys |
In scripts
With --json and --yes nothing asks for confirmation. Example: get a number in the right area code for every new customer.
number=$(trunkbeam numbers search --area 089 --json | jq -r '.[0].number')
trunkbeam numbers buy "$number" --sip "sip:customer-42@voice.example" --yes --json
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Invalid input |
3 | Not logged in or invalid key |
4 | Account not approved yet |
5 | Spend limit reached |