Skip to content

Commit f7665b4

Browse files
committed
docs: update npm README with PII model, tools, full env vars
1 parent e51aa66 commit f7665b4

1 file changed

Lines changed: 66 additions & 22 deletions

File tree

npm/README.md

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
A command-line interface and [MCP](https://modelcontextprotocol.io/) server for the [HelpScout](https://www.helpscout.com/) API. Manage mailboxes, conversations, customers, tags, users, workflows, webhooks, and knowledge base content from the terminal.
44

5-
**Built for automation and AI-assisted workflows**
6-
- Ships with a deterministic, layered PII redaction pipeline (structured fields + free-text + source payload protection), plus strict per-command override controls.
7-
- An allowlist-based permission system (`resource:operation` pairs) lets you restrict exactly which actions are permitted.
8-
- See [PII Redaction Pipeline](https://github.com/operator-kit/hs-cli#pii-redaction-pipeline) · [Permissions](https://github.com/operator-kit/hs-cli#permissions).
5+
> **Built for shared and AI-assisted workflows**
6+
> ML-powered, deterministic PII redaction — real identities are replaced with consistent fake ones so output stays fully readable for LLMs, debugging, and triage.
7+
> Allowlist-based permissions (`resource:operation` pairs) restrict exactly which actions are permitted.
8+
> See [PII Redaction Pipeline](https://github.com/operator-kit/hs-cli#pii-redaction-pipeline) · [Permissions](https://github.com/operator-kit/hs-cli#permissions).
99
1010
## Install
1111

@@ -28,37 +28,44 @@ npx -y @operatorkit/hs inbox auth login
2828
# Authenticate (Docs API — API key)
2929
npx -y @operatorkit/hs docs auth login
3030

31-
# List mailboxes
32-
npx -y @operatorkit/hs inbox mailboxes list
33-
3431
# List conversations
3532
npx -y @operatorkit/hs inbox conversations list --status active
3633

34+
# Get a conversation with threads
35+
npx -y @operatorkit/hs inbox conversations get 67890 --embed threads
36+
3737
# Search articles
3838
npx -y @operatorkit/hs docs articles search --query "getting started"
39+
40+
# Team briefing — conversation counts per agent
41+
npx -y @operatorkit/hs inbox tools briefing
3942
```
4043

4144
## Authentication
4245

43-
The CLI uses HelpScout's OAuth2 client credentials flow. You'll need an App ID and App Secret from your HelpScout app settings:
46+
### Inbox API (OAuth2)
4447

45-
> **Your Profile** > My Apps > Create App
48+
Requires an App ID and App Secret from your HelpScout app settings:
4649

47-
### Interactive login (recommended for CLI)
50+
> **Your Profile** > My Apps > Create App
4851
4952
```bash
5053
npx -y @operatorkit/hs inbox auth login
5154
```
5255

53-
This prompts for your App ID and App Secret, validates them against the API, and stores them securely in your OS keyring.
56+
Prompts for your App ID and App Secret, validates them against the API, and stores them securely in your OS keyring.
57+
58+
### Docs API (API key)
5459

55-
### Environment variables & non interactive setup
60+
Requires a Docs API key from your HelpScout account:
5661

57-
Use `npx -y @operatorkit/hs inbox config set` commands to configure authentication non-interactively or set environment variables.
62+
```bash
63+
npx -y @operatorkit/hs docs auth login
64+
```
5865

59-
For MCP you can pass in the environment variables via [MCP config](#mcp-server).
66+
**Credential resolution order:** environment variables > OS keyring > config file.
6067

61-
[More information and exmaples can be found here](https://github.com/operator-kit/hs-cli/#authentication);
68+
For non-interactive setup, use `config set` commands or pass environment variables directly. For MCP, pass credentials via [MCP config](#mcp-server).
6269

6370
## API coverage
6471

@@ -82,6 +89,8 @@ Full CRUD for all Inbox API resources:
8289
- **Ratings** — get
8390
- **Attachments** — upload, list, get, delete
8491

92+
See [full Inbox API reference](https://github.com/operator-kit/hs-cli/blob/main/docs/inbox-api.md) for all commands, flags, and options.
93+
8594
### Docs API (`hs docs ...`)
8695

8796
Full CRUD for all Docs API resources:
@@ -93,6 +102,20 @@ Full CRUD for all Docs API resources:
93102
- **Redirects** — list, get, find, create, update, delete
94103
- **Assets** — article upload, settings upload
95104

105+
See [full Docs API reference](https://github.com/operator-kit/hs-cli/blob/main/docs/docs-api.md) for all commands, flags, and options.
106+
107+
### Tools (beyond the API)
108+
109+
**Team briefing** aggregates data across multiple API calls for an instant overview of your support team's workload:
110+
111+
```bash
112+
hs inbox tools briefing # team overview — counts per agent
113+
hs inbox tools briefing --assigned-to 531600 # agent summary — list conversations
114+
hs inbox tools briefing --assigned-to 531600 --embed threads # full agent briefing with thread data
115+
```
116+
117+
The briefing with `--embed threads` is particularly useful for feeding to an LLM for triage, summarisation, or draft replies.
118+
96119
## MCP server
97120

98121
Start the embedded MCP server for AI-assisted workflows:
@@ -115,13 +138,34 @@ npx -y @operatorkit/hs mcp -t stdio
115138
"HS_INBOX_APP_ID": "your-app-id",
116139
"HS_INBOX_APP_SECRET": "your-app-secret",
117140
"HS_DOCS_API_KEY": "your-docs-api-key",
118-
"HS_INBOX_PERMISSIONS": "*:read"
141+
"HS_INBOX_PERMISSIONS": "*:read",
142+
"HS_DOCS_PERMISSIONS": "*:read"
119143
}
120144
}
121145
}
122146
}
123147
```
124148

149+
Only the credentials for the APIs you use are required — `HS_INBOX_APP_ID` + `HS_INBOX_APP_SECRET` for Inbox, `HS_DOCS_API_KEY` for Docs. Permission and PII variables are optional.
150+
151+
## PII redaction
152+
153+
An ML-powered PII redaction system designed for shared terminals, MCP/LLM workflows, and incident-safe exports.
154+
155+
- **ML-based name detection** — a multilingual NER model detects person names in freeform text (bodies, subjects, notes) and replaces them with consistent fake identities. Supports 10 languages: Arabic, Chinese, Dutch, English, French, German, Italian, Latvian, Portuguese, and Spanish.
156+
- **Deterministic pseudonyms** — same real identity always maps to the same fake name, email, and phone across commands and sessions. No mappings stored anywhere.
157+
- **Mode-aware**`customers` mode redacts only customer data; `all` mode redacts everyone.
158+
- **Runs locally** — the model runs entirely on your machine via ONNX Runtime. No API calls, no data leaves your system.
159+
160+
```bash
161+
hs pii-model install # download model (~100 MB, one-time)
162+
hs pii-model status # check install status
163+
hs inbox config set --inbox-pii-mode customers # enable redaction
164+
hs inbox conversations get 12345 --embed threads # output uses fake identities
165+
```
166+
167+
Without the model installed, freeform text fields are hidden with a notice. Structured field redaction (names, emails, phones) always works regardless.
168+
125169
## Output formats
126170

127171
| Format | Flag | Description |
@@ -131,12 +175,6 @@ npx -y @operatorkit/hs mcp -t stdio
131175
| JSON-full | `--format json-full` | Raw API response, pretty-printed |
132176
| CSV | `--format csv` | RFC 4180 CSV with headers |
133177

134-
## Safety features
135-
136-
- **PII redaction** — deterministic, layered pipeline (structured fields + free-text + source payloads). Modes: `off`, `customers`, `all`.
137-
- **Permissions** — allowlist-based `resource:operation` pairs restrict which actions are permitted. Set via `HS_INBOX_PERMISSIONS` / `HS_DOCS_PERMISSIONS`.
138-
- **Rate limiting** — built-in rate limiters respect API quotas (Inbox: 200/min, Docs: 2000/10min).
139-
140178
## Environment variables
141179

142180
| Variable | Description |
@@ -146,12 +184,18 @@ npx -y @operatorkit/hs mcp -t stdio
146184
| `HS_DOCS_API_KEY` | Docs API key |
147185
| `HS_FORMAT` | Default output format |
148186
| `HS_INBOX_PII_MODE` | PII redaction mode: `off`, `customers`, `all` |
187+
| `HS_INBOX_PII_ALLOW_UNREDACTED` | Allow `--unredacted` bypass |
188+
| `HS_INBOX_PII_SECRET` | Secret salt for deterministic pseudonyms |
149189
| `HS_INBOX_PERMISSIONS` | Inbox permission policy |
150190
| `HS_DOCS_PERMISSIONS` | Docs permission policy |
191+
| `HS_NO_UPDATE_CHECK` | Disable daily update check (`1`) |
151192

152193
## Links
153194

154195
- [GitHub](https://github.com/operator-kit/hs-cli)
196+
- [Inbox API reference](https://github.com/operator-kit/hs-cli/blob/main/docs/inbox-api.md)
197+
- [Docs API reference](https://github.com/operator-kit/hs-cli/blob/main/docs/docs-api.md)
198+
- [Developer guide](https://github.com/operator-kit/hs-cli/blob/main/DEVELOPMENT.md)
155199
- [Issues](https://github.com/operator-kit/hs-cli/issues)
156200
- [HelpScout API docs](https://developer.helpscout.com/)
157201

0 commit comments

Comments
 (0)