Files
sim/scripts/setup/theme.ts
T
Theodore Li 9a9132e90a feat(setup): setup wizard with browser-based Chat key handoff
Adds `bun run setup` and `bun run doctor` for local installs, and replaces
the wizard's paste-your-Chat-key step with a browser handoff that never puts
the key in a URL.
2026-07-23 17:25:15 -07:00

29 lines
772 B
TypeScript

import chalk from 'chalk'
const BRAND = '#e6e6e6'
export const isRich = () => chalk.level > 0
export const theme = {
accent: chalk.hex(BRAND),
heading: chalk.bold.hex(BRAND),
muted: chalk.hex('#8a8f98'),
success: chalk.hex('#33c482'),
warn: chalk.hex('#ffb020'),
error: chalk.hex('#e23d2d'),
command: chalk.hex(BRAND),
}
export const glyph = {
pass: theme.success('✓'),
warn: theme.warn('!'),
fail: theme.error('✗'),
skip: theme.muted('○'),
} as const
/** OSC 8 clickable terminal hyperlink; plain text when not a rich TTY. */
export function link(label: string, url: string): string {
if (!isRich() || !process.stdout.isTTY) return `${label} (${url})`
return `\x1b]8;;${url}\x1b\\${chalk.underline.hex(BRAND)(label)}\x1b]8;;\x1b\\`
}