@stephendolan/helpscout-cli 2.4.1 → 2.4.2
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 +27 -137
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,218 +1,108 @@
|
|
|
1
1
|
# Help Scout CLI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@stephendolan/helpscout-cli)
|
|
4
|
-
[](https://www.npmjs.com/package/@stephendolan/helpscout-cli)
|
|
5
4
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://bun.sh)
|
|
7
5
|
|
|
8
|
-
A
|
|
9
|
-
|
|
10
|
-
## Features
|
|
11
|
-
|
|
12
|
-
- **LLM-First Design**: JSON output by default for easy parsing and integration with AI assistants
|
|
13
|
-
- **Output Control**: Strip HTML from bodies, select specific fields, exclude API metadata
|
|
14
|
-
- **Advanced Search**: Full query syntax support for filtering conversations
|
|
15
|
-
- **Comprehensive Coverage**: Conversations, customers, tags, workflows, and mailboxes
|
|
16
|
-
- **Type Safety**: Built with TypeScript for robust error handling
|
|
17
|
-
- **Simple Authentication**: OAuth 2.0 credentials stored securely in OS keychain
|
|
6
|
+
A CLI for Help Scout's Mailbox API 2.0. JSON output by default for LLM and automation workflows.
|
|
18
7
|
|
|
19
8
|
## Installation
|
|
20
9
|
|
|
21
|
-
Requires [Bun](https://bun.sh) runtime.
|
|
22
|
-
|
|
23
10
|
```bash
|
|
24
|
-
# Install globally with bun (recommended)
|
|
25
11
|
bun install -g @stephendolan/helpscout-cli
|
|
26
12
|
|
|
27
|
-
# Or run
|
|
13
|
+
# Or run without installing
|
|
28
14
|
bunx @stephendolan/helpscout-cli conversations list
|
|
29
|
-
npx @stephendolan/helpscout-cli conversations list # also works
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Linux Prerequisites
|
|
33
|
-
|
|
34
|
-
Requires `libsecret` for keychain storage:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
# Ubuntu/Debian
|
|
38
|
-
sudo apt-get install libsecret-1-dev
|
|
39
|
-
|
|
40
|
-
# Fedora/RHEL
|
|
41
|
-
sudo dnf install libsecret-devel
|
|
42
|
-
|
|
43
|
-
# Arch Linux
|
|
44
|
-
sudo pacman -S libsecret
|
|
45
15
|
```
|
|
46
16
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### From Source
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
git clone https://github.com/stephendolan/helpscout-cli.git
|
|
53
|
-
cd helpscout-cli
|
|
54
|
-
bun install
|
|
55
|
-
bun run link # Build and link globally
|
|
56
|
-
```
|
|
17
|
+
**Linux**: Requires `libsecret` for keychain storage (`apt install libsecret-1-dev`), or use environment variables.
|
|
57
18
|
|
|
58
19
|
## Authentication
|
|
59
20
|
|
|
60
|
-
|
|
21
|
+
Create an OAuth app at [Help Scout > Your Profile > My Apps](https://secure.helpscout.net/authentication/authorizeClientApplication).
|
|
61
22
|
|
|
62
23
|
```bash
|
|
63
24
|
helpscout auth login --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRET
|
|
64
|
-
helpscout auth status
|
|
65
|
-
helpscout auth logout
|
|
25
|
+
helpscout auth status
|
|
26
|
+
helpscout auth logout
|
|
66
27
|
```
|
|
67
28
|
|
|
68
|
-
Or use environment variables:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
export HELPSCOUT_APP_ID=your_app_id
|
|
72
|
-
export HELPSCOUT_APP_SECRET=your_app_secret
|
|
73
|
-
export HELPSCOUT_MAILBOX_ID=your_default_mailbox_id # Optional
|
|
74
|
-
```
|
|
29
|
+
Or use environment variables: `HELPSCOUT_APP_ID`, `HELPSCOUT_APP_SECRET`, `HELPSCOUT_MAILBOX_ID`
|
|
75
30
|
|
|
76
|
-
##
|
|
31
|
+
## Commands
|
|
77
32
|
|
|
78
33
|
### Conversations
|
|
79
34
|
|
|
80
35
|
```bash
|
|
81
|
-
# List conversations
|
|
82
36
|
helpscout conversations list
|
|
83
|
-
helpscout conversations list --status active
|
|
84
|
-
helpscout conversations list
|
|
85
|
-
|
|
86
|
-
# Advanced search
|
|
87
|
-
helpscout conversations list -q 'status:open tag:urgent'
|
|
88
|
-
helpscout conversations list -q 'customer:john@example.com'
|
|
89
|
-
|
|
90
|
-
# Aggregated summary
|
|
37
|
+
helpscout conversations list --status active --mailbox 123 --tag urgent
|
|
38
|
+
helpscout conversations list -q 'status:open customer:john@example.com'
|
|
91
39
|
helpscout conversations list --summary
|
|
92
40
|
|
|
93
|
-
# View a conversation
|
|
94
41
|
helpscout conversations view 456
|
|
95
|
-
|
|
96
|
-
# View conversation threads
|
|
97
42
|
helpscout conversations threads 456
|
|
98
|
-
|
|
99
|
-
|
|
43
|
+
helpscout conversations reply 456 --text "Thanks for reaching out!"
|
|
44
|
+
helpscout conversations note 456 --text "Internal note"
|
|
100
45
|
helpscout conversations add-tag 456 urgent
|
|
101
46
|
helpscout conversations remove-tag 456 urgent
|
|
102
|
-
|
|
103
|
-
# Reply to a conversation
|
|
104
|
-
helpscout conversations reply 456 --text "Thank you for reaching out!"
|
|
105
|
-
|
|
106
|
-
# Add a note
|
|
107
|
-
helpscout conversations note 456 --text "Internal note here"
|
|
108
|
-
|
|
109
|
-
# Delete a conversation
|
|
110
47
|
helpscout conversations delete 456
|
|
111
48
|
```
|
|
112
49
|
|
|
113
50
|
### Customers
|
|
114
51
|
|
|
115
52
|
```bash
|
|
116
|
-
# List customers
|
|
117
53
|
helpscout customers list
|
|
118
54
|
helpscout customers list --first-name John
|
|
119
|
-
|
|
120
|
-
# View a customer
|
|
121
55
|
helpscout customers view 789
|
|
122
|
-
|
|
123
|
-
# Create a customer
|
|
124
56
|
helpscout customers create --first-name John --last-name Doe --email john@example.com
|
|
125
|
-
|
|
126
|
-
# Update a customer
|
|
127
57
|
helpscout customers update 789 --organization "Acme Corp"
|
|
128
|
-
|
|
129
|
-
# Delete a customer
|
|
130
58
|
helpscout customers delete 789
|
|
131
59
|
```
|
|
132
60
|
|
|
133
|
-
### Tags
|
|
61
|
+
### Tags, Workflows, Mailboxes
|
|
134
62
|
|
|
135
63
|
```bash
|
|
136
|
-
# List all tags
|
|
137
64
|
helpscout tags list
|
|
138
|
-
|
|
139
|
-
# View a tag
|
|
140
65
|
helpscout tags view 123
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Workflows
|
|
144
66
|
|
|
145
|
-
```bash
|
|
146
|
-
# List workflows
|
|
147
67
|
helpscout workflows list
|
|
148
68
|
helpscout workflows list --type manual
|
|
149
|
-
|
|
150
|
-
# Run a manual workflow
|
|
151
69
|
helpscout workflows run 123 --conversations 456,789
|
|
152
|
-
|
|
153
|
-
# Activate/deactivate
|
|
154
70
|
helpscout workflows activate 123
|
|
155
71
|
helpscout workflows deactivate 123
|
|
156
|
-
```
|
|
157
72
|
|
|
158
|
-
### Mailboxes
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
# List mailboxes
|
|
162
73
|
helpscout mailboxes list
|
|
163
|
-
|
|
164
|
-
# View a mailbox
|
|
165
74
|
helpscout mailboxes view 123
|
|
166
|
-
|
|
167
|
-
# Set default mailbox
|
|
168
75
|
helpscout mailboxes set-default 123
|
|
169
76
|
```
|
|
170
77
|
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
- `-c, --compact` - Output minified JSON (single line)
|
|
174
|
-
- `-p, --plain` - Strip HTML from body fields, output plain text
|
|
175
|
-
- `-f, --fields <fields>` - Comma-separated list of fields to include in output
|
|
176
|
-
- `--include-metadata` - Include `_links` and `_embedded` in responses (stripped by default)
|
|
177
|
-
- `--help` - Show help for any command
|
|
178
|
-
|
|
179
|
-
## Output Format
|
|
78
|
+
## Options
|
|
180
79
|
|
|
181
|
-
|
|
80
|
+
| Flag | Description |
|
|
81
|
+
|------|-------------|
|
|
82
|
+
| `-c, --compact` | Minified JSON output |
|
|
83
|
+
| `-p, --plain` | Strip HTML from body fields |
|
|
84
|
+
| `-f, --fields <fields>` | Include only specified fields |
|
|
85
|
+
| `--include-metadata` | Include `_links` and `_embedded` |
|
|
182
86
|
|
|
183
|
-
|
|
184
|
-
- **Single items**: Objects directly
|
|
185
|
-
- **Errors**: `{"error": {"name": "...", "detail": "...", "statusCode": 400}}`
|
|
186
|
-
|
|
187
|
-
### Working with JSON Output
|
|
87
|
+
## Output
|
|
188
88
|
|
|
189
89
|
```bash
|
|
190
|
-
#
|
|
90
|
+
# Filter with jq
|
|
191
91
|
helpscout conversations list | jq '.conversations[].subject'
|
|
192
92
|
|
|
193
|
-
#
|
|
93
|
+
# Select fields
|
|
194
94
|
helpscout conversations list --fields id,subject
|
|
195
95
|
|
|
196
|
-
#
|
|
96
|
+
# Plain text bodies
|
|
197
97
|
helpscout conversations threads 456 --plain
|
|
198
|
-
|
|
199
|
-
# Count conversations by status
|
|
200
|
-
helpscout conversations list --summary | jq '.byStatus'
|
|
201
98
|
```
|
|
202
99
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Help Scout enforces these rate limits:
|
|
206
|
-
|
|
207
|
-
- **200 requests per minute** per account
|
|
208
|
-
- **12 write requests per 5 seconds** (POST, PUT, DELETE)
|
|
209
|
-
|
|
210
|
-
When exceeded, the API returns HTTP 429 errors. The CLI will report these as JSON errors.
|
|
100
|
+
Errors return: `{"error": {"name": "...", "detail": "...", "statusCode": 400}}`
|
|
211
101
|
|
|
212
102
|
## References
|
|
213
103
|
|
|
214
|
-
- [Help Scout API
|
|
215
|
-
- [
|
|
104
|
+
- [Help Scout API Docs](https://developer.helpscout.com/mailbox-api/)
|
|
105
|
+
- [Search Filters](https://docs.helpscout.com/article/47-search-filters-with-operators)
|
|
216
106
|
|
|
217
107
|
## License
|
|
218
108
|
|
package/dist/cli.js
CHANGED
|
@@ -1138,7 +1138,7 @@ function createWorkflowsCommand() {
|
|
|
1138
1138
|
|
|
1139
1139
|
// src/cli.ts
|
|
1140
1140
|
var program = new Command7();
|
|
1141
|
-
program.name("helpscout").description("A command-line interface for Help Scout").version("2.4.
|
|
1141
|
+
program.name("helpscout").description("A command-line interface for Help Scout").version("2.4.2").option("-c, --compact", "Minified JSON output (single line)").option("-p, --plain", "Strip HTML from body fields, output plain text").option("--include-metadata", "Include _links and _embedded in responses (stripped by default)").option("-f, --fields <fields>", "Comma-separated list of fields to include in output").hook("preAction", (thisCommand) => {
|
|
1142
1142
|
const options = thisCommand.opts();
|
|
1143
1143
|
setOutputOptions({
|
|
1144
1144
|
compact: options.compact,
|