or run

npx @tessl/cli init
Log in

Version

Files

docs

advanced-colors.mdbackground-colors.mdbasic-colors.mdcolor-support.mdconfiguration.mdindex.mdtext-styling.md
tile.json

task.mdevals/scenario-5/

Status Badge Styler

Creates formatted status messages with color-coded background labels for terminal output.

Each formatted string begins with the uppercase status label padded to the provided labelWidth (or left as-is when no width is given). The label is wrapped in the appropriate background color for the level, followed by a space and the original message left unstyled.

Capabilities

Formats standard backgrounds

  • Formats { level: "error", message: "Disk full" } into a string whose leading label uses the standard red background while leaving "Disk full" unstyled. @test
  • Formats { level: "success", message: "Completed" } into a string whose leading label uses the standard green background while leaving "Completed" unstyled. @test

Uses bright and alias backgrounds

  • Formats { level: "notice", message: "Deploying" } into a string whose leading label uses a bright blue background, not the standard intensity. @test
  • Formats { level: "muted", message: "Skipped optional step" } into a string whose leading label uses the bright black/gray background variant (the bright alias for black) while leaving the message plain. @test

Implementation

@generates

API

type StatusLevel = 'error' | 'success' | 'notice' | 'muted';

interface StatusItem {
  level: StatusLevel;
  message: string;
}

interface FormatOptions {
  labelWidth?: number; // optional fixed label width; pad labels with spaces when provided
}

export function formatStatus(item: StatusItem, options?: FormatOptions): string;

Dependencies { .dependencies }

chalk { .dependency }

Provides terminal styling with standard and bright background color helpers.