/ opencodehub / cli / src / lib / branding.ts
swadhinbiswas feat: implement air-gapped mode, UI fixes, and project management integrations · 7/9/2026
e3bd4a1
70 lines · 1.7 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.hex("#6272a4")("  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.hex("#50fa7b").bold("SUCCESS!")} ✨
    
    ${chalk.hex("#50fa7b")(message)}
    `;
    console.log(art);
}

/**
 * Color scheme
 */
export const colors = {
    success: chalk.hex("#50fa7b"),
    error: chalk.hex("#ff5555"),
    warning: chalk.hex("#f1fa8c"),
    info: chalk.hex("#8be9fd"),
    highlight: chalk.hex("#ff79c6"),
    dim: chalk.hex("#6272a4"),
    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)),
};