/ opencodehub / cli / src / lib / branding.ts
swadhinbiswas docs: complete documentation overhaul and changelog update · 1/21/2026
bba9bff
70 lines · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
 * CLI Branding - ASCII Art & Colors
 */

import chalk from "chalk";
import figlet from "figlet";
import gradient from "gradient-string";

/**
 * OpenCodeHub ASCII Art Logo
 */
export function showLogo(): void {
    const logo = figlet.textSync("OpenCodeHub", {
        font: "Standard",
        horizontalLayout: "default",
        verticalLayout: "default",
    });

    console.log(gradient.pastel.multiline(logo));
    console.log(chalk.gray("  Stack-first PR workflows from your terminal\n"));
}

/**
 * Compact logo for operations
 */
export function showCompactLogo(): void {
    const logo = figlet.textSync("OCH", {
        font: "Small",
        horizontalLayout: "fitted",
    });
    console.log(gradient.cristal.multiline(logo));
}

/**
 * Success celebration ASCII art
 */
export function showSuccess(message: string): void {
    const art = `
    ✨ ${chalk.green.bold("SUCCESS!")} ✨
    
    ${chalk.green(message)}
    `;
    console.log(art);
}

/**
 * Color scheme
 */
export const colors = {
    success: chalk.green,
    error: chalk.red,
    warning: chalk.yellow,
    info: chalk.cyan,
    highlight: chalk.magenta,
    dim: chalk.gray,
    bold: chalk.bold,
};

/**
 * Styled console methods
 */
export const log = {
    success: (msg: string) => console.log(colors.success("✓"), msg),
    error: (msg: string) => console.log(colors.error("✗"), msg),
    warning: (msg: string) => console.log(colors.warning("⚠"), msg),
    info: (msg: string) => console.log(colors.info("ℹ"), msg),
    step: (msg: string) => console.log(colors.highlight("→"), msg),
    dim: (msg: string) => console.log(colors.dim(msg)),
};