feat(BEX-252): add brevo app status command - #35
Conversation
Add a read-only `brevo app status` command that reports an app's
review lifecycle state (configured, submitted, in_review, approved,
rejected, changes_requested) with a canned human-readable message.
Resolves the app from --app-id, the linked app-config.json, or an
interactive picker; supports --json ({ state, message }). Reviewer
feedback is delivered by email and is never surfaced here.
State is read via a new appService.fetchAppState, the canonical
state-read path for future submit/withdraw commands, backed by the
/v3/app-store/apps/:id/state endpoint.
Also surface the API's `error` field (in addition to `message`) in
client error handling, so upload-style errors like
"distribution_type cannot be changed via upload" reach the user.
Docs (AGENTS.md, SKILL.md) and a changeset are updated in sync.
Co-authored-by: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
⚠️ Not ready to approve
The status command’s handling of a missing/empty state currently leads to confusing user output and should be normalized (with types/tests aligned) before merging.
Pull request overview
Adds a new read-only brevo app status subcommand that reports an OAuth app’s review lifecycle state via a dedicated API endpoint, alongside small supporting plumbing (types, endpoints, docs, and error handling).
Changes:
- Introduces
brevo app statuscommand with--app-idresolution fallback (flag →app-config.json→ picker) and--jsonoutput. - Adds
appService.fetchAppStatebacked byGET /v3/app-store/apps/:id/stateand wires the endpoint/CLI constants. - Improves API error surfacing by using
errorwhenmessageis missing; updates tests and agent docs + changeset.
File summaries
| File | Description |
|---|---|
| src/types.ts | Adds app review lifecycle state types/response shape. |
| src/services/app.ts | Adds fetchAppState() service method (canonical state read path). |
| src/lib/constants.ts | Adds /state endpoint builder and CLI.APP_STATUS constant. |
| src/lang/en.ts | Adds user-facing status strings and canned per-state messages. |
| src/commands/definitions.ts | Registers the new app status subcommand and options. |
| src/commands/app/status.ts | Implements brevo app status logic, output formatting, and --json. |
| src/bin/index.ts | Updates top-level help banner to include the new command. |
| src/api/client.ts | Enhances error message extraction to fall back to API error. |
| src/tests/services/app.test.ts | Adds tests for fetchAppState() behavior and 404 mapping. |
| src/tests/commands/app/status.test.ts | Adds command tests for resolution logic, JSON output, and messaging. |
| src/tests/api/client.test.ts | Tests error vs message preference in API error handling. |
| agent-context/SKILL.md | Documents the new command for agent usage (state + canned message). |
| agent-context/AGENTS.md | Updates agent-facing command matrix with brevo app status. |
| .changeset/curly-status-command.md | Adds a minor changeset for the new user-visible command. |
Review details
- Files reviewed: 13/14 changed files
- Comments generated: 3
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…X-252-app-status # Conflicts: # agent-context/AGENTS.md # agent-context/SKILL.md # src/commands/definitions.ts # src/lib/constants.ts # src/services/app.ts
…mands Reformat the root `brevo --help` command listing for readability: column-align signatures and descriptions (wrapping long signatures onto their own indented line), fill in previously-blank descriptions, and group `app status` / `app withdraw` under an "App-review commands (public apps only)" heading. Help-text formatting only — no command, flag, exit-code, or error-message contract changed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address PR review feedback: when the API returns no state, normalize it to an "unknown" sentinel so both the text header and --json output stay meaningful instead of rendering a blank label / `state: ""`. Mark AppStateResponse.state optional to match the tolerated runtime shape, add friendly copy pointing the user to `brevo app upload`, and update the test plus agent docs (SKILL.md/AGENTS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Addressed the review feedback in 083966c:
|
Render `brevo app status` as a colour-coded, aligned status card (tone + glyph per review state) and give the empty/`unknown` state actionable copy telling the user to check the app is public and uploaded, instead of a raw empty value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Brings in `brevo app status` (BEX-252, #35). Conflict resolution: - src/bin/index.ts: adopt the reworked help layout and add `app submit` to the new "App-review commands" section alongside status/withdraw. - src/lang/en.ts: keep both additive blocks (APP_SUBMIT_* and APP_STATUS_*). - src/lib/constants.ts: drop this branch's provisional CLI.APP_STATUS duplicate — the status PR ships the canonical one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>



Summary
brevo app statuscommand that reports an app's review lifecycle state (configured,submitted,in_review,approved,rejected,changes_requested) with a canned human-readable message. Resolves the app from--app-id, the linkedapp-config.json, or an interactive picker, and supports--json({ state, message }). Reviewer feedback is delivered by email and is never surfaced here.appService.fetchAppStateas the canonical state-read path (backed byGET /v3/app-store/apps/:id/state) so future submit/withdraw commands share one read path.errorfield alongsidemessagein client error handling, so upload-style errors reach the user instead of a generic status line.AGENTS.md,SKILL.md, and a changeset in sync with the new command.Test Plan
yarn test— full suite passes (639 tests)brevo app status --app-id <id>prints the state label and messagebrevo app status --app-id <id> --jsonreturns{ state, message }--app-idfalls back toapp-config.json, then the interactive pickerRefs: BEX-252
🤖 Generated with Claude Code