@pokit/reporter-clack

@pokit/reporter-clack provides a reporter adapter backed by @clack/prompts.

Installation

bun add @pokit/reporter-clack

Configuration

import { run } from '@pokit/core';
import { createReporterAdapter } from '@pokit/reporter-clack';

await run(args, {
  reporterAdapter: createReporterAdapter(),
  // ...
});

Output rendering

The adapter renders grouped activities, logs, and status output:

◆  Build

│  ◇  Compile TypeScript
│  ◇  Bundle with esbuild
│  ◇  Generate types

└  Build complete!

ℹ  Deploying to staging...

◆  Deploy

│  ◇  Upload assets
│  ◇  Update configuration
│  ◇  Verify deployment

└  Deployed successfully!

Output Types

Logs

ℹ  Information message
⚠  Warning message
✖  Error message
✔  Success message
→  Step message

Groups

◆  Group Label

│  ◇  Activity 1
│  ◇  Activity 2

└  Group complete

Activities (with spinners)

◆  Building

│  ◓  Compiling...        (spinning)
│  ◇  Bundle complete     (done)
│  ✖  Tests failed        (failed)

Nested Groups

◆  Deploy

│  ◆  Build
│  │  ◇  Compile
│  │  ◇  Bundle
│  └

│  ◆  Upload
│  │  ◇  Assets
│  │  ◇  Config
│  └

└  Deploy complete

Event Handling

The adapter subscribes to CLI events:

EventRendering
group:startOpens a group box with intro
group:endCloses the group with outro
activity:startShows spinner
activity:successShows checkmark
activity:failureShows X mark
logPrints styled message
reporter:suspendPauses output
reporter:resumeResumes output

Features

  • Spinners - Animated activity indicators
  • Structured output - Visual hierarchy with boxes
  • Colors - Semantic coloring (success=green, error=red)
  • Unicode - Symbols and box drawing

API

createReporterAdapter

function createReporterAdapter(): ReporterAdapter;

Returns a ReporterAdapter that renders events using Clack.