Skip to content

feat(notice): add error, warning, info, OK and debug lines - #20

Merged
dgrieser merged 1 commit into
mainfrom
feat/notice
Nov 25, 2026
Merged

dgrieser merged 1 commit into
mainfrom
feat/notice

Conversation

@dgrieser

Copy link
Copy Markdown
Collaborator

Adds package notice: the error, warning, info, OK and debug lines of a command-line tool.

  • Four themes: Line (WARN: …), Badge (padded label on its level's background), Bar (badge plus a tinted message filled to the edge) and Block (the whole line on the level's background).
  • Four palettes: Default, Muted, Deep, Pastel, each with dark and light colors; Background is auto (COLORFGBG), dark or light.
  • Values carry a role (Date, Time, Detail, Ref, Path, or NewRole with dark and light colors) and are colored by it; Pattern gives a role to matches in the message's own text.
  • Every notice is made plain (term.Plain) and redacted (redact.Patterns); credentials are looked for in the message as it reads, values in place. Both can be switched off in code for trusted text.
  • Code-only options: badge padding, no fill, single-color overrides, Around for a progress bar or live display.
  • go run ./examples/demo notice shows every theme and palette.

🤖 Generated with Claude Code

Package notice writes the notices of a command-line tool in four
themes (line, badge, bar, block) and four palettes (default, muted,
deep, pastel), each with colors for dark and light terminals.

Values in a message carry a role (date, time, detail, ref, path, or a
tool's own from NewRole) and are colored by it; patterns give a role to
matches in the message's own text. Every notice is made plain and
redacted, and credentials are looked for in the message as it reads,
values included. Badge padding, the fill to the terminal's edge and the
cleanup are options in code.

The demo gains a notice command that shows every theme and palette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgrieser
dgrieser merged commit fd90c81 into main Nov 25, 2026
14 checks passed
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