Skip to content

Commit 3ac8ec7

Browse files
committed
fix: restore Altimate branding and fix TUI TuiConfig context crash
- Replace "OPEN CODE" ASCII art with "ALTIMATE CODE" in `logo.ts` - Restore `theme.primary`/`theme.accent` logo colors in `logo.tsx` - Replace all `opencode`/`OpenCode`/`.opencode/` references with `altimate-code`/`Altimate CLI`/`.altimate-code/` in `tips.tsx` - Wire `TuiConfigProvider` into `app.tsx` component tree above `ThemeProvider` to fix "TuiConfig context must be used within a context provider" crash - Load `TuiConfig` via `Instance.provide()` in `thread.ts` before calling `tui()` - Pass `config: {}` in `attach.ts` for remote attach mode
1 parent 34524f0 commit 3ac8ec7

6 files changed

Lines changed: 59 additions & 35 deletions

File tree

packages/opencode/src/cli/cmd/tui/app.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import { ArgsProvider, useArgs, type Args } from "./context/args"
3838
import open from "open"
3939
import { writeHeapSnapshot } from "v8"
4040
import { PromptRefProvider, usePromptRef } from "./context/prompt"
41+
import { TuiConfigProvider } from "./context/tui-config"
42+
import type { TuiConfig } from "@/config/tui"
4143

4244
async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
4345
// can't set raw mode if not a TTY
@@ -104,6 +106,7 @@ import type { EventSource } from "./context/sdk"
104106
export function tui(input: {
105107
url: string
106108
args: Args
109+
config: TuiConfig.Info
107110
directory?: string
108111
fetch?: typeof fetch
109112
headers?: RequestInit["headers"]
@@ -146,8 +149,9 @@ export function tui(input: {
146149
events={input.events}
147150
>
148151
<SyncProvider>
149-
<ThemeProvider mode={mode}>
150-
<LocalProvider>
152+
<TuiConfigProvider config={input.config}>
153+
<ThemeProvider mode={mode}>
154+
<LocalProvider>
151155
<KeybindProvider>
152156
<PromptStashProvider>
153157
<DialogProvider>
@@ -163,8 +167,9 @@ export function tui(input: {
163167
</DialogProvider>
164168
</PromptStashProvider>
165169
</KeybindProvider>
166-
</LocalProvider>
167-
</ThemeProvider>
170+
</LocalProvider>
171+
</ThemeProvider>
172+
</TuiConfigProvider>
168173
</SyncProvider>
169174
</SDKProvider>
170175
</RouteProvider>

packages/opencode/src/cli/cmd/tui/attach.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const AttachCommand = cmd({
6565
})()
6666
await tui({
6767
url: args.url,
68+
config: {},
6869
args: {
6970
continue: args.continue,
7071
sessionID: args.session,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export function Logo() {
7575
<For each={logo.left}>
7676
{(line, index) => (
7777
<box flexDirection="row" gap={1}>
78-
<box flexDirection="row">{renderLine(line, theme.textMuted, false)}</box>
79-
<box flexDirection="row">{renderLine(logo.right[index()], theme.text, true)}</box>
78+
<box flexDirection="row">{renderLine(line, theme.primary, false)}</box>
79+
<box flexDirection="row">{renderLine(logo.right[index()], theme.accent, true)}</box>
8080
</box>
8181
)}
8282
</For>

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const TIPS = [
5454
"Press {highlight}Tab{/highlight} to cycle between Build and Plan agents",
5555
"Use {highlight}/undo{/highlight} to revert the last message and file changes",
5656
"Use {highlight}/redo{/highlight} to restore previously undone messages and file changes",
57-
"Run {highlight}/share{/highlight} to create a public link to your conversation at opencode.ai",
57+
"Run {highlight}/share{/highlight} to create a public link to your conversation",
5858
"Drag and drop images into the terminal to add them as context",
5959
"Press {highlight}Ctrl+V{/highlight} to paste images from your clipboard into the prompt",
6060
"Press {highlight}Ctrl+X E{/highlight} or {highlight}/editor{/highlight} to compose messages in your external editor",
@@ -80,46 +80,46 @@ const TIPS = [
8080
"Switch to {highlight}Plan{/highlight} agent to get suggestions without making actual changes",
8181
"Use {highlight}@agent-name{/highlight} in prompts to invoke specialized subagents",
8282
"Press {highlight}Ctrl+X Right/Left{/highlight} to cycle through parent and child sessions",
83-
"Create {highlight}opencode.json{/highlight} for server settings and {highlight}tui.json{/highlight} for TUI settings",
84-
"Place TUI settings in {highlight}~/.config/opencode/tui.json{/highlight} for global config",
83+
"Create {highlight}altimate-code.json{/highlight} for server settings and {highlight}tui.json{/highlight} for TUI settings",
84+
"Place TUI settings in {highlight}~/.config/altimate-code/tui.json{/highlight} for global config",
8585
"Add {highlight}$schema{/highlight} to your config for autocomplete in your editor",
8686
"Configure {highlight}model{/highlight} in config to set your default model",
8787
"Override any keybind in {highlight}tui.json{/highlight} via the {highlight}keybinds{/highlight} section",
8888
"Set any keybind to {highlight}none{/highlight} to disable it completely",
8989
"Configure local or remote MCP servers in the {highlight}mcp{/highlight} config section",
90-
"OpenCode auto-handles OAuth for remote MCP servers requiring auth",
91-
"Add {highlight}.md{/highlight} files to {highlight}.opencode/command/{/highlight} to define reusable custom prompts",
90+
"Altimate CLI auto-handles OAuth for remote MCP servers requiring auth",
91+
"Add {highlight}.md{/highlight} files to {highlight}.altimate-code/command/{/highlight} to define reusable custom prompts",
9292
"Use {highlight}$ARGUMENTS{/highlight}, {highlight}$1{/highlight}, {highlight}$2{/highlight} in custom commands for dynamic input",
9393
"Use backticks in commands to inject shell output (e.g., {highlight}`git status`{/highlight})",
94-
"Add {highlight}.md{/highlight} files to {highlight}.opencode/agent/{/highlight} for specialized AI personas",
94+
"Add {highlight}.md{/highlight} files to {highlight}.altimate-code/agent/{/highlight} for specialized AI personas",
9595
"Configure per-agent permissions for {highlight}edit{/highlight}, {highlight}bash{/highlight}, and {highlight}webfetch{/highlight} tools",
9696
'Use patterns like {highlight}"git *": "allow"{/highlight} for granular bash permissions',
9797
'Set {highlight}"rm -rf *": "deny"{/highlight} to block destructive commands',
9898
'Configure {highlight}"git push": "ask"{/highlight} to require approval before pushing',
99-
"OpenCode auto-formats files using prettier, gofmt, ruff, and more",
99+
"Altimate CLI auto-formats files using prettier, gofmt, ruff, and more",
100100
'Set {highlight}"formatter": false{/highlight} in config to disable all auto-formatting',
101101
"Define custom formatter commands with file extensions in config",
102-
"OpenCode uses LSP servers for intelligent code analysis",
103-
"Create {highlight}.ts{/highlight} files in {highlight}.opencode/tools/{/highlight} to define new LLM tools",
102+
"Altimate CLI uses LSP servers for intelligent code analysis",
103+
"Create {highlight}.ts{/highlight} files in {highlight}.altimate-code/tools/{/highlight} to define new LLM tools",
104104
"Tool definitions can invoke scripts written in Python, Go, etc",
105-
"Add {highlight}.ts{/highlight} files to {highlight}.opencode/plugin/{/highlight} for event hooks",
105+
"Add {highlight}.ts{/highlight} files to {highlight}.altimate-code/plugin/{/highlight} for event hooks",
106106
"Use plugins to send OS notifications when sessions complete",
107-
"Create a plugin to prevent OpenCode from reading sensitive files",
108-
"Use {highlight}opencode run{/highlight} for non-interactive scripting",
109-
"Use {highlight}opencode --continue{/highlight} to resume the last session",
110-
"Use {highlight}opencode run -f file.ts{/highlight} to attach files via CLI",
107+
"Create a plugin to prevent Altimate CLI from reading sensitive files",
108+
"Use {highlight}altimate-code run{/highlight} for non-interactive scripting",
109+
"Use {highlight}altimate-code --continue{/highlight} to resume the last session",
110+
"Use {highlight}altimate-code run -f file.ts{/highlight} to attach files via CLI",
111111
"Use {highlight}--format json{/highlight} for machine-readable output in scripts",
112-
"Run {highlight}opencode serve{/highlight} for headless API access to OpenCode",
113-
"Use {highlight}opencode run --attach{/highlight} to connect to a running server",
114-
"Run {highlight}opencode upgrade{/highlight} to update to the latest version",
115-
"Run {highlight}opencode auth list{/highlight} to see all configured providers",
116-
"Run {highlight}opencode agent create{/highlight} for guided agent creation",
117-
"Use {highlight}/opencode{/highlight} in GitHub issues/PRs to trigger AI actions",
118-
"Run {highlight}opencode github install{/highlight} to set up the GitHub workflow",
119-
"Comment {highlight}/opencode fix this{/highlight} on issues to auto-create PRs",
120-
"Comment {highlight}/oc{/highlight} on PR code lines for targeted code reviews",
112+
"Run {highlight}altimate-code serve{/highlight} for headless API access",
113+
"Use {highlight}altimate-code run --attach{/highlight} to connect to a running server",
114+
"Run {highlight}altimate-code upgrade{/highlight} to update to the latest version",
115+
"Run {highlight}altimate-code auth list{/highlight} to see all configured providers",
116+
"Run {highlight}altimate-code agent create{/highlight} for guided agent creation",
117+
"Use {highlight}/altimate-code{/highlight} in GitHub issues/PRs to trigger AI actions",
118+
"Run {highlight}altimate-code github install{/highlight} to set up the GitHub workflow",
119+
"Comment {highlight}/altimate-code fix this{/highlight} on issues to auto-create PRs",
120+
"Comment {highlight}/ac{/highlight} on PR code lines for targeted code reviews",
121121
'Use {highlight}"theme": "system"{/highlight} to match your terminal\'s colors',
122-
"Create JSON theme files in {highlight}.opencode/themes/{/highlight} directory",
122+
"Create JSON theme files in {highlight}.altimate-code/themes/{/highlight} directory",
123123
"Themes support dark/light variants for both modes",
124124
"Reference ANSI colors 0-255 in custom themes",
125125
"Use {highlight}{env:VAR_NAME}{/highlight} syntax to reference environment variables in config",
@@ -135,15 +135,15 @@ const TIPS = [
135135
"Run {highlight}/unshare{/highlight} to remove a session from public access",
136136
"Permission {highlight}doom_loop{/highlight} prevents infinite tool call loops",
137137
"Permission {highlight}external_directory{/highlight} protects files outside project",
138-
"Run {highlight}opencode debug config{/highlight} to troubleshoot configuration",
138+
"Run {highlight}altimate-code debug config{/highlight} to troubleshoot configuration",
139139
"Use {highlight}--print-logs{/highlight} flag to see detailed logs in stderr",
140140
"Press {highlight}Ctrl+X G{/highlight} or {highlight}/timeline{/highlight} to jump to specific messages",
141141
"Press {highlight}Ctrl+X H{/highlight} to toggle code block visibility in messages",
142142
"Press {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight} to see system status info",
143143
"Enable {highlight}scroll_acceleration{/highlight} in {highlight}tui.json{/highlight} for smooth macOS-style scrolling",
144144
"Toggle username display in chat via command palette ({highlight}Ctrl+P{/highlight})",
145-
"Run {highlight}docker run -it --rm ghcr.io/anomalyco/opencode{/highlight} for containerized use",
146-
"Use {highlight}/connect{/highlight} with OpenCode Zen for curated, tested models",
145+
"Run {highlight}docker run -it --rm ghcr.io/altimateai/altimate-code{/highlight} for containerized use",
146+
"Use {highlight}/connect{/highlight} with Altimate CLI Zen for curated, tested models",
147147
"Commit your project's {highlight}AGENTS.md{/highlight} file to Git for team sharing",
148148
"Use {highlight}/review{/highlight} to review uncommitted changes, branches, or PRs",
149149
"Run {highlight}/help{/highlight} or {highlight}Ctrl+X H{/highlight} to show the help dialog",

packages/opencode/src/cli/cmd/tui/thread.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { Filesystem } from "@/util/filesystem"
1212
import type { Event } from "@opencode-ai/sdk/v2"
1313
import type { EventSource } from "./context/sdk"
1414
import { win32DisableProcessedInput, win32InstallCtrlCGuard } from "./win32"
15+
import { TuiConfig } from "@/config/tui"
16+
import { Instance } from "@/project/instance"
1517

1618
declare global {
1719
const OPENCODE_WORKER_PATH: string
@@ -161,8 +163,14 @@ export const TuiThreadCommand = cmd({
161163
events = createEventSource(client)
162164
}
163165

166+
const config = await Instance.provide({
167+
directory: cwd,
168+
fn: () => TuiConfig.get(),
169+
})
170+
164171
const tuiPromise = tui({
165172
url,
173+
config,
166174
fetch: customFetch,
167175
events,
168176
args: {

packages/opencode/src/cli/logo.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
export const logo = {
2-
left: [" ", "█▀▀█ █▀▀█ █▀▀█ █▀▀▄", "█__█ █__█ █^^^ █__█", "▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀~~▀"],
3-
right: [" ▄ ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", "█___ █__█ █__█ █^^^", "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"],
2+
left: [
3+
" ",
4+
"█▀▀█ █ ████ ██ █▄ ▄█ █▀▀█ ████ █▀▀▀",
5+
"█^^█ █___ _██_ ██ █_^_█ █^^█ _██_ █^^^",
6+
"▀ ▀ ▀▀▀▀ ~▀▀~ ▀▀ ▀~~~▀ ▀ ▀ ~▀▀~ ▀▀▀▀",
7+
],
8+
right: [
9+
" ",
10+
"█▀▀▀ █▀▀█ █▀▀█ █▀▀▀",
11+
"█___ █__█ █__█ █^^^",
12+
"▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
13+
],
414
}
515

616
export const marks = "_^~"

0 commit comments

Comments
 (0)