# CLI

```bash
npm install -g @reos/cli
```

## Sign in

```bash
reos auth login
```

Opens your browser, runs the OAuth2 authorization-code flow with PKCE against a loopback redirect,
and stores the token in your OS keychain when one is available (falling back to a `0600` file in
`~/.config/reos`). No secret is ever typed into a terminal.

For CI, skip the browser entirely and use an API key:

```bash
export REOS_API_KEY=reos_live_…
reos contacts list
```

## Commands

```bash
reos ping
reos contacts list --limit 20 --format table
reos contacts get clx… --format yaml
reos contacts create --data '{"first_name":"Dana","email":"dana@example.test"}'
reos leads list --format csv > leads.csv
reos messages send --data '{"channel":"sms","to":"+15125550142","body":"Hi"}'
reos calls list
reos deals list --fields id,name,value
reos webhooks list
```

Every resource command takes `--format json|table|csv|yaml` and `--fields a,b,c`. `list` follows
cursors automatically unless you pass `--limit`.

## Configuration

| variable | meaning |
|---|---|
| `REOS_API_KEY` | Use an API key instead of the stored OAuth token. |
| `REOS_BASE_URL` | Point at a different instance (self-host, staging). |

```bash
reos auth token     # print the current access token (for scripting)
reos auth logout    # forget it
```
