@letterapp/cli 0.2.0 → 0.3.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 +53 -18
- package/dist/index.js +885 -28
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -26,7 +26,14 @@ letter --version
|
|
|
26
26
|
|
|
27
27
|
### For AI Agents
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Point your agent at the [agent setup guide](https://letter.app/docs/agent-setup):
|
|
30
|
+
it runs `npx @letterapp/cli` (which provisions the key and installs the SDK),
|
|
31
|
+
then instruments `identify` / `track` in your codebase. After login the CLI also
|
|
32
|
+
prints a ready-to-paste prompt so you can hand the last mile to any agent. The
|
|
33
|
+
flow is language-agnostic: Node, Python, and Ruby get their SDK, everything else
|
|
34
|
+
gets HTTP API instructions.
|
|
35
|
+
|
|
36
|
+
Or add the Letter MCP server so your agent can set up and verify with tools instead of shell parsing:
|
|
30
37
|
|
|
31
38
|
```json
|
|
32
39
|
{
|
|
@@ -52,10 +59,12 @@ What happens:
|
|
|
52
59
|
|
|
53
60
|
1. The CLI prints a short confirmation code and (after you press Enter) opens your browser to the Letter dashboard.
|
|
54
61
|
2. You confirm the code matches and pick the project to connect.
|
|
55
|
-
3. Letter mints
|
|
62
|
+
3. Letter mints **two** credentials and sends them to the CLI over a secure back channel:
|
|
63
|
+
- a project **ingestion key** (`lt_live_*`) written to `.env.local` as `LETTER_API_KEY` for the SDK / ingestion API, and
|
|
64
|
+
- a workspace **Personal Access Token** (`lt_pat_*`) stored in `~/.letter/credentials.json` for the CLI's management commands and `@letterapp/mcp`.
|
|
56
65
|
4. It detects your package manager and installs `@letterapp/node`.
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
Neither secret is printed to the terminal or chat. You never pass a token by hand: each command picks the right credential automatically.
|
|
59
68
|
|
|
60
69
|
---
|
|
61
70
|
|
|
@@ -99,8 +108,8 @@ letter auth logout
|
|
|
99
108
|
### Config
|
|
100
109
|
|
|
101
110
|
```bash
|
|
102
|
-
#
|
|
103
|
-
letter config set base-url
|
|
111
|
+
# Set the API origin (defaults to https://api.letter.app).
|
|
112
|
+
letter config set base-url https://api.letter.app
|
|
104
113
|
|
|
105
114
|
# Show current configuration.
|
|
106
115
|
letter config get
|
|
@@ -109,6 +118,42 @@ letter config get
|
|
|
109
118
|
letter config reset
|
|
110
119
|
```
|
|
111
120
|
|
|
121
|
+
### Manage your workspace
|
|
122
|
+
|
|
123
|
+
The same things the dashboard does are available as resource commands, backed by
|
|
124
|
+
the workspace PAT from `letter login`. Each group has `list` / `get` / `create` /
|
|
125
|
+
`update` / `delete` plus verb subcommands; run `letter <group> --help` for the
|
|
126
|
+
exact flags. Project-scoped groups default to the connected project and accept
|
|
127
|
+
`--project <slug>`.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
letter me # identity, workspace, role
|
|
131
|
+
letter projects list --json
|
|
132
|
+
letter contacts list --limit 20
|
|
133
|
+
letter segments preview --filter @paid.json
|
|
134
|
+
letter sequences draft seq_123 --graph @graph.json --trigger @trigger.json --expected-revision 7
|
|
135
|
+
letter sequences publish seq_123
|
|
136
|
+
letter broadcasts preflight bc_42
|
|
137
|
+
letter broadcasts schedule bc_42 --scheduled-at 2026-06-01T09:00:00Z
|
|
138
|
+
letter domains create --domain mail.acme.com
|
|
139
|
+
letter sender-identity --from-email hi@mail.acme.com --from-name "Acme"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Groups: `projects`, `members`, `invitations`, `api-keys`, `contacts`,
|
|
143
|
+
`accounts`, `events`, `suppressions`, `segments`, `sequences`, `broadcasts`,
|
|
144
|
+
`templates`, `domains`, `project-tokens`, `sender-identity`, `sending-mode`,
|
|
145
|
+
`me`. Full reference: [letter.app/docs/cli](https://letter.app/docs/cli) and the
|
|
146
|
+
[Management API](https://letter.app/docs/management-api).
|
|
147
|
+
|
|
148
|
+
### Two credentials, one login
|
|
149
|
+
|
|
150
|
+
| Purpose | Format | Dashboard | CLI group | Stored as |
|
|
151
|
+
| --- | --- | --- | --- | --- |
|
|
152
|
+
| Send events (SDK / ingestion) | `lt_live_*` | Project tokens | `project-tokens` | `LETTER_API_KEY` in `.env.local` |
|
|
153
|
+
| Run the CLI / Management API | `lt_pat_*` | API keys | `api-keys` | `~/.letter/credentials.json` |
|
|
154
|
+
|
|
155
|
+
(The older group names `keys` and `tokens` still work as aliases.)
|
|
156
|
+
|
|
112
157
|
---
|
|
113
158
|
|
|
114
159
|
## Output Modes
|
|
@@ -127,7 +172,9 @@ letter --json status | jq '.events'
|
|
|
127
172
|
|
|
128
173
|
| Variable | Default | Purpose |
|
|
129
174
|
| --- | --- | --- |
|
|
130
|
-
| `LETTER_API_KEY` | (from credential store) | Overrides the stored key (CI). |
|
|
175
|
+
| `LETTER_API_KEY` | (from credential store) | Project ingestion key (`lt_live_*`) for the SDK / `letter status`. Overrides the stored key (CI). |
|
|
176
|
+
| `LETTER_PAT` | (from credential store) | Workspace PAT (`lt_pat_*`) for management commands. Set it to run them without `letter login` (CI). |
|
|
177
|
+
| `LETTER_PROJECT` | (connected project) | Default project slug for project-scoped management commands. |
|
|
131
178
|
| `LETTER_BASE_URL` | `https://api.letter.app` | API origin for self-host / local dev. |
|
|
132
179
|
|
|
133
180
|
---
|
|
@@ -174,18 +221,6 @@ node dist/index.js --help
|
|
|
174
221
|
|
|
175
222
|
---
|
|
176
223
|
|
|
177
|
-
## Roadmap
|
|
178
|
-
|
|
179
|
-
v1 ships the secure setup/login flow plus connection helpers. The command
|
|
180
|
-
structure is built to extend: future authenticated areas register the same way
|
|
181
|
-
and reuse the credential store + API client, for example:
|
|
182
|
-
|
|
183
|
-
- `letter sequences` — list / create / configure automation sequences
|
|
184
|
-
- `letter broadcast` — create and send broadcasts
|
|
185
|
-
- `letter contacts`, `letter events`, `letter keys`
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
224
|
## See Also
|
|
190
225
|
|
|
191
226
|
- [`@letterapp/mcp`](https://www.npmjs.com/package/@letterapp/mcp) — MCP server for AI agents.
|