@getbrevo/cli 1.0.0-alpha.0 → 1.0.1
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 +40 -2
- package/README.md +35 -46
- package/agent-context/AGENTS.md +61 -9
- package/agent-context/SKILL.md +40 -2
- 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 +26 -16
- package/dist/bin/index.js.map +1 -1
- package/dist/commands/app/create.js +8 -8
- 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/scaffold.d.ts.map +1 -1
- package/dist/commands/app/scaffold.js +69 -70
- package/dist/commands/app/scaffold.js.map +1 -1
- 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/definitions.d.ts +1 -0
- package/dist/commands/definitions.d.ts.map +1 -1
- package/dist/commands/definitions.js +23 -1
- package/dist/commands/definitions.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +59 -56
- 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 +7 -0
- package/dist/lang/en.d.ts.map +1 -1
- package/dist/lang/en.js +8 -0
- 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/command-registry.js +1 -1
- package/dist/lib/command-registry.js.map +1 -1
- package/dist/lib/config.d.ts +2 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +26 -6
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +6 -6
- 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/services/browser-auth.js +9 -8
- package/dist/services/browser-auth.js.map +1 -1
- 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 +46 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +80 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/templates/files/AGENTS.md.tmpl +5 -0
- package/dist/templates/files/CLAUDE.md.tmpl +1 -1
- package/dist/templates/files/README.md.tmpl +1 -0
- package/dist/templates/index.js +2 -2
- package/dist/templates/index.js.map +1 -1
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,48 @@
|
|
|
1
1
|
# @getbrevo/cli
|
|
2
2
|
|
|
3
|
-
## 1.0.
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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).
|
|
8
|
+
|
|
9
|
+
**Commands**
|
|
10
|
+
- `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".
|
|
11
|
+
- `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.
|
|
12
|
+
|
|
13
|
+
**Auto-refresh**
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
**Onboarding**
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
**Implementation notes**
|
|
22
|
+
- The skill catalog is bundled inline so installs work fully offline.
|
|
23
|
+
- `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.
|
|
24
|
+
- Installs are tracked with a `.brevo-skill.json` marker so auto-refresh and uninstall stay safe.
|
|
25
|
+
- Skill test fixtures route through a repo-local `src/__tests__/**/__sandbox__/` directory (gitignored) instead of `os.tmpdir()` — addresses SonarCloud `S5443`.
|
|
26
|
+
|
|
27
|
+
**Docs**
|
|
28
|
+
- 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`).
|
|
29
|
+
- 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).
|
|
30
|
+
- 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.
|
|
31
|
+
- Add the missing `whoami` mapping to the `SKILL.md` decision tree.
|
|
32
|
+
- Disambiguate Claude vs non-Claude agents across docs and command surface:
|
|
33
|
+
- `SKILL.md` intro callout splits the "reading this from the repo" guidance — Claude installs the skill, other agents read `AGENTS.md` instead.
|
|
34
|
+
- `brevo skill:cli {install,uninstall} --help` descriptions now flag the commands as Claude-only.
|
|
35
|
+
- `brevo skill:cli install` prints a follow-up hint after a fresh install pointing non-Claude tools at `AGENTS.md`.
|
|
36
|
+
- 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.
|
|
37
|
+
|
|
38
|
+
- 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.
|
|
39
|
+
- 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.
|
|
40
|
+
|
|
41
|
+
## 1.0.0
|
|
4
42
|
|
|
5
43
|
### Major Changes
|
|
6
44
|
|
|
7
|
-
-
|
|
45
|
+
- 93dad27: Initial release of `@getbrevo/cli` — the Brevo Developer CLI for creating, managing, and testing OAuth integrations from the terminal. Published to the public npm registry (`registry.npmjs.org`) under `@getbrevo/cli`.
|
|
8
46
|
|
|
9
47
|
**Authentication & setup**
|
|
10
48
|
- `brevo login` / `brevo logout` / `brevo whoami` — authenticate with a Brevo API key, stored at `~/.brevo/credentials.json`. Invalid keys surface a single, consistent `Invalid API key. Please check and try again.` message on first attempt and on retry.
|
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ For non-interactive use (CI), set `BREVO_API_KEY=<key>` before running `brevo lo
|
|
|
99
99
|
Environment overrides:
|
|
100
100
|
|
|
101
101
|
- `BREVO_API_URL` — points the CLI at a different Brevo API (defaults to `https://api.brevo.com`).
|
|
102
|
-
- `BREVO_OAUTH_PROXY_URL` — points the browser-login flow at a different OAuth proxy (defaults to `https://oauth-cli.brevo.com`; useful for
|
|
102
|
+
- `BREVO_OAUTH_PROXY_URL` — points the browser-login flow at a different OAuth proxy (defaults to `https://oauth-cli.brevo.com`; useful for local development or non-default environments).
|
|
103
103
|
|
|
104
104
|
## Exit codes
|
|
105
105
|
|
|
@@ -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.
|
|
@@ -158,69 +173,43 @@ yarn test # run jest
|
|
|
158
173
|
yarn test:ci # jest --coverage
|
|
159
174
|
yarn lint # ESLint on src/
|
|
160
175
|
yarn format # prettier --write
|
|
176
|
+
yarn smoke # end-to-end smoke test against the real API (see below)
|
|
161
177
|
yarn clean # remove dist/
|
|
162
178
|
```
|
|
163
179
|
|
|
164
180
|
A husky pre-commit hook runs prettier and eslint on staged `.ts` files and then runs the full test suite.
|
|
165
181
|
|
|
166
|
-
###
|
|
167
|
-
|
|
168
|
-
Releases use [changesets](https://github.com/changesets/changesets) and ship to the public npm registry under `@getbrevo`. **Prefer the CI flow** — pushing changesets to `main` opens a "Version Packages" PR (`.github/workflows/release.yaml`); pushing to a `release-*` branch publishes alpha prereleases (`.github/workflows/pre-release.yaml`). CI provides npm provenance via OIDC. Publish locally only when CI is unavailable.
|
|
182
|
+
### Smoke test
|
|
169
183
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
- `npm whoami` shows an account with `publish` permission on `@getbrevo`
|
|
173
|
-
- A clean working tree on the branch you intend to release from
|
|
174
|
-
- 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.
|
|
175
|
-
|
|
176
|
-
#### Stable release
|
|
184
|
+
`yarn smoke` exercises the full CLI lifecycle (login → app create → scaffold → start → delete → logout) against the real Brevo API. App creation, scaffold, and start always run via the individual commands (`brevo app create`, `brevo app scaffold`, `brevo app start`). The interactive `brevo app init` wizard is **not** part of the default run — pass `--with-init` to also exercise it as an extra step (which creates and deletes a second app).
|
|
177
185
|
|
|
178
186
|
```bash
|
|
179
|
-
yarn
|
|
180
|
-
yarn
|
|
181
|
-
|
|
182
|
-
yarn
|
|
183
|
-
|
|
187
|
+
yarn smoke # default run (no init wizard)
|
|
188
|
+
yarn smoke --with-init # also exercise `brevo app init`
|
|
189
|
+
yarn smoke --skip-auth # assume already logged in
|
|
190
|
+
yarn smoke --ci # API-key auth via BREVO_API_KEY (non-interactive)
|
|
191
|
+
yarn smoke --against=published # run against the published npm package instead of local build
|
|
192
|
+
yarn smoke --help # full flag list
|
|
184
193
|
```
|
|
185
194
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
yarn changeset pre enter alpha # enter prerelease mode (creates .changeset/pre.json)
|
|
190
|
-
yarn changeset # describe the change
|
|
191
|
-
yarn version:packages # bumps to e.g. 0.1.0-alpha.0
|
|
192
|
-
git commit -am "chore(release): version packages (alpha)"
|
|
193
|
-
yarn publish:packages # publishes under the `alpha` dist-tag
|
|
194
|
-
git push --follow-tags
|
|
195
|
-
yarn changeset pre exit # exit prerelease mode when the alpha cycle ends
|
|
196
|
-
git commit -am "chore: exit prerelease mode"
|
|
197
|
-
```
|
|
195
|
+
### Publishing
|
|
198
196
|
|
|
199
|
-
|
|
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.
|
|
200
198
|
|
|
201
199
|
## Reporting issues
|
|
202
200
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
When filing a bug, please include:
|
|
206
|
-
|
|
207
|
-
- CLI version (`brevo --version`)
|
|
208
|
-
- Node.js version (`node --version`) and OS
|
|
209
|
-
- The command you ran and the full output (run with `--debug` for verbose logging if relevant)
|
|
210
|
-
- **Never paste real credentials** — redact API keys, client secrets, and access tokens before sharing
|
|
211
|
-
|
|
212
|
-
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.
|
|
213
|
-
|
|
214
|
-
## 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.
|
|
215
202
|
|
|
216
|
-
|
|
203
|
+
For security issues, use [private vulnerability reporting](https://github.com/getbrevo/brevo-cli/security/advisories/new) — do not file a public issue.
|
|
217
204
|
|
|
218
205
|
## Resources
|
|
219
206
|
|
|
220
207
|
- [Brevo Developers](https://developers.brevo.com)
|
|
208
|
+
- [CLI reference](https://developers.brevo.com/docs/cli-reference) — full command and option documentation
|
|
221
209
|
- [Package on npm](https://www.npmjs.com/package/@getbrevo/cli)
|
|
222
210
|
- [Repository](https://github.com/getbrevo/brevo-cli)
|
|
223
211
|
- [Issue tracker](https://github.com/getbrevo/brevo-cli/issues)
|
|
212
|
+
- [Email Support](mailto:support@brevo.com)
|
|
224
213
|
- [Changelog](./CHANGELOG.md)
|
|
225
214
|
|
|
226
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,16 +59,19 @@ 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`, `--json`) |
|
|
68
|
+
| `brevo app update` | Update name / redirect URLs (`--app-id`, `--name`, `--redirect-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 skill:cli install` | Install the brevo-cli Claude Code skill (Claude-only; auto-refreshes on every `brevo` run) |
|
|
74
|
+
| `brevo skill:cli uninstall` | Remove the brevo-cli skill from `~/.claude/skills/` (Claude-only) |
|
|
27
75
|
|
|
28
76
|
Run `brevo --help` or `brevo <command> --help` for the full set.
|
|
29
77
|
|
|
@@ -44,7 +92,10 @@ Run `brevo --help` or `brevo <command> --help` for the full set.
|
|
|
44
92
|
| `BREVO_API_URL` | Override API base (HTTPS required, except `localhost`) |
|
|
45
93
|
| `BREVO_OAUTH_PROXY_URL` | Override OAuth proxy used by browser login |
|
|
46
94
|
| `BREVO_CONFIG_HOME` | Override credentials directory (default `~/.brevo/`) |
|
|
47
|
-
| `
|
|
95
|
+
| `BREVO_CLAUDE_HOME` | Override Claude Code home used by `skill:cli` (default `~/.claude/`) |
|
|
96
|
+
| `BREVO_NO_SKILL_AUTOREFRESH` | Set to `1` to suppress automatic skill refresh on `brevo` runs |
|
|
97
|
+
| `BREVO_NO_UPDATE_NOTIFIER` | Set to `1` to suppress the npm update-available notice |
|
|
98
|
+
| `BREVO_DEBUG=1` or `--debug` | Verbose HTTP and error logging |
|
|
48
99
|
|
|
49
100
|
## Safety
|
|
50
101
|
|
|
@@ -56,4 +107,5 @@ Run `brevo --help` or `brevo <command> --help` for the full set.
|
|
|
56
107
|
- npm: <https://www.npmjs.com/package/@getbrevo/cli>
|
|
57
108
|
- Repo: <https://github.com/getbrevo/brevo-cli>
|
|
58
109
|
- Brevo developer docs: <https://developers.brevo.com>
|
|
110
|
+
- CLI reference: <https://developers.brevo.com/docs/cli-reference>
|
|
59
111
|
<!-- BREVO_CLI_AGENTS_END -->
|
package/agent-context/SKILL.md
CHANGED
|
@@ -1,19 +1,47 @@
|
|
|
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
43
|
- "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-
|
|
44
|
+
- "Update app metadata" → `brevo app update --app-id <id> --name "<name>"` and/or `--redirect-uri <url>` (repeatable)
|
|
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)
|
|
@@ -36,9 +64,19 @@ If `app-config.json` exists in the working directory, it pins the app — `brevo
|
|
|
36
64
|
|
|
37
65
|
`0` success · `1` general error · `2` aborted · `3` auth failure · `4` network · `5` not found.
|
|
38
66
|
|
|
67
|
+
## Before sharing or committing output
|
|
68
|
+
|
|
69
|
+
* [ ] No `xkeysib-…` API keys, client secrets, refresh tokens, or contents of `~/.brevo/credentials.json` / `.env.local` in messages, logs, or diffs.
|
|
70
|
+
* [ ] Real production account / org / app IDs redacted to placeholders before sharing diagnostics.
|
|
71
|
+
|
|
72
|
+
## How this skill stays current
|
|
73
|
+
|
|
74
|
+
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`.
|
|
75
|
+
|
|
39
76
|
## More
|
|
40
77
|
|
|
41
78
|
- Help: `brevo --help`, `brevo <command> --help`
|
|
42
79
|
- npm: <https://www.npmjs.com/package/@getbrevo/cli>
|
|
43
80
|
- Repo: <https://github.com/getbrevo/brevo-cli>
|
|
44
81
|
- Brevo developer docs: <https://developers.brevo.com>
|
|
82
|
+
- 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,MAAM,EAAE,uBAAuB,CAAC,CAAC;AACnD,CAAC;AAED,mFAAmF;AACnF,8EAA8E;AAC9E,mEAAmE;AACnE,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,OAAO,CACL,GAAG;QACD,gCAAgC;QAChC,4CAA4C;SAC3C,OAAO,CAAC,0BAA0B,EAAE,EAAE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AAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACpE,MAAM,IAAI,iBAAQ,CAAC,aAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,EAAE,kBAAS,CAAC,YAAY,CAAC,CAAC;QACzF,CAAC;QAED,IAAA,iBAAQ,EAAC,YAAY,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACtE,MAAM,WAAW,GACf,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO;gBAC9C,CAAC,CAAC,IAAI,CAAC,OAAO;gBACd,CAAC,CAAC,8BAA8B,QAAQ,CAAC,MAAM,EAAE,CAAC;YACtD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACvD,MAAM,IAAI,iBAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAChG,CAAC;QAED,OAAO,IAAS,CAAC;IACnB,CAAC;CACF;AA9ID,8BA8IC"}
|
package/dist/bin/index.js
CHANGED
|
@@ -34,8 +34,8 @@ var __importStar = (this && this.__importStar) || (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,12 +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");
|
|
54
|
+
const skill_1 = require("../services/skill");
|
|
55
55
|
const min_version_check_1 = require("../lib/min-version-check");
|
|
56
56
|
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf-8'));
|
|
57
57
|
const version = pkg.version;
|
|
@@ -86,17 +86,23 @@ program
|
|
|
86
86
|
` -h, --help display help for command`,
|
|
87
87
|
``,
|
|
88
88
|
`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
|
-
`
|
|
99
|
-
` app
|
|
89
|
+
` brevo login [--browser] [--json] Authenticate with your Brevo account`,
|
|
90
|
+
` brevo logout [--json] Clear stored credentials`,
|
|
91
|
+
` brevo whoami [--json] Show current authenticated user`,
|
|
92
|
+
``,
|
|
93
|
+
`App commands:`,
|
|
94
|
+
` brevo app init Quick setup — login, create app, and scaffold`,
|
|
95
|
+
` brevo app create [--name] [--distribution private|public] [--json]`,
|
|
96
|
+
` brevo app list [--json]`,
|
|
97
|
+
` brevo app credentials [--app-id <id>] [--reveal-secret] [--json]`,
|
|
98
|
+
` brevo app update [--json]`,
|
|
99
|
+
` brevo app delete [--app-id <id>] [--force] [--json]`,
|
|
100
|
+
` brevo app scaffold [--app-id <id>] [--json]`,
|
|
101
|
+
` brevo app start [feature] [--port <port>]`,
|
|
102
|
+
``,
|
|
103
|
+
`Skill commands:`,
|
|
104
|
+
` brevo skill:cli install [--json] Install the brevo-cli Claude Code skill`,
|
|
105
|
+
` brevo skill:cli uninstall [--json] Remove the brevo-cli skill`,
|
|
100
106
|
``,
|
|
101
107
|
`Run \`brevo <command> --help\` for details on a specific command.`,
|
|
102
108
|
``,
|
|
@@ -127,7 +133,7 @@ program
|
|
|
127
133
|
// Auth guard — blocks unauthenticated access (except login, logout, help)
|
|
128
134
|
(0, auth_guard_1.installAuthGuard)(program);
|
|
129
135
|
// ──────────────── Register all commands ────────────────
|
|
130
|
-
(0, command_registry_1.registerAll)(program, definitions_1.topLevelCommands, [definitions_1.appCommandGroup]);
|
|
136
|
+
(0, command_registry_1.registerAll)(program, definitions_1.topLevelCommands, [definitions_1.appCommandGroup, definitions_1.skillCommandGroup]);
|
|
131
137
|
// ──────────────── Re-auth handler ────────────────
|
|
132
138
|
container_1.client.setOnAuthFailure(async () => {
|
|
133
139
|
const auth = (0, config_1.getAuthCred)();
|
|
@@ -144,7 +150,7 @@ container_1.client.setOnAuthFailure(async () => {
|
|
|
144
150
|
catch (err) {
|
|
145
151
|
if (err instanceof oauth_refresh_1.RefreshError && err.unauthorized) {
|
|
146
152
|
(0, config_1.clearCredentials)();
|
|
147
|
-
throw new
|
|
153
|
+
throw new errors_1.AuthExpiredError();
|
|
148
154
|
}
|
|
149
155
|
throw err;
|
|
150
156
|
}
|
|
@@ -182,6 +188,10 @@ earlyNotify
|
|
|
182
188
|
if (!showBannerEarly) {
|
|
183
189
|
await (0, update_notifier_1.notifyUpdate)(updateCheck, { name: pkg.name, version });
|
|
184
190
|
}
|
|
191
|
+
// Local skill catalog check — sync, no network. Silently refreshes any
|
|
192
|
+
// installed skill that's behind the bundled catalog so the AI tool always
|
|
193
|
+
// sees the latest primer. Opt out with BREVO_NO_SKILL_AUTOREFRESH=1.
|
|
194
|
+
skill_1.skillService.autoRefreshOutdated();
|
|
185
195
|
// Force exit — Node's native fetch keeps TCP connections alive which can
|
|
186
196
|
// prevent the process from exiting when running against local servers.
|
|
187
197
|
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;AACjD,gEAAoE;AAEpE,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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,EAAE,CAAC;IACxD,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AAEtB,WAAW;KACR,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5C,IAAI,CAAC,KAAK,IAAI,EAAE;IACf,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAA,8BAAY,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,uEAAuE;IACvE,0EAA0E;IAC1E,qEAAqE;IACrE,oBAAY,CAAC,mBAAmB,EAAE,CAAC;IACnC,yEAAyE;IACzE,uEAAuE;IACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACb,IAAI,GAAG,YAAY,mBAAU,EAAE,CAAC;QAC9B,IAAA,gBAAO,EAAC,OAAO,aAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,uBAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,GAAG,YAAY,iBAAQ,EAAE,CAAC;QAC5B,IAAA,iBAAQ,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACD,IAAA,iBAAQ,EAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,uBAAU,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
|
@@ -88,10 +88,7 @@ exports.createCommand = (0, command_handler_1.withCommandHandler)(async (options
|
|
|
88
88
|
// 3. Redirect URI(s) — already validated by collectUrls parser when passed via flag
|
|
89
89
|
let redirectUrls = options.redirectUri ?? [];
|
|
90
90
|
if (redirectUrls.length === 0) {
|
|
91
|
-
if (
|
|
92
|
-
redirectUrls = [constants_1.DEFAULT_REDIRECT_URI];
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
91
|
+
if (process.stdin.isTTY) {
|
|
95
92
|
// Find an available port for the default redirect URL
|
|
96
93
|
const availablePort = await (0, port_1.findAvailablePort)(constants_1.DEFAULT_PORT);
|
|
97
94
|
const defaultRedirect = availablePort == null || availablePort === constants_1.DEFAULT_PORT
|
|
@@ -149,10 +146,7 @@ exports.createCommand = (0, command_handler_1.withCommandHandler)(async (options
|
|
|
149
146
|
},
|
|
150
147
|
]);
|
|
151
148
|
const another = String(anotherRaw).toLowerCase().trim().startsWith('y');
|
|
152
|
-
if (
|
|
153
|
-
addMore = false;
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
149
|
+
if (another) {
|
|
156
150
|
const { nextUrl } = await inquirer_1.default.prompt([
|
|
157
151
|
{
|
|
158
152
|
type: 'input',
|
|
@@ -163,8 +157,14 @@ exports.createCommand = (0, command_handler_1.withCommandHandler)(async (options
|
|
|
163
157
|
]);
|
|
164
158
|
redirectUrls.push(nextUrl.trim());
|
|
165
159
|
}
|
|
160
|
+
else {
|
|
161
|
+
addMore = false;
|
|
162
|
+
}
|
|
166
163
|
}
|
|
167
164
|
}
|
|
165
|
+
else {
|
|
166
|
+
redirectUrls = [constants_1.DEFAULT_REDIRECT_URI];
|
|
167
|
+
}
|
|
168
168
|
}
|
|
169
169
|
// 4. Create the app
|
|
170
170
|
const payload = {
|