@getbrevo/cli 1.0.0 → 1.1.0
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/CHANGELOG.md +53 -0
- package/README.md +26 -51
- package/agent-context/AGENTS.md +70 -10
- package/agent-context/SKILL.md +51 -3
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +4 -2
- package/dist/api/client.js.map +1 -1
- package/dist/bin/index.js +31 -19
- package/dist/bin/index.js.map +1 -1
- package/dist/commands/app/create.d.ts +1 -0
- package/dist/commands/app/create.d.ts.map +1 -1
- package/dist/commands/app/create.js +57 -20
- package/dist/commands/app/create.js.map +1 -1
- package/dist/commands/app/credentials.d.ts.map +1 -1
- package/dist/commands/app/credentials.js +73 -71
- package/dist/commands/app/credentials.js.map +1 -1
- package/dist/commands/app/delete.d.ts.map +1 -1
- package/dist/commands/app/delete.js +9 -8
- package/dist/commands/app/delete.js.map +1 -1
- package/dist/commands/app/list.d.ts.map +1 -1
- package/dist/commands/app/list.js +1 -0
- package/dist/commands/app/list.js.map +1 -1
- package/dist/commands/app/scaffold.d.ts.map +1 -1
- package/dist/commands/app/scaffold.js +71 -71
- package/dist/commands/app/scaffold.js.map +1 -1
- package/dist/commands/app/scopes.d.ts +2 -0
- package/dist/commands/app/scopes.d.ts.map +1 -0
- package/dist/commands/app/scopes.js +79 -0
- package/dist/commands/app/scopes.js.map +1 -0
- package/dist/commands/app/start.d.ts.map +1 -1
- package/dist/commands/app/start.js +38 -48
- package/dist/commands/app/start.js.map +1 -1
- package/dist/commands/app/update.d.ts.map +1 -1
- package/dist/commands/app/update.js +90 -5
- package/dist/commands/app/update.js.map +1 -1
- package/dist/commands/definitions.d.ts +1 -0
- package/dist/commands/definitions.d.ts.map +1 -1
- package/dist/commands/definitions.js +67 -2
- package/dist/commands/definitions.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +73 -57
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +50 -38
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/skill/install.d.ts +4 -0
- package/dist/commands/skill/install.d.ts.map +1 -0
- package/dist/commands/skill/install.js +29 -0
- package/dist/commands/skill/install.js.map +1 -0
- package/dist/commands/skill/uninstall.d.ts +4 -0
- package/dist/commands/skill/uninstall.d.ts.map +1 -0
- package/dist/commands/skill/uninstall.js +23 -0
- package/dist/commands/skill/uninstall.js.map +1 -0
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +5 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/lang/en.d.ts +30 -2
- package/dist/lang/en.d.ts.map +1 -1
- package/dist/lang/en.js +32 -2
- package/dist/lang/en.js.map +1 -1
- package/dist/lib/auth-guard.d.ts.map +1 -1
- package/dist/lib/auth-guard.js +8 -2
- package/dist/lib/auth-guard.js.map +1 -1
- package/dist/lib/browser.js +4 -4
- package/dist/lib/browser.js.map +1 -1
- package/dist/lib/cli-version.d.ts +2 -0
- package/dist/lib/cli-version.d.ts.map +1 -0
- package/dist/lib/cli-version.js +59 -0
- package/dist/lib/cli-version.js.map +1 -0
- package/dist/lib/command-registry.js +1 -1
- package/dist/lib/command-registry.js.map +1 -1
- package/dist/lib/config.d.ts +3 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +41 -7
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/constants.d.ts +6 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +16 -8
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/hidden-input.js +1 -1
- package/dist/lib/hidden-input.js.map +1 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +14 -4
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/update-notifier.d.ts.map +1 -1
- package/dist/lib/update-notifier.js +11 -11
- package/dist/lib/update-notifier.js.map +1 -1
- package/dist/lib/validators.d.ts +17 -0
- package/dist/lib/validators.d.ts.map +1 -1
- package/dist/lib/validators.js +65 -0
- package/dist/lib/validators.js.map +1 -1
- package/dist/services/app.d.ts +3 -0
- package/dist/services/app.d.ts.map +1 -1
- package/dist/services/app.js +6 -1
- package/dist/services/app.js.map +1 -1
- package/dist/services/browser-auth.js +9 -8
- package/dist/services/browser-auth.js.map +1 -1
- package/dist/services/oauth-metadata.d.ts +7 -0
- package/dist/services/oauth-metadata.d.ts.map +1 -0
- package/dist/services/oauth-metadata.js +43 -0
- package/dist/services/oauth-metadata.js.map +1 -0
- package/dist/services/scopes-html.d.ts +3 -0
- package/dist/services/scopes-html.d.ts.map +1 -0
- package/dist/services/scopes-html.js +337 -0
- package/dist/services/scopes-html.js.map +1 -0
- package/dist/services/scopes-web.d.ts +12 -0
- package/dist/services/scopes-web.d.ts.map +1 -0
- package/dist/services/scopes-web.js +95 -0
- package/dist/services/scopes-web.js.map +1 -0
- package/dist/services/skill.d.ts +48 -0
- package/dist/services/skill.d.ts.map +1 -0
- package/dist/services/skill.js +223 -0
- package/dist/services/skill.js.map +1 -0
- package/dist/skills/index.d.ts +47 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +61 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/templates/files/AGENTS.md.tmpl +6 -1
- package/dist/templates/files/CLAUDE.md.tmpl +2 -2
- package/dist/templates/files/README.md.tmpl +3 -1
- package/dist/templates/files/app-config.json.tmpl +1 -1
- package/dist/templates/index.js +2 -2
- package/dist/templates/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/lib/min-version-check.d.ts +0 -15
- package/dist/lib/min-version-check.d.ts.map +0 -1
- package/dist/lib/min-version-check.js +0 -33
- package/dist/lib/min-version-check.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# @getbrevo/cli
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0896225: Granular OAuth scopes (BEX-197) and `logo_uri` support (BEX-194):
|
|
8
|
+
- `brevo app create` now creates apps with `contacts:read`, `contacts:write`, `crm:read`, `crm:write` instead of the legacy `all`. The CLI prints a one-line notice listing the defaults and how to change them.
|
|
9
|
+
- `brevo app update --scope <scope>` (new, repeatable) appends scopes to an app's existing set, de-duped, order-preserving. Writes back to `app-config.json` when applicable. A single flag value may contain multiple comma- or whitespace-separated tokens (`--scope "crm:read, crm:write"` is equivalent to two `--scope` flags); the same normalization heals comma-embedded entries when reading `auth.scopes` from `app-config.json`. Each resulting token is validated locally against `[A-Za-z0-9][A-Za-z0-9:_.-]*` to catch typos before the API call.
|
|
10
|
+
- `brevo app available-scopes [--json] [--web]` (new) prints the IdP's supported-scopes catalog. Text output groups scopes by category (`account`, `data_crm`, `messaging`); `--json` returns a flat array of names. OIDC-reserved scopes and magic wildcards are excluded. Sourced from `/realms/partner/scopes`.
|
|
11
|
+
- Passing `--web` to `brevo app available-scopes` additionally starts a short-lived loopback HTTP server on `127.0.0.1` and opens the user's browser to a self-contained HTML page listing every supported scope grouped by category, with a search filter. Each scope is expandable to reveal its API endpoints (chip list). A "Refresh" button on the page re-fetches scopes from the IdP without restarting the command. The server runs in the foreground until Ctrl+C (SIGINT or SIGTERM closes it cleanly). Without `--web` the command exits after printing the list — TTY detection no longer triggers the browser. `--json` always suppresses the browser.
|
|
12
|
+
- Add `logo_uri` support to `brevo app create` (`--logo-uri`), `brevo app update` (`--logo-uri`), and the `logoUri` top-level field in `app-config.json`. Flagless `brevo app update` pushes `logoUri` from the config file when present. The interactive `brevo app create` flow (also reached via `brevo app init`) now prompts for an optional logo URL; the prompt is skipped under `--json` or when `--logo-uri` is passed. The interactive prompt and its invalid-format hint now advertise the expected `https://` form.
|
|
13
|
+
|
|
14
|
+
Other changes:
|
|
15
|
+
- `brevo app create` and `brevo app update` now send the CLI's own version as `cli_version` in the request body, so the backend can track which CLI release performed each write.
|
|
16
|
+
- Removed the dormant `minCliVersion` mechanism. `brevo app scaffold` no longer writes `minCliVersion` into `app-config.json` (the constant had been `0.0.0` since introduction, so the runtime check never fired). The npm-registry update-notifier already covers the "you should upgrade" nudge. Existing `app-config.json` files keep their `minCliVersion` field harmlessly — it is now ignored. `cliVersion` (informational provenance) is unchanged.
|
|
17
|
+
|
|
18
|
+
## 1.0.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 6aeb15a: Add `brevo skill:cli` command group for installing the brevo-cli Claude Code skill into `~/.claude/skills/`. The `skill:<name>` shape reserves a namespace for future Brevo-authored skills (each gets its own top-level group rather than positional args).
|
|
23
|
+
|
|
24
|
+
**Commands**
|
|
25
|
+
- `brevo skill:cli install [--json]` — installs the brevo-cli skill, idempotently. If the skill is already at the bundled version it reports "already up to date".
|
|
26
|
+
- `brevo skill:cli uninstall [--json]` — removes the brevo-cli skill. Marker-gated, so it never touches a directory the CLI didn't create. Reports a friendly no-op when nothing is installed.
|
|
27
|
+
|
|
28
|
+
**Auto-refresh**
|
|
29
|
+
|
|
30
|
+
The skill version tracks the CLI version (read from `package.json` at module-init). Every CLI release effectively bumps the bundled skill version too, so installed copies auto-refresh after a CLI upgrade — even when `SKILL.md` itself didn't change. The refresh emits a single stderr line: `↻ refreshed brevo-cli skill (v1.0.0 → v1.0.1)`. Skipped under `CI=true`, `--json`, any `brevo skill:cli *` invocation, and when `BREVO_NO_SKILL_AUTOREFRESH=1` is set.
|
|
31
|
+
|
|
32
|
+
**Onboarding**
|
|
33
|
+
|
|
34
|
+
Discovery is doc-driven rather than interrupting interactive runs: `agent-context/AGENTS.md` opens with an "AI agents — install the skill first" section telling any agent helping with the CLI to run `brevo skill:cli install` before doing other work. Humans run `brevo skill:cli install` once when they want the AI assist; otherwise the CLI never nags. No first-run banner, no `~/.brevo/skill-banner.json` state file.
|
|
35
|
+
|
|
36
|
+
**Implementation notes**
|
|
37
|
+
- The skill catalog is bundled inline so installs work fully offline.
|
|
38
|
+
- `agent-context/SKILL.md` is the single source of truth — the CLI reads it directly via `SKILLS_BUNDLE_DIR`; manual-copy users and `brevo skill:cli install` users see the same file.
|
|
39
|
+
- Installs are tracked with a `.brevo-skill.json` marker so auto-refresh and uninstall stay safe.
|
|
40
|
+
- Skill test fixtures route through a repo-local `src/__tests__/**/__sandbox__/` directory (gitignored) instead of `os.tmpdir()` — addresses SonarCloud `S5443`.
|
|
41
|
+
|
|
42
|
+
**Docs**
|
|
43
|
+
- Fix `AGENTS.md` env-var table: the debug toggle is `BREVO_DEBUG=1`, not `DEBUG=1` (the latter never enabled debug logging — `src/lib/logger.ts` only reads `BREVO_DEBUG`).
|
|
44
|
+
- Document previously undocumented env vars in `AGENTS.md`: `BREVO_CLAUDE_HOME` (override Claude Code home used by `skill:cli`) and `BREVO_NO_UPDATE_NOTIFIER` (suppress the npm update-available notice).
|
|
45
|
+
- Round out `AGENTS.md` command table: add the missing `brevo logout` row and the `--yes` flag on `app update`; list `--json` consistently across every command that supports it.
|
|
46
|
+
- Add the missing `whoami` mapping to the `SKILL.md` decision tree.
|
|
47
|
+
- Disambiguate Claude vs non-Claude agents across docs and command surface:
|
|
48
|
+
- `SKILL.md` intro callout splits the "reading this from the repo" guidance — Claude installs the skill, other agents read `AGENTS.md` instead.
|
|
49
|
+
- `brevo skill:cli {install,uninstall} --help` descriptions now flag the commands as Claude-only.
|
|
50
|
+
- `brevo skill:cli install` prints a follow-up hint after a fresh install pointing non-Claude tools at `AGENTS.md`.
|
|
51
|
+
- Add a two-step preflight to both `SKILL.md` and `AGENTS.md`. Before any other work, agents must (1) confirm `brevo --version` returns a string — otherwise stop and ask the user to `npm install -g @getbrevo/cli` — and (2) verify their reference matches the running CLI: Claude compares `~/.claude/skills/brevo-cli/.brevo-skill.json` to `brevo --version`; non-Claude agents read the canonical bundled `AGENTS.md` from `$(npm root -g)/@getbrevo/cli/agent-context/AGENTS.md` (or yarn/local equivalent) so the doc is always in lockstep with the installed CLI.
|
|
52
|
+
|
|
53
|
+
- d4335f5: Wipe the per-app credential cache on `brevo login` when the new account differs from the previously-stored one. Cached `clientId`/`clientSecret` values belong to the prior account's apps and would mislead the new session. Same-account re-logins keep the cache intact.
|
|
54
|
+
- d4335f5: Internal: hardened scaffold test fixtures by routing the mocked `outputDir` strings through a sandbox path under `__dirname` instead of `os.tmpdir()` / hardcoded `/tmp/...`. Addresses SonarCloud `S5443` (publicly-writable directories) at all 9 callsites. Test-only change — no runtime behavior is affected.
|
|
55
|
+
|
|
3
56
|
## 1.0.0
|
|
4
57
|
|
|
5
58
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -76,10 +76,10 @@ Run `brevo --help` or `brevo <command> --help` for full command and option lists
|
|
|
76
76
|
| `brevo logout` | Clear stored credentials (`--force` to skip confirmation) |
|
|
77
77
|
| `brevo whoami` | Show the authenticated user |
|
|
78
78
|
| `brevo app init` | Guided setup — login, create app, and scaffold in one go |
|
|
79
|
-
| `brevo app create` | Create an OAuth app (`--name`, `--distribution private\|public`, repeatable `--redirect-uri`) |
|
|
79
|
+
| `brevo app create` | Create an OAuth app (`--name`, `--distribution private\|public`, repeatable `--redirect-uri`, `--logo-uri`) |
|
|
80
80
|
| `brevo app list` | List OAuth apps in your account |
|
|
81
81
|
| `brevo app credentials` | Show client ID and secret (`--app-id`, `--reveal-secret`) |
|
|
82
|
-
| `brevo app update` | Update app name
|
|
82
|
+
| `brevo app update` | Update app name, redirect URLs, or logo (`--app-id`, `--name`, repeatable `--redirect-uri`, `--logo-uri`, `--yes`) |
|
|
83
83
|
| `brevo app delete` | Delete an app (`--app-id`, `--force`) |
|
|
84
84
|
| `brevo app scaffold` | Generate starter code for an app (`--app-id`) |
|
|
85
85
|
| `brevo app start` | Run a scaffolded feature locally (e.g. `brevo app start oauth --port 3000`) |
|
|
@@ -120,6 +120,7 @@ Environment overrides:
|
|
|
120
120
|
| `BREVO_API_URL` | API base URL (HTTPS required, except for `localhost`) | `https://api.brevo.com` |
|
|
121
121
|
| `BREVO_OAUTH_PROXY_URL` | OAuth proxy used by browser login (HTTPS required, except for `localhost`) | `https://oauth-cli.brevo.com` |
|
|
122
122
|
| `BREVO_CONFIG_HOME` | Override for the credentials directory | `~/.brevo/` |
|
|
123
|
+
| `BREVO_NO_SKILL_AUTOREFRESH` | Set to `1` to suppress automatic skill refresh on `brevo` runs | off |
|
|
123
124
|
| `NO_COLOR` / `FORCE_COLOR` | Disable / force ANSI colour output | – |
|
|
124
125
|
| `DEBUG` or `--debug` | Verbose HTTP and error logging | off |
|
|
125
126
|
|
|
@@ -132,15 +133,29 @@ If you use Claude Code, Cursor, Aider, Copilot CLI, or another agent that reads
|
|
|
132
133
|
- `node_modules/@getbrevo/cli/agent-context/AGENTS.md` — overview, command list, conventions, and safety rules. Compatible with the [agents.md](https://agents.md) format.
|
|
133
134
|
- `node_modules/@getbrevo/cli/agent-context/SKILL.md` — Claude Code skill (with YAML frontmatter and trigger keywords) for auto-activation when a conversation touches the Brevo CLI.
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
### Claude Code skill (recommended)
|
|
137
|
+
|
|
138
|
+
The CLI installs and maintains the skill for you:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
brevo skill:cli install
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
This copies `SKILL.md` into `~/.claude/skills/brevo-cli/`. Every subsequent `brevo` invocation auto-refreshes it when the bundled version is newer than the installed one — you'll see a `↻ refreshed brevo-cli skill (vX → vY)` notice on stderr when that happens. Opt out with `BREVO_NO_SKILL_AUTOREFRESH=1`. Remove with `brevo skill:cli uninstall`.
|
|
145
|
+
|
|
146
|
+
On the first interactive `brevo` invocation after install, you'll also see a one-time banner on stderr inviting you to install the skill. The notice records itself at `~/.brevo/skill-banner.json` and never repeats. Skipped under CI, non-TTY, `--json`, or any `brevo skill:cli` command.
|
|
147
|
+
|
|
148
|
+
### Manual install (escape hatch)
|
|
149
|
+
|
|
150
|
+
If you prefer not to install via the CLI, copy the files in directly:
|
|
136
151
|
|
|
137
152
|
```bash
|
|
138
153
|
# AGENTS.md — append into your existing AGENTS.md, or copy if you don't have one
|
|
139
154
|
cat node_modules/@getbrevo/cli/agent-context/AGENTS.md >> AGENTS.md
|
|
140
155
|
|
|
141
|
-
# Claude Code skill
|
|
142
|
-
mkdir -p .claude/skills/brevo
|
|
143
|
-
cp node_modules/@getbrevo/cli/agent-context/SKILL.md .claude/skills/brevo/SKILL.md
|
|
156
|
+
# Claude Code skill — note the directory name matches what `brevo skill:cli install` uses
|
|
157
|
+
mkdir -p .claude/skills/brevo-cli
|
|
158
|
+
cp node_modules/@getbrevo/cli/agent-context/SKILL.md .claude/skills/brevo-cli/SKILL.md
|
|
144
159
|
```
|
|
145
160
|
|
|
146
161
|
The `AGENTS.md` content is wrapped in `<!-- BREVO_CLI_AGENTS_BEGIN -->` / `<!-- BREVO_CLI_AGENTS_END -->` markers — when you upgrade the CLI, delete the existing block (markers included) before re-running the append so the section isn't duplicated.
|
|
@@ -179,62 +194,22 @@ yarn smoke --help # full flag list
|
|
|
179
194
|
|
|
180
195
|
### Publishing
|
|
181
196
|
|
|
182
|
-
Releases use [changesets](https://github.com/changesets/changesets) and
|
|
183
|
-
|
|
184
|
-
Prerequisites for any local publish:
|
|
185
|
-
|
|
186
|
-
- `npm whoami` shows an account with `publish` permission on `@getbrevo`
|
|
187
|
-
- A clean working tree on the branch you intend to release from
|
|
188
|
-
- If your `~/.npmrc` maps `@getbrevo` to a non-public registry (e.g. GitHub Packages), the scope override wins over `publishConfig.registry` in `package.json`. Either pass `--registry=https://registry.npmjs.org/` explicitly, or comment out the `@getbrevo:registry=...` line for the duration of the publish. Confirm the `npm notice Publishing to <url>` line before continuing.
|
|
189
|
-
|
|
190
|
-
#### Stable release
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
yarn changeset # describe the change (interactive)
|
|
194
|
-
yarn version:packages # consume changesets, bump version, update CHANGELOG
|
|
195
|
-
git commit -am "chore(release): version packages"
|
|
196
|
-
yarn publish:packages # runs prepublishOnly (clean + build + test) then publishes
|
|
197
|
-
git push --follow-tags
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
#### Prerelease (alpha)
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
yarn changeset pre enter alpha # enter prerelease mode (creates .changeset/pre.json)
|
|
204
|
-
yarn changeset # describe the change
|
|
205
|
-
yarn version:packages # bumps to e.g. 0.1.0-alpha.0
|
|
206
|
-
git commit -am "chore(release): version packages (alpha)"
|
|
207
|
-
yarn publish:packages # publishes under the `alpha` dist-tag
|
|
208
|
-
git push --follow-tags
|
|
209
|
-
yarn changeset pre exit # exit prerelease mode when the alpha cycle ends
|
|
210
|
-
git commit -am "chore: exit prerelease mode"
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
Verify the result with `npm view @getbrevo/cli versions --json` (stable) or `npm view @getbrevo/cli dist-tags` (prerelease). Install an alpha for smoke-testing with `npm install -g @getbrevo/cli@alpha`.
|
|
197
|
+
Releases use [changesets](https://github.com/changesets/changesets) and publish to npm via CI. Merging a changeset to `main` opens a "Version Packages" PR; merging that PR publishes. Pushes to `release-*` branches publish alpha prereleases.
|
|
214
198
|
|
|
215
199
|
## Reporting issues
|
|
216
200
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
When filing a bug, please include:
|
|
220
|
-
|
|
221
|
-
- CLI version (`brevo --version`)
|
|
222
|
-
- Node.js version (`node --version`) and OS
|
|
223
|
-
- The command you ran and the full output (run with `--debug` for verbose logging if relevant)
|
|
224
|
-
- **Never paste real credentials** — redact API keys, client secrets, and access tokens before sharing
|
|
225
|
-
|
|
226
|
-
For security vulnerabilities, please **do not open a public issue**. Email the Brevo security team or use GitHub's [private vulnerability reporting](https://github.com/getbrevo/brevo-cli/security/advisories/new) instead.
|
|
227
|
-
|
|
228
|
-
## Contributing
|
|
201
|
+
Bugs and feature requests: [open an issue](https://github.com/getbrevo/brevo-cli/issues/new/choose) or email [support@brevo.com](mailto:support@brevo.com). Include CLI version (`brevo --version`), Node version, and the command output. Redact any credentials.
|
|
229
202
|
|
|
230
|
-
|
|
203
|
+
For security issues, use [private vulnerability reporting](https://github.com/getbrevo/brevo-cli/security/advisories/new) — do not file a public issue.
|
|
231
204
|
|
|
232
205
|
## Resources
|
|
233
206
|
|
|
234
207
|
- [Brevo Developers](https://developers.brevo.com)
|
|
208
|
+
- [CLI reference](https://developers.brevo.com/docs/cli-reference) — full command and option documentation
|
|
235
209
|
- [Package on npm](https://www.npmjs.com/package/@getbrevo/cli)
|
|
236
210
|
- [Repository](https://github.com/getbrevo/brevo-cli)
|
|
237
211
|
- [Issue tracker](https://github.com/getbrevo/brevo-cli/issues)
|
|
212
|
+
- [Email Support](mailto:support@brevo.com)
|
|
238
213
|
- [Changelog](./CHANGELOG.md)
|
|
239
214
|
|
|
240
215
|
## License
|
package/agent-context/AGENTS.md
CHANGED
|
@@ -3,6 +3,51 @@
|
|
|
3
3
|
|
|
4
4
|
This project uses the [Brevo Developer CLI](https://www.npmjs.com/package/@getbrevo/cli) (`brevo` binary) to manage Brevo OAuth applications.
|
|
5
5
|
|
|
6
|
+
## AI agents — start here
|
|
7
|
+
|
|
8
|
+
Pick the path that matches your tooling:
|
|
9
|
+
|
|
10
|
+
- **You are Claude** (Claude Code, Claude Desktop, or any agent that reads `~/.claude/skills/`) — install the brevo-cli skill before doing other work, if it isn't already at `~/.claude/skills/brevo-cli/`:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
brevo skill:cli install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The skill loads the canonical decision tree, hard rules, and exit codes in the format Claude consumes directly. Once installed it auto-refreshes on every `brevo` invocation so it stays in sync with the running CLI version (opt out with `BREVO_NO_SKILL_AUTOREFRESH=1`).
|
|
17
|
+
|
|
18
|
+
- **You are any other AI agent** (Cursor, Copilot CLI, Gemini CLI, Codex, etc.) — **do not run `brevo skill:cli install`**. The skill format is Claude-specific and the install would land in a directory your tooling doesn't read. Use this `AGENTS.md` as your reference instead — it covers the same surface in less depth.
|
|
19
|
+
|
|
20
|
+
If installation isn't possible for a Claude agent (no write access to `~/.claude/skills/`, sandboxed environment), fall back to this `AGENTS.md`.
|
|
21
|
+
|
|
22
|
+
## Before starting a new session
|
|
23
|
+
|
|
24
|
+
Run two preflight checks before any other work.
|
|
25
|
+
|
|
26
|
+
### 1. Is `brevo` installed?
|
|
27
|
+
|
|
28
|
+
Run `brevo --version`. If you get `command not found` (or any "no such binary" error), the CLI isn't installed. **Stop and tell the user to install it:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g @getbrevo/cli
|
|
32
|
+
# or
|
|
33
|
+
yarn global add @getbrevo/cli
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Don't fall back to raw HTTP against `api.brevo.com` — the `brevo` binary is the canonical entry point. Only continue once `brevo --version` returns a version string.
|
|
37
|
+
|
|
38
|
+
### 2. Is your reference up to date with the installed CLI?
|
|
39
|
+
|
|
40
|
+
- **Claude agents (skill installed at `~/.claude/skills/brevo-cli/`):**
|
|
41
|
+
1. Read the installed skill version from `~/.claude/skills/brevo-cli/.brevo-skill.json` (`version` field).
|
|
42
|
+
2. Compare against `brevo --version` from step 1.
|
|
43
|
+
3. **If they don't match, stop and tell the user to update** — ask them to run any `brevo` command (auto-refreshes the skill) or `brevo skill:cli install` to force-reinstall. Do not proceed with stale guidance.
|
|
44
|
+
- **Non-Claude agents (reading this `AGENTS.md` directly):** make sure you're reading the canonical bundled copy, not a stale fork.
|
|
45
|
+
1. Locate the canonical `AGENTS.md`. It ships inside the installed `@getbrevo/cli` package:
|
|
46
|
+
- Global npm install: `$(npm root -g)/@getbrevo/cli/agent-context/AGENTS.md`
|
|
47
|
+
- Global yarn install: `$(yarn global dir)/node_modules/@getbrevo/cli/agent-context/AGENTS.md`
|
|
48
|
+
- Local install: `node_modules/@getbrevo/cli/agent-context/AGENTS.md`
|
|
49
|
+
2. If the `AGENTS.md` you're currently reading isn't that file, **switch to the canonical copy** — your current copy may be stale (e.g. one committed into the user's repo from an older CLI version). The bundled copy is always in lockstep with the running CLI version, so no separate version string check is needed once you're reading it.
|
|
50
|
+
|
|
6
51
|
## When to use it
|
|
7
52
|
|
|
8
53
|
- Create, list, update, or delete Brevo OAuth apps
|
|
@@ -14,28 +59,39 @@ This project uses the [Brevo Developer CLI](https://www.npmjs.com/package/@getbr
|
|
|
14
59
|
|
|
15
60
|
| Command | Purpose |
|
|
16
61
|
|---|---|
|
|
17
|
-
| `brevo login` | Authenticate (browser
|
|
18
|
-
| `brevo
|
|
62
|
+
| `brevo login` | Authenticate (`--browser` forces interactive; set `BREVO_API_KEY` for non-interactive; `--json`) |
|
|
63
|
+
| `brevo logout` | Clear stored credentials (`--force`, `--json`) |
|
|
64
|
+
| `brevo whoami` | Show the authenticated account (`--json`) |
|
|
19
65
|
| `brevo app init` | Guided setup (login, create, scaffold) |
|
|
20
|
-
| `brevo app list` | List OAuth apps |
|
|
21
|
-
| `brevo app create` | Create an app (`--name`, `--distribution`, `--redirect-uri`) |
|
|
22
|
-
| `brevo app update` | Update name / redirect URLs (`--app-id`, `--name`, `--redirect-
|
|
23
|
-
| `brevo app credentials` | Show client ID / secret (`--app-id`, `--reveal-secret`) |
|
|
24
|
-
| `brevo app delete` | Delete an app (`--app-id`, `--force`) |
|
|
25
|
-
| `brevo app scaffold` | Generate starter OAuth code (`--app-id`) |
|
|
66
|
+
| `brevo app list` | List OAuth apps (`--json`) |
|
|
67
|
+
| `brevo app create` | Create an app (`--name`, `--distribution`, `--redirect-uri`, `--logo-uri`, `--json`). Defaults to scopes `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. |
|
|
68
|
+
| `brevo app update` | Update name / redirect URLs / scopes / logo (`--app-id`, `--name`, `--redirect-uri`, `--scope` repeatable appends, `--logo-uri`, `--yes`, `--json`) |
|
|
69
|
+
| `brevo app credentials` | Show client ID / secret (`--app-id`, `--reveal-secret`, `--json`) |
|
|
70
|
+
| `brevo app delete` | Delete an app (`--app-id`, `--force`, `--json`) |
|
|
71
|
+
| `brevo app scaffold` | Generate starter OAuth code (`--app-id`, `--json`) |
|
|
26
72
|
| `brevo app start oauth` | Run the scaffolded OAuth test server (`--port`) |
|
|
73
|
+
| `brevo app available-scopes` | List OAuth scopes supported by the IdP (`--json`, `--web`) |
|
|
74
|
+
| `brevo skill:cli install` | Install the brevo-cli Claude Code skill (Claude-only; auto-refreshes on every `brevo` run) |
|
|
75
|
+
| `brevo skill:cli uninstall` | Remove the brevo-cli skill from `~/.claude/skills/` (Claude-only) |
|
|
27
76
|
|
|
28
77
|
Run `brevo --help` or `brevo <command> --help` for the full set.
|
|
29
78
|
|
|
30
79
|
## Conventions
|
|
31
80
|
|
|
32
81
|
- **Every command supports `--json`** — prefer this when parsing output programmatically.
|
|
33
|
-
- **`app-config.json`** in the working directory pins the linked app — `brevo app update` and `brevo app start` read from it.
|
|
82
|
+
- **`app-config.json`** in the working directory pins the linked app — `brevo app update` and `brevo app start` read from it. The optional top-level `logoUri` string is pushed as `logo_uri` by a flagless `brevo app update`; leave it empty to keep the API value untouched.
|
|
34
83
|
- **Credentials** live at `~/.brevo/credentials.json`. Never commit this file or any `.env.local`.
|
|
35
84
|
- **Non-interactive auth:** `BREVO_API_KEY=xkeysib-... brevo login`. The legacy `--api-key` flag was removed because it leaks into shell history.
|
|
36
85
|
- **Skip prompts:** `--force` for delete/logout; `--yes` for `app update`.
|
|
37
86
|
- **Exit codes:** `0` success · `1` general error · `2` aborted · `3` auth · `4` network · `5` not found.
|
|
38
87
|
|
|
88
|
+
## Scopes
|
|
89
|
+
|
|
90
|
+
- New apps created via `brevo app create` default to `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. The CLI prints these on success.
|
|
91
|
+
- `brevo app update --scope <scope>` is repeatable and appends, mirroring `--redirect-uri`. De-duped, order-preserving. Writes back to `app-config.json` when that file describes the target app. A single flag value may contain multiple comma- or whitespace-separated tokens (`--scope "crm:read, crm:write"` is equivalent to `--scope crm:read --scope crm:write`). Same normalization is applied to `auth.scopes` when read from `app-config.json`.
|
|
92
|
+
- `brevo app available-scopes [--json] [--web]` lists the OAuth scopes the IdP currently supports. Text output groups names by category (e.g. `account`, `data_crm`, `messaging`); `--json` returns a flat `{ scopes: string[] }` of names. OIDC-reserved scopes (`openid`, `profile`, `email`, `offline_access`) and magic wildcards are excluded. The CLI validates scope **format** locally (must match `[A-Za-z0-9][A-Za-z0-9:_.-]*`) but does **not** validate that a scope is recognized by the IdP — server returns 400 on unknown scopes.
|
|
93
|
+
- Passing `--web` to `brevo app available-scopes` additionally starts a short-lived loopback HTTP server on `127.0.0.1:<ephemeral>` rendering the same catalog as a styled HTML page and opens the user's browser. It stays in the foreground until Ctrl+C. Without `--web` the command exits after printing the list — TTY detection no longer triggers the browser. `--json` always suppresses the browser (`--json` returns before `--web` is evaluated).
|
|
94
|
+
|
|
39
95
|
## Environment variables
|
|
40
96
|
|
|
41
97
|
| Variable | Purpose |
|
|
@@ -44,7 +100,10 @@ Run `brevo --help` or `brevo <command> --help` for the full set.
|
|
|
44
100
|
| `BREVO_API_URL` | Override API base (HTTPS required, except `localhost`) |
|
|
45
101
|
| `BREVO_OAUTH_PROXY_URL` | Override OAuth proxy used by browser login |
|
|
46
102
|
| `BREVO_CONFIG_HOME` | Override credentials directory (default `~/.brevo/`) |
|
|
47
|
-
| `
|
|
103
|
+
| `BREVO_CLAUDE_HOME` | Override Claude Code home used by `skill:cli` (default `~/.claude/`) |
|
|
104
|
+
| `BREVO_NO_SKILL_AUTOREFRESH` | Set to `1` to suppress automatic skill refresh on `brevo` runs |
|
|
105
|
+
| `BREVO_NO_UPDATE_NOTIFIER` | Set to `1` to suppress the npm update-available notice |
|
|
106
|
+
| `BREVO_DEBUG=1` or `--debug` | Verbose HTTP and error logging |
|
|
48
107
|
|
|
49
108
|
## Safety
|
|
50
109
|
|
|
@@ -56,4 +115,5 @@ Run `brevo --help` or `brevo <command> --help` for the full set.
|
|
|
56
115
|
- npm: <https://www.npmjs.com/package/@getbrevo/cli>
|
|
57
116
|
- Repo: <https://github.com/getbrevo/brevo-cli>
|
|
58
117
|
- Brevo developer docs: <https://developers.brevo.com>
|
|
118
|
+
- CLI reference: <https://developers.brevo.com/docs/cli-reference>
|
|
59
119
|
<!-- BREVO_CLI_AGENTS_END -->
|
package/agent-context/SKILL.md
CHANGED
|
@@ -1,23 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: brevo-cli
|
|
3
|
-
description: Use when working in a project that uses the Brevo Developer CLI (the `brevo` binary from `@getbrevo/cli`) — managing OAuth apps, scaffolding integrations, running the local OAuth test server, or invoking any `brevo …` command.
|
|
3
|
+
description: Use when working in a project that uses the Brevo Developer CLI (the `brevo` binary from `@getbrevo/cli`) — managing OAuth apps, scaffolding integrations, running the local OAuth test server, or invoking any `brevo …` command. Activates on: brevo, brevo cli, brevo app, app-config.json, OAuth Brevo, BREVO_API_KEY, getbrevo.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Brevo CLI
|
|
7
7
|
|
|
8
8
|
This project uses the Brevo Developer CLI to create and manage Brevo OAuth applications. Treat the `brevo` binary as the canonical entry point — don't shell out to `curl https://api.brevo.com/...` for things the CLI already covers.
|
|
9
9
|
|
|
10
|
+
> **Reading this from the repo rather than `~/.claude/skills/brevo-cli/`?**
|
|
11
|
+
>
|
|
12
|
+
> - **If you're Claude** (Claude Code, Claude Desktop, or any agent that reads `~/.claude/skills/`): install it as a skill with `brevo skill:cli install` so your tooling loads it natively and keeps it auto-refreshed. The repo copy is bundled with the npm package; the installed copy is what Claude actually consumes.
|
|
13
|
+
> - **If you're any other AI agent** (Cursor, Copilot CLI, Gemini, Codex, etc.): **don't run `brevo skill:cli install`** — the skill format is Claude-specific and would land in a directory your tooling doesn't read. Use `agent-context/AGENTS.md` as your reference instead; it covers the same surface in less depth.
|
|
14
|
+
|
|
15
|
+
## Before starting a new session
|
|
16
|
+
|
|
17
|
+
Run two preflight checks before any other work.
|
|
18
|
+
|
|
19
|
+
### 1. Is `brevo` installed?
|
|
20
|
+
|
|
21
|
+
Run `brevo --version`. If you get `command not found` (or any "no such binary" error), the CLI isn't installed. **Stop and tell the user to install it:**
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @getbrevo/cli
|
|
25
|
+
# or
|
|
26
|
+
yarn global add @getbrevo/cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Don't fall back to raw HTTP against `api.brevo.com` — the `brevo` binary is the canonical entry point. Only continue once `brevo --version` returns a version string.
|
|
30
|
+
|
|
31
|
+
### 2. Is this skill up to date?
|
|
32
|
+
|
|
33
|
+
* [ ] Read the installed skill version from `~/.claude/skills/brevo-cli/.brevo-skill.json` (`version` field).
|
|
34
|
+
* [ ] Compare against `brevo --version` from step 1.
|
|
35
|
+
* [ ] If they don't match, **stop and tell the user to update** — running any `brevo` command auto-refreshes the skill, or `brevo skill:cli install` force-reinstalls. Do not proceed with stale guidance.
|
|
36
|
+
|
|
10
37
|
## Decision tree
|
|
11
38
|
|
|
12
39
|
- "Set me up from scratch" → `brevo app init`
|
|
13
40
|
- "Authenticate" → `brevo login` (or `BREVO_API_KEY=xkeysib-... brevo login` for CI)
|
|
41
|
+
- "Who am I logged in as?" → `brevo whoami --json`
|
|
14
42
|
- "Show / pick an app" → `brevo app list --json`
|
|
15
|
-
- "Create an app" → `brevo app create --name "<name>" --distribution private --redirect-uri <url> --json`
|
|
16
|
-
- "Update app metadata" → `brevo app update --app-id <id> --name "<name>"` and/or `--redirect-
|
|
43
|
+
- "Create an app" → `brevo app create --name "<name>" --distribution private --redirect-uri <url> --json` (add `--logo-uri <https://…>` to set the app logo at creation time; new apps default to scopes `contacts:read`, `contacts:write`, `crm:read`, `crm:write`)
|
|
44
|
+
- "Update app metadata" → `brevo app update --app-id <id> --name "<name>"` and/or `--redirect-uri <url>` (repeatable) and/or `--scope <scope>` (repeatable, appends) and/or `--logo-uri <https://…>`
|
|
17
45
|
- "Get client credentials" → `brevo app credentials --app-id <id> --json` (add `--reveal-secret` to print the secret)
|
|
18
46
|
- "Generate starter OAuth code" → `brevo app scaffold --app-id <id>`
|
|
19
47
|
- "Run the OAuth test server" → `brevo app start oauth --port 3009` (must be inside the scaffolded directory)
|
|
20
48
|
- "Delete an app" → `brevo app delete --app-id <id> --force`
|
|
49
|
+
- "List supported OAuth scopes" → `brevo app available-scopes --json`
|
|
21
50
|
- "Sign out" → `brevo logout --force`
|
|
22
51
|
|
|
23
52
|
## Hard rules
|
|
@@ -32,13 +61,32 @@ This project uses the Brevo Developer CLI to create and manage Brevo OAuth appli
|
|
|
32
61
|
|
|
33
62
|
If `app-config.json` exists in the working directory, it pins the app — `brevo app update` and `brevo app start` use it automatically. To target a different app, pass `--app-id`.
|
|
34
63
|
|
|
64
|
+
`app-config.json` carries an optional top-level `logoUri` string. When set, a flagless `brevo app update` pushes it as `logo_uri` in the PUT body; when empty / absent, the field is left untouched on the API.
|
|
65
|
+
|
|
66
|
+
## Scopes
|
|
67
|
+
|
|
68
|
+
- New apps created via `brevo app create` default to `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. The CLI prints the default set on success and points to `brevo app update --scope` for changes.
|
|
69
|
+
- `brevo app update --scope <scope>` is **repeatable and appends** — passing `--scope X --scope Y` adds both to the app's existing scope set, de-duped, order-preserving. A single flag value may also contain multiple comma- or whitespace-separated tokens (`--scope "crm:read, crm:write"` ≡ `--scope crm:read --scope crm:write`); the same normalization is applied to `auth.scopes` when read from `app-config.json`, so a malformed entry like `"crm:write, campaigns:read"` is split into two scopes on read. To see what's currently set, run `brevo app credentials --app-id <id> --json`. To remove a scope, edit `app-config.json` and run `brevo app update` without `--scope`.
|
|
70
|
+
- `brevo app available-scopes [--json] [--web]` lists the OAuth scopes the IdP currently supports. Text output groups names by category (e.g. `account`, `data_crm`, `messaging`); `--json` returns a flat `{ scopes: string[] }` of names. OIDC-reserved scopes (`openid`, `profile`, `email`, `offline_access`) and magic wildcards are excluded. The CLI validates scope **format** locally (must match `[A-Za-z0-9][A-Za-z0-9:_.-]*`) but does **not** validate that a scope is recognized by the IdP — use `app available-scopes` to confirm spelling before passing an unfamiliar scope.
|
|
71
|
+
- Passing `--web` to `brevo app available-scopes` **also opens a browser** to a styled local page (loopback `http://127.0.0.1:<port>/`) and stays running until Ctrl+C. Without `--web` the command exits after printing the list — TTY detection no longer triggers the browser. `--json` always suppresses the browser, so agent invocations using `--json` behave the same regardless of `--web`.
|
|
72
|
+
|
|
35
73
|
## Exit codes
|
|
36
74
|
|
|
37
75
|
`0` success · `1` general error · `2` aborted · `3` auth failure · `4` network · `5` not found.
|
|
38
76
|
|
|
77
|
+
## Before sharing or committing output
|
|
78
|
+
|
|
79
|
+
* [ ] No `xkeysib-…` API keys, client secrets, refresh tokens, or contents of `~/.brevo/credentials.json` / `.env.local` in messages, logs, or diffs.
|
|
80
|
+
* [ ] Real production account / org / app IDs redacted to placeholders before sharing diagnostics.
|
|
81
|
+
|
|
82
|
+
## How this skill stays current
|
|
83
|
+
|
|
84
|
+
This SKILL.md is installed into `~/.claude/skills/brevo-cli/` by `brevo skill:cli install`. Once installed, **every `brevo` invocation auto-refreshes it** if the bundled CLI ships a newer version — you'll see a `↻ refreshed brevo-cli skill (vX → vY)` notice on stderr when that happens. Hand-editing the installed copy is not durable; the CLI overwrites it on the next run. Opt out with `BREVO_NO_SKILL_AUTOREFRESH=1`. The manual escape hatch is `brevo skill:cli uninstall`.
|
|
85
|
+
|
|
39
86
|
## More
|
|
40
87
|
|
|
41
88
|
- Help: `brevo --help`, `brevo <command> --help`
|
|
42
89
|
- npm: <https://www.npmjs.com/package/@getbrevo/cli>
|
|
43
90
|
- Repo: <https://github.com/getbrevo/brevo-cli>
|
|
44
91
|
- Brevo developer docs: <https://developers.brevo.com>
|
|
92
|
+
- CLI reference: <https://developers.brevo.com/docs/cli-reference>
|
package/dist/api/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface ApiClientDeps {
|
|
|
6
6
|
export declare function parseRetryAfter(header: string | null): number;
|
|
7
7
|
export declare function sanitizeErrorMessage(msg: string): string;
|
|
8
8
|
export declare class ApiClient {
|
|
9
|
-
private deps;
|
|
9
|
+
private readonly deps;
|
|
10
10
|
private onAuthFailure?;
|
|
11
11
|
constructor(deps: ApiClientDeps);
|
|
12
12
|
setOnAuthFailure(handler: AuthFailureHandler): void;
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAaA,KAAK,kBAAkB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACzD;AAqBD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAK7D;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAcxD;AAoBD,qBAAa,SAAS;IAGR,OAAO,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAaA,KAAK,kBAAkB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACzD;AAqBD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAK7D;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAcxD;AAoBD,qBAAa,SAAS;IAGR,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,aAAa,CAAC,CAAqB;gBAEd,IAAI,EAAE,aAAa;IAEhD,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAInD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIjD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIlD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAInC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IASvD,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,SAAW,GAAG,OAAO,CAAC,CAAC,CAAC;YASvE,OAAO;CA+FtB"}
|
package/dist/api/client.js
CHANGED
|
@@ -112,7 +112,7 @@ class ApiClient {
|
|
|
112
112
|
'Content-Type': 'application/json',
|
|
113
113
|
Accept: 'application/json',
|
|
114
114
|
...opts.headers,
|
|
115
|
-
...
|
|
115
|
+
...authHeader,
|
|
116
116
|
};
|
|
117
117
|
(0, logger_1.logHttp)(opts.method, opts.path);
|
|
118
118
|
let response;
|
|
@@ -125,7 +125,9 @@ class ApiClient {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
catch (err) {
|
|
128
|
-
|
|
128
|
+
const apiErr = new errors_1.ApiError(en_1.messages.ERR_NETWORK, 0, errors_1.ErrorCode.NETWORK_ERROR);
|
|
129
|
+
apiErr.cause = err;
|
|
130
|
+
throw apiErr;
|
|
129
131
|
}
|
|
130
132
|
(0, logger_1.logHttpResponse)(response.status, opts.path);
|
|
131
133
|
if (response.status === 401 && !isRetry && !opts.skipAuth) {
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";;;AAuCA,0CAKC;AAKD,oDAcC;AA/DD,0CAAoD;AACpD,0CAAmE;AACnE,mCAAsC;AAkBtC,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,2BAA2B,GAAG,CAAC,CAAC;AACtC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,eAAe,GAA2B;IAC9C,iBAAiB,EAAE,aAAQ,CAAC,wBAAwB;IACpD,cAAc,EAAE,aAAQ,CAAC,YAAY;CACtC,CAAC;AAEF,SAAS,mBAAmB,CAAC,OAA2B,EAAE,QAAgB;IACxE,IAAI,OAAO,IAAI,OAAO,IAAI,eAAe,EAAE,CAAC;QAC1C,OAAO,eAAe,CAAC,OAAO,CAAE,CAAC;IACnC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,+EAA+E;AAC/E,2EAA2E;AAC3E,0DAA0D;AAC1D,SAAgB,eAAe,CAAC,MAAqB;IACnD,IAAI,CAAC,MAAM;QAAE,OAAO,2BAA2B,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,2BAA2B,CAAC;IAChF,OAAO,IAAI,CAAC,GAAG,CAAC,MAA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|| (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
39
|
const commander_1 = require("commander");
|
|
40
40
|
const auth_guard_1 = require("../lib/auth-guard");
|
|
41
41
|
const logger_1 = require("../lib/logger");
|
|
@@ -46,13 +46,12 @@ const hidden_input_1 = require("../lib/hidden-input");
|
|
|
46
46
|
const config_1 = require("../lib/config");
|
|
47
47
|
const constants_1 = require("../lib/constants");
|
|
48
48
|
const oauth_refresh_1 = require("../services/oauth-refresh");
|
|
49
|
-
const errors_2 = require("../lib/errors");
|
|
50
49
|
const ui_1 = require("../lib/ui");
|
|
51
50
|
const container_1 = require("../container");
|
|
52
51
|
const command_registry_1 = require("../lib/command-registry");
|
|
53
52
|
const definitions_1 = require("../commands/definitions");
|
|
54
53
|
const update_notifier_1 = require("../lib/update-notifier");
|
|
55
|
-
const
|
|
54
|
+
const skill_1 = require("../services/skill");
|
|
56
55
|
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf-8'));
|
|
57
56
|
const version = pkg.version;
|
|
58
57
|
// Version update check — async, non-blocking. Cached at ~/.brevo/update-check.json (24h TTL).
|
|
@@ -65,8 +64,6 @@ const showBannerEarly = (0, update_notifier_1.shouldShowBannerBefore)(process.ar
|
|
|
65
64
|
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {
|
|
66
65
|
(0, logger_1.logWarn)(en_1.messages.TLS_VERIFICATION_DISABLED);
|
|
67
66
|
}
|
|
68
|
-
// Warn if running CLI is older than the project's declared minCliVersion.
|
|
69
|
-
(0, min_version_check_1.warnIfCliBelowMinVersion)({ currentVersion: version, argv: process.argv });
|
|
70
67
|
const program = new commander_1.Command();
|
|
71
68
|
program
|
|
72
69
|
.name('brevo')
|
|
@@ -86,17 +83,27 @@ program
|
|
|
86
83
|
` -h, --help display help for command`,
|
|
87
84
|
``,
|
|
88
85
|
`Commands:`,
|
|
89
|
-
` login [--browser] [--json] Authenticate with your Brevo account`,
|
|
90
|
-
` logout [--json]
|
|
91
|
-
` whoami [--json]
|
|
92
|
-
|
|
93
|
-
`
|
|
94
|
-
` app
|
|
95
|
-
` app
|
|
96
|
-
` app
|
|
97
|
-
` app
|
|
98
|
-
` app
|
|
99
|
-
` app
|
|
86
|
+
` brevo login [--browser] [--json] Authenticate with your Brevo account`,
|
|
87
|
+
` brevo logout [--json] Clear stored credentials`,
|
|
88
|
+
` brevo whoami [--json] Show current authenticated user`,
|
|
89
|
+
``,
|
|
90
|
+
`App commands:`,
|
|
91
|
+
` brevo app init Quick setup — login, create app, and scaffold`,
|
|
92
|
+
` brevo app create [--name] [--distribution private|public] [--redirect-uri <url>...] [--logo-uri <url>] [--json]`,
|
|
93
|
+
` brevo app list [--json]`,
|
|
94
|
+
` brevo app credentials [--app-id <id>] [--reveal-secret] [--json]`,
|
|
95
|
+
` brevo app update [--app-id <id>] [--name] [--redirect-uri <url>...] [--logo-uri <url>] [--json]`,
|
|
96
|
+
` brevo app delete [--app-id <id>] [--force] [--json]`,
|
|
97
|
+
` brevo app scaffold [--app-id <id>] [--json]`,
|
|
98
|
+
` brevo app start [feature] [--port <port>]`,
|
|
99
|
+
``,
|
|
100
|
+
`Skill commands:`,
|
|
101
|
+
` brevo skill:cli install [--json] Install the brevo-cli Claude Code skill`,
|
|
102
|
+
` brevo skill:cli uninstall [--json] Remove the brevo-cli skill`,
|
|
103
|
+
``,
|
|
104
|
+
`Scope commands:`,
|
|
105
|
+
` brevo app available-scopes [--web] [--json] List OAuth scopes supported by the IdP`,
|
|
106
|
+
` (--web opens the catalog in a local browser page)`,
|
|
100
107
|
``,
|
|
101
108
|
`Run \`brevo <command> --help\` for details on a specific command.`,
|
|
102
109
|
``,
|
|
@@ -107,6 +114,7 @@ program
|
|
|
107
114
|
` $ brevo app list --json # list apps as JSON`,
|
|
108
115
|
` $ brevo app scaffold --app-id APPID # generate starter code`,
|
|
109
116
|
` $ brevo app start oauth --port 3000 # start OAuth test server`,
|
|
117
|
+
` $ brevo app available-scopes --web # browse OAuth scope catalog`,
|
|
110
118
|
``,
|
|
111
119
|
].join('\n');
|
|
112
120
|
},
|
|
@@ -127,7 +135,7 @@ program
|
|
|
127
135
|
// Auth guard — blocks unauthenticated access (except login, logout, help)
|
|
128
136
|
(0, auth_guard_1.installAuthGuard)(program);
|
|
129
137
|
// ──────────────── Register all commands ────────────────
|
|
130
|
-
(0, command_registry_1.registerAll)(program, definitions_1.topLevelCommands, [definitions_1.appCommandGroup]);
|
|
138
|
+
(0, command_registry_1.registerAll)(program, definitions_1.topLevelCommands, [definitions_1.appCommandGroup, definitions_1.skillCommandGroup]);
|
|
131
139
|
// ──────────────── Re-auth handler ────────────────
|
|
132
140
|
container_1.client.setOnAuthFailure(async () => {
|
|
133
141
|
const auth = (0, config_1.getAuthCred)();
|
|
@@ -144,7 +152,7 @@ container_1.client.setOnAuthFailure(async () => {
|
|
|
144
152
|
catch (err) {
|
|
145
153
|
if (err instanceof oauth_refresh_1.RefreshError && err.unauthorized) {
|
|
146
154
|
(0, config_1.clearCredentials)();
|
|
147
|
-
throw new
|
|
155
|
+
throw new errors_1.AuthExpiredError();
|
|
148
156
|
}
|
|
149
157
|
throw err;
|
|
150
158
|
}
|
|
@@ -182,6 +190,10 @@ earlyNotify
|
|
|
182
190
|
if (!showBannerEarly) {
|
|
183
191
|
await (0, update_notifier_1.notifyUpdate)(updateCheck, { name: pkg.name, version });
|
|
184
192
|
}
|
|
193
|
+
// Local skill catalog check — sync, no network. Silently refreshes any
|
|
194
|
+
// installed skill that's behind the bundled catalog so the AI tool always
|
|
195
|
+
// sees the latest primer. Opt out with BREVO_NO_SKILL_AUTOREFRESH=1.
|
|
196
|
+
skill_1.skillService.autoRefreshOutdated();
|
|
185
197
|
// Force exit — Node's native fetch keeps TCP connections alive which can
|
|
186
198
|
// prevent the process from exiting when running against local servers.
|
|
187
199
|
process.exit(0);
|
package/dist/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,4CAA8B;AAC9B,gDAAkC;AAClC,yCAAoC;AACpC,kDAAqD;AACrD,0CAAuE;AACvE,kDAA+C;AAC/C,0CAAuE;AACvE,mCAAsC;AACtC,sDAAsD;AACtD,0CAAkG;AAClG,gDAAkF;AAClF,6DAA6E;AAC7E,kCAA8C;AAE9C,4CAAsC;AACtC,8DAAsD;AACtD,yDAA+F;AAC/F,4DAAgG;AAChG,6CAAiD;AAEjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAChG,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC;AAEpC,8FAA8F;AAC9F,4FAA4F;AAC5F,MAAM,WAAW,GAAG,IAAA,kCAAgB,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAClE,4EAA4E;AAC5E,0EAA0E;AAC1E,yBAAyB;AACzB,MAAM,eAAe,GAAG,IAAA,wCAAsB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE7D,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,KAAK,GAAG,EAAE,CAAC;IACrD,IAAA,gBAAO,EAAC,aAAQ,CAAC,yBAAyB,CAAC,CAAC;AAC9C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