Skip to content

fix(monitors): truncate create output + add delete confirm#27

Merged
caballeto merged 1 commit into
mainfrom
fix/create-output-and-delete-confirm
May 5, 2026
Merged

fix(monitors): truncate create output + add delete confirm#27
caballeto merged 1 commit into
mainfrom
fix/create-output-and-delete-confirm

Conversation

@caballeto
Copy link
Copy Markdown
Member

Summary

  • Truncate nested-object values in the single-record table renderer (used by every create / get command). monitors create was emitting a ~1500-char-wide row because incidentPolicy was JSON-stringified in full, hiding the freshly-minted monitor id off-screen. Long object values now render as the first 80 chars + … (use --output json for full). --output json / --output yaml are untouched.
  • Add an interactive confirmation prompt to the shared createDeleteCommand factory (covers monitors, incidents, alert-channels, notification-policies, environments, secrets, tags, resource-groups, webhooks, api-keys, dependencies, status-pages). The prompt shows the resource's name + id — fetched with a best-effort GET so typo'd ids surface a 404 before the destructive call. --yes / -y skips the prompt. In non-TTY contexts (CI, piped stdin) we refuse with EXIT_CODES.VALIDATION instead of hanging.

Round-2 DevEx friction P1 #8 + P1 #9 (see SYNTHESIS in mono).

Test plan

  • npm run lint && npm run typecheck && npm test && npm run build all green (913 tests, 30 files)
  • Manual: node bin/dev.js monitors delete --help shows new -y, --yes flag
  • Manual: non-TTY (echo "" | node bin/run.js monitors delete <id>) exits 4 with Refusing to delete monitor '<id>' in non-interactive mode without --yes (or -y).
  • Manual against live API: monitors create ... row width is readable + monitor id visible
  • Manual against live API: monitors delete <id> prompts; entering n cancels; --yes skips

Made with Cursor

…confirm

The single-record table renderer used by `monitors create` (and every
other CRUD `create` / `get` command) JSON-stringified nested objects in
full, so a `MonitorDto.incidentPolicy` blob blew the value column out to
~1500 characters and pushed the freshly-minted monitor id off-screen.
Truncate object previews to 80 chars with a `(use --output json for
full)` hint so the id and the rest of the record stay readable; JSON /
YAML output is untouched.

`monitors delete <id>` (and every other CRUD `delete`) now prompts for
confirmation showing the resource's name + id (best-effort GET — typo'd
ids surface a 404 before the prompt). `--yes` / `-y` skips the prompt
for scripted use. In a non-TTY context (CI, piped stdin) we refuse with
an EXIT_CODES.VALIDATION error rather than hanging on a prompt that
nobody can answer.

Round-2 DevEx friction P1 #8 + P1 #9.

Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit ecf20ca into main May 5, 2026
3 checks passed
@caballeto caballeto deleted the fix/create-output-and-delete-confirm branch May 5, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant