# CLI: MoreVoice from your terminal

> The morevoice command line: log in with an API key, place and inspect calls, send test events to your webhook endpoints, and, as it grows, forward webhooks and tool calls to your laptop and follow events live. The reference is generated from the CLI's own help.

`morevoice` is the API from your terminal, built on the Node.js SDK. Use it to try a call in seconds while you build, to script small jobs, and to send your webhook endpoint a test event without waiting for a real call.

## Install

> **Coming soon: On npm with the API beta**
>
> `@morevoice/cli` isn't published yet. Until it is, run it from a checkout of the SDK repository.

It finds the API key the way the SDKs do: `--api-key`, then the `MOREVOICE_API_KEY` environment variable, then a saved **profile**. `morevoice login` checks a key against the API and saves it as a profile (`test` or `live`, by the key's mode), so you switch between test and live without copying keys around. Every command takes `--json` for scripts and `--help` for its options.

## Commands

Everything below is the CLI's own help, from `morevoice` 0.1.0.

```text
morevoice 0.1.0 — the MoreVoice command line

Usage:
  morevoice login [--key mv_test_sk_…] [--profile name] [--api-base url]
  morevoice logout [--profile name | --all]
  morevoice whoami
  morevoice profiles [list] | profiles use <name> | profiles remove <name>
  morevoice keys [--all]
  morevoice calls create --to +9725… (--assistant asst_… | --flow flow_…) --purpose service [--var k=v]… [--metadata k=v]… [--from-number pn_…] [--idempotency-key key]
  morevoice calls list [--limit 20] [--status in_progress|ended] [--direction inbound|outbound|browser] [--assistant asst_…] [--starting-after cursor]
  morevoice calls get <call_…> [--expand assistant]
  morevoice trigger <event.type> [--endpoint we_…]
  morevoice listen [--forward-to http://localhost:3000/webhooks] [--forward-tools http://localhost:3000/tools] [--events call.*,campaign.completed] [--live]

Options (every command):
  --json              machine-readable output
  --profile <name>    use a saved profile (default: the default profile, or MOREVOICE_PROFILE)
  --api-key <key>     use this key (or MOREVOICE_API_KEY)
  --api-base <url>    another API server, e.g. staging (or MOREVOICE_API_BASE)
  -h, --help          this help · -v, --version

Keys are saved in ~/.config/morevoice/config.json (mode 600).
```

| Command | Usage |
| --- | --- |
| `morevoice login` | `morevoice login [--key mv_test_sk_…] [--profile name] [--api-base url]` |
| `morevoice logout` | `morevoice logout [--profile name \| --all]` |
| `morevoice whoami` | `morevoice whoami` |
| `morevoice profiles` | `morevoice profiles [list] \| profiles use <name> \| profiles remove <name>` |
| `morevoice keys` | `morevoice keys [--all]` |
| `morevoice calls create` | `morevoice calls create --to +9725… (--assistant asst_… \| --flow flow_…) --purpose service [--var k=v]… [--metadata k=v]… [--from-number pn_…] [--idempotency-key key]` |
| `morevoice calls list` | `morevoice calls list [--limit 20] [--status in_progress\|ended] [--direction inbound\|outbound\|browser] [--assistant asst_…] [--starting-after cursor]` |
| `morevoice calls get` | `morevoice calls get <call_…> [--expand assistant]` |
| `morevoice trigger` | `morevoice trigger <event.type> [--endpoint we_…]` |
| `morevoice listen` | `morevoice listen [--forward-to http://localhost:3000/webhooks] [--forward-tools http://localhost:3000/tools] [--events call.*,campaign.completed] [--live]` |

> **Coming soon: More commands are coming**
>
> Next: `tail` follows your organisation's events live.

> **Start with a test key**
>
> Log in with a test key (`mv_test_sk_…`) first. Test calls run on the virtual carrier and are never billed; a live key's calls reach real phones.
