@thisispamela/cli 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# @thisispamela/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for the Pamela Enterprise Voice API. Make calls, check status, and manage your API from the terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @thisispamela/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use with `npx`:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @thisispamela/cli <command>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
Set your API key as an environment variable:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
export PAMELA_API_KEY=pk_live_your_api_key_here
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or pass it with the `--api-key` flag on each command.
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
### Create a Call
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
thisispamela create-call \
|
|
33
|
+
--to "+15551234567" \
|
|
34
|
+
--task "Schedule a demo for tomorrow at 2pm" \
|
|
35
|
+
--voice "auto" \
|
|
36
|
+
--agent-name "Pamela" \
|
|
37
|
+
--caller-name "Acme Corp"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Options:**
|
|
41
|
+
- `--to` (required): Phone number in E.164 format
|
|
42
|
+
- `--task` (required): Task description for the call
|
|
43
|
+
- `--country`: ISO country code (optional)
|
|
44
|
+
- `--locale`: Locale string (optional, e.g., "en-US")
|
|
45
|
+
- `--voice`: Voice preference `"male" | "female" | "auto"` (optional)
|
|
46
|
+
- `--agent-name`: Agent name override (optional)
|
|
47
|
+
- `--caller-name`: Name of who the agent is calling on behalf of (optional)
|
|
48
|
+
- `--max-duration-seconds`: Maximum call duration (optional, default: 299)
|
|
49
|
+
|
|
50
|
+
### Get Call Status
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
thisispamela get-call --call-id call_abc123def456
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### List Calls
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
thisispamela list-calls \
|
|
60
|
+
--limit 10 \
|
|
61
|
+
--status completed \
|
|
62
|
+
--start-date 2024-01-01 \
|
|
63
|
+
--end-date 2024-01-31
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Options:**
|
|
67
|
+
- `--limit`: Maximum number of calls to return (default: 50)
|
|
68
|
+
- `--offset`: Pagination offset (default: 0)
|
|
69
|
+
- `--status`: Filter by status (`queued`, `ringing`, `in_progress`, `completed`, `failed`, `cancelled`)
|
|
70
|
+
- `--start-date`: Filter calls from this date (YYYY-MM-DD)
|
|
71
|
+
- `--end-date`: Filter calls until this date (YYYY-MM-DD)
|
|
72
|
+
|
|
73
|
+
### Cancel a Call
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
thisispamela cancel-call --call-id call_abc123def456
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Hangup a Call
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
thisispamela hangup-call --call-id call_abc123def456
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Global Options
|
|
86
|
+
|
|
87
|
+
All commands support:
|
|
88
|
+
|
|
89
|
+
- `--api-key <key>`: Pamela API key (falls back to `PAMELA_API_KEY` env var)
|
|
90
|
+
- `--base-url <url>`: Custom API base URL (default: `https://api.thisispamela.com`)
|
|
91
|
+
|
|
92
|
+
## Examples
|
|
93
|
+
|
|
94
|
+
### Quick Call
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
export PAMELA_API_KEY=pk_live_xxx
|
|
98
|
+
thisispamela create-call --to "+15551234567" --task "Remind about meeting"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Check Call Status
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
thisispamela get-call --call-id call_abc123
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### List Today's Calls
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
thisispamela list-calls --start-date $(date +%Y-%m-%d) --status completed
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Cancel In-Progress Call
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
thisispamela cancel-call --call-id call_xyz789
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Output Format
|
|
120
|
+
|
|
121
|
+
All commands output JSON for easy parsing and integration with scripts:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Create call
|
|
125
|
+
thisispamela create-call --to "+15551234567" --task "Test"
|
|
126
|
+
# Output: {"id": "call_abc123", "status": "queued", ...}
|
|
127
|
+
|
|
128
|
+
# Get call
|
|
129
|
+
thisispamela get-call --call-id call_abc123
|
|
130
|
+
# Output: {"id": "call_abc123", "status": "completed", "transcript": [...], ...}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Error Handling
|
|
134
|
+
|
|
135
|
+
Errors are output as JSON to stderr:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"error": {
|
|
140
|
+
"name": "AuthenticationError",
|
|
141
|
+
"message": "Invalid API key"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Getting API Keys
|
|
147
|
+
|
|
148
|
+
See the [JavaScript SDK README](../javascript/README.md#getting-api-keys) for instructions on obtaining and managing API keys.
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisispamela/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Pamela Enterprise Voice API CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"author": "Pamela",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@thisispamela/sdk": "^1.1.
|
|
34
|
+
"@thisispamela/sdk": "^1.1.1",
|
|
35
35
|
"commander": "^14.0.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|