UNPKG

@vigilbase/cli

Version:

Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.

48 lines (47 loc) • 1.81 kB
/** * Compact Vigilbase flare mark + wordmark for human CLI surfaces. * Static strings only — no I/O, no deps, skipped entirely in --json mode. */ import { isCi } from './platform.js'; /** Compact square Vigilbase flare (inverted V), used on help/version (keeps the first viewport short). */ export const VIGILBASE_ASCII_MARK = [ '\u2588\u2588\u2588\u2588\u2588 \u2592\u2592\u2592', ' \u2588\u2588\u2588\u2588 \u2592\u2592\u2592\u2592', ' \u2588\u2588\u2588 \u2592\u2592\u2592\u2592 ', ' \u2588\u2592\u2592\u2592\u2592 ', ' \u2592\u2592\u2592 ', ].join('\n'); /** Whether the checkup terminal UI (tui.ts) may colour this stream. */ export function shouldUseColor(stream, env = process.env) { if (env.NO_COLOR != null && env.NO_COLOR !== '') return false; if (env.FORCE_COLOR === '0') return false; if (env.FORCE_COLOR && env.FORCE_COLOR !== '0') return true; if (isCi(env)) return false; return Boolean(stream?.isTTY); } export function shouldShowBanner(mode = 'text', env = process.env) { if (mode === 'json') return false; if (env.VIGILBASE_CLI_NO_BANNER === '1') return false; return true; } /** * Banner composition (flare + wordmark + tagline). Plain text: the writer strips terminal * sequences from every line, so the banner carries no colour. */ export function renderBanner(options = {}) { const tagline = options.tagline ?? 'one \u00b7 tools'; const version = options.version ? ` \u00b7 v${options.version}` : ''; return VIGILBASE_ASCII_MARK.split('\n').map((line, index) => { if (index === 0) return `${line} vigilbase`; if (index === 1) return `${line} ${tagline}${version}`; return line; }).join('\n'); }