Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit aedd760

Browse files
authored
fix(cli): restore brand integrity of CLI wordmark (anomalyco#10912)
1 parent 6da9fb8 commit aedd760

3 files changed

Lines changed: 53 additions & 21 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/logo.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { TextAttributes, RGBA } from "@opentui/core"
22
import { For, type JSX } from "solid-js"
33
import { useTheme, tint } from "@tui/context/theme"
4+
import { logo, marks } from "@/cli/logo"
45

56
// Shadow markers (rendered chars in parens):
67
// _ = full shadow cell (space with bg=shadow)
78
// ^ = letter top, shadow bottom (▀ with fg=letter, bg=shadow)
89
// ~ = shadow top only (▀ with fg=shadow)
9-
const SHADOW_MARKER = /[_^~]/
10-
11-
const LOGO_LEFT = [` `, `█▀▀█ █▀▀█ █▀▀█ █▀▀▄`, `█__█ █__█ █^^^ █__█`, `▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀~~▀`]
12-
13-
const LOGO_RIGHT = [` ▄ `, `█▀▀▀ █▀▀█ █▀▀█ █▀▀█`, `█___ █__█ █__█ █^^^`, `▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀`]
10+
const SHADOW_MARKER = new RegExp(`[${marks}]`)
1411

1512
export function Logo() {
1613
const { theme } = useTheme()
@@ -75,11 +72,11 @@ export function Logo() {
7572

7673
return (
7774
<box>
78-
<For each={LOGO_LEFT}>
75+
<For each={logo.left}>
7976
{(line, index) => (
8077
<box flexDirection="row" gap={1}>
8178
<box flexDirection="row">{renderLine(line, theme.textMuted, false)}</box>
82-
<box flexDirection="row">{renderLine(LOGO_RIGHT[index()], theme.text, true)}</box>
79+
<box flexDirection="row">{renderLine(logo.right[index()], theme.text, true)}</box>
8380
</box>
8481
)}
8582
</For>

packages/opencode/src/cli/logo.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const logo = {
2+
left: [" ", "█▀▀█ █▀▀█ █▀▀█ █▀▀▄", "█__█ █__█ █^^^ █__█", "▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀~~▀"],
3+
right: [" ▄ ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", "█___ █__█ █__█ █^^^", "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"],
4+
}
5+
6+
export const marks = "_^~"

packages/opencode/src/cli/ui.ts

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import z from "zod"
22
import { EOL } from "os"
33
import { NamedError } from "@opencode-ai/util/error"
4+
import { logo as glyphs } from "./logo"
45

56
export namespace UI {
6-
const LOGO = [
7-
[`  `, ` ▄ `],
8-
[`█▀▀█ █▀▀█ █▀▀█ █▀▀▄ `, `█▀▀▀ █▀▀█ █▀▀█ █▀▀█`],
9-
[`█░░█ █░░█ █▀▀▀ █░░█ `, `█░░░ █░░█ █░░█ █▀▀▀`],
10-
[`▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ `, `▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀`],
11-
]
12-
137
export const CancelledError = NamedError.create("UICancelledError", z.void())
148

159
export const Style = {
@@ -47,15 +41,50 @@ export namespace UI {
4741
}
4842

4943
export function logo(pad?: string) {
50-
const result = []
51-
for (const row of LOGO) {
44+
const result: string[] = []
45+
const reset = "\x1b[0m"
46+
const left = {
47+
fg: Bun.color("gray", "ansi") ?? "",
48+
shadow: "\x1b[38;5;235m",
49+
bg: "\x1b[48;5;235m",
50+
}
51+
const right = {
52+
fg: reset,
53+
shadow: "\x1b[38;5;238m",
54+
bg: "\x1b[48;5;238m",
55+
}
56+
const gap = " "
57+
const draw = (line: string, fg: string, shadow: string, bg: string) => {
58+
const parts: string[] = []
59+
for (const char of line) {
60+
if (char === "_") {
61+
parts.push(bg, " ", reset)
62+
continue
63+
}
64+
if (char === "^") {
65+
parts.push(fg, bg, "▀", reset)
66+
continue
67+
}
68+
if (char === "~") {
69+
parts.push(shadow, "▀", reset)
70+
continue
71+
}
72+
if (char === " ") {
73+
parts.push(" ")
74+
continue
75+
}
76+
parts.push(fg, char, reset)
77+
}
78+
return parts.join("")
79+
}
80+
glyphs.left.forEach((row, index) => {
5281
if (pad) result.push(pad)
53-
result.push(Bun.color("gray", "ansi"))
54-
result.push(row[0])
55-
result.push("\x1b[0m")
56-
result.push(row[1])
82+
result.push(draw(row, left.fg, left.shadow, left.bg))
83+
result.push(gap)
84+
const other = glyphs.right[index] ?? ""
85+
result.push(draw(other, right.fg, right.shadow, right.bg))
5786
result.push(EOL)
58-
}
87+
})
5988
return result.join("").trimEnd()
6089
}
6190

0 commit comments

Comments
 (0)