fix(monitors): truncate create output + add delete confirm#27
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create/getcommand).monitors createwas emitting a ~1500-char-wide row becauseincidentPolicywas 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 yamlare untouched.createDeleteCommandfactory (coversmonitors,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/-yskips the prompt. In non-TTY contexts (CI, piped stdin) we refuse withEXIT_CODES.VALIDATIONinstead 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 buildall green (913 tests, 30 files)node bin/dev.js monitors delete --helpshows new-y, --yesflagecho "" | node bin/run.js monitors delete <id>) exits 4 withRefusing to delete monitor '<id>' in non-interactive mode without --yes (or -y).monitors create ...row width is readable + monitor id visiblemonitors delete <id>prompts; enteringncancels;--yesskipsMade with Cursor