Skip to content

feat(cli): colour deco check output - #668

Open
tlgimenes wants to merge 1 commit into
v8-17-hostedfrom
v8-18-check-colors
Open

tlgimenes wants to merge 1 commit into
v8-17-hostedfrom
v8-18-check-colors

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Colours deco check's report, as in the demo film. No new dependencies; a 30-line ANSI helper (packages/blocks/src/v8/cli/color.ts).

When: on only when stdout and stderr are both terminals, or with --color (any command); --no-color turns it off, the last one wins. No environment variables are read. The setting rides on the Reporter, so piped output and tests stay plain, and exit codes don't change.

Before (any output):

2 saved blocks checked: 0 errors, 0 warnings

After, on a terminal (cat -v):

^[[32m✓^[[39m 2 saved blocks checked: ^[[32m0 errors, 0 warnings^[[39m
  • clean: green ✓, counts green
  • warnings only: yellow ⚠, warning count yellow (exit 0)
  • errors: red ✗, error count red (exit 1)
  • problem lines: file bold, path dim, an error's message red, the word warning yellow. Strip the escapes and it's the plain text again.

The mark leads rather than trails: it's where the eye lands first and where most CLIs (vitest, gh) put it, and it stays in the same column whatever the counts. deco schema gets the same yellow warning and red "not written" line.

Tests: --color summaries (clean/warnings/errors), problem-line escapes, strip-to-plain, --color/--no-color parsing on every command, --color=x rejected. Existing plain-text tests unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig


Summary by cubic

Colours deco check and deco schema output so reports read well on a terminal. Piped output and tests stay plain text, and exit codes are unchanged.

  • The check summary leads with a green ✓ when clean, yellow ⚠ when only warnings, red ✗ when there are errors; problem lines are bold files, dim paths, red error messages, and yellow warning words.
  • Every command takes --color or --no-color, the last one winning; without either, colour turns on only when stdout and stderr are both terminals.

Written for commit 98feda7. Summary will update on new commits.

View guided diff Turn on auto-fix

deco check's summary leads with a status mark and colours the counts that
decide it: green ✓ when clean, yellow ⚠ with warnings only, red ✗ with
errors. Problem lines colour an error's message red and the word "warning"
yellow, paths dim, file names bold. deco schema colours its warning word and
its "not written" line the same way.

Colour is on only when stdout and stderr are both terminals, or with the new
--color flag on any command; --no-color turns it off (the last one wins). No
environment variables are read. The setting rides on the Reporter, so piped
output and tests stay plain text, and exit codes are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
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