@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.
Files changed (3) hide show
  1. package/README.md +27 -137
  2. package/dist/cli.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,218 +1,108 @@
1
1
  # Help Scout CLI
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@stephendolan/helpscout-cli.svg)](https://www.npmjs.com/package/@stephendolan/helpscout-cli)
4
- [![npm downloads](https://img.shields.io/npm/dm/@stephendolan/helpscout-cli.svg)](https://www.npmjs.com/package/@stephendolan/helpscout-cli)
5
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
- [![Bun](https://img.shields.io/badge/Bun-%3E%3D1.0-black)](https://bun.sh)
7
5
 
8
- A command-line interface for Help Scout's Mailbox API 2.0, designed for LLMs and developers to quickly interface with Help Scout data.
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 directly without installing
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
- Without `libsecret`, use the environment variables instead.
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
- Help Scout uses OAuth 2.0 with Client Credentials. Create an OAuth application at [Help Scout > Your Profile > My Apps](https://secure.helpscout.net/authentication/authorizeClientApplication).
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 # Check authentication status
65
- helpscout auth logout # Remove stored credentials
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
- ## Usage
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 --mailbox 123 --tag urgent
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
- # Add/remove tags
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
- ## Global Options
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
- All commands return JSON by default:
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
- - **Lists**: Objects with data arrays and pagination info
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
- # Get all conversation subjects
90
+ # Filter with jq
191
91
  helpscout conversations list | jq '.conversations[].subject'
192
92
 
193
- # Get only id and subject fields
93
+ # Select fields
194
94
  helpscout conversations list --fields id,subject
195
95
 
196
- # Get plain text bodies (HTML stripped)
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
- ## API Rate Limits
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 Documentation](https://developer.helpscout.com/mailbox-api/)
215
- - [Help Scout Search Filters](https://docs.helpscout.com/article/47-search-filters-with-operators)
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.1").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) => {
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stephendolan/helpscout-cli",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "A command-line interface for Help Scout",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",