Documentation
¶
Overview ¶
Package cli implements ok's command-line entry: subcommand routing, flag parsing, assembly from config, and exit codes. The core is config-driven — providers and tools are resolved from configuration, not hardcoded.
─── File organization ────────────────────────────────────────────────────
cli.go — root: flag parsing, subcommand routing, Run()
acp.go — ACP stdio JSON-RPC server
chat*.go — chat REPL + Bubbletea TUI model
complete.go — tab-completion (slash commands, args)
event_handler— TUI event dispatch (approval keys, model, skills)
helpers.go — TUI helpers (balance, events, rendering updates)
msg.go — TUI message types
render.go — TUI rendering helpers
slash.go — slash-command dispatch (/model, /mcp, /skills)
select.go — interactive single/multi-select menus
style.go — ANSI style constants + color detection
theme.go — JSON theme system
box.go — ANSI-aware terminal width + border rendering
md.go — Markdown → ANSI renderer
* — one-file subcommands (audit, ci, demo, doctor, mcp,
review, run, session, setup, update, welcome, memory,
model, agent_cmd, skill_hooks)
chooser.go — multi-select component for ask tool
The TUI files (chat_tui, event_handler, helpers, msg, render, select, chooser, complete) form a natural cli/tui subpackage candidate.
Package cli provides the command-line interface for OK.
review.go — review pending git changes.
Package cli provides the terminal UI. This file defines the theme system which lets users customize colors, spacing, and rendering style.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoctorSummary ¶
func DoctorSummary() string
func ListThemes ¶
func ListThemes() []string
ListThemes returns all available theme names (built-in + user).
func ReviewChanges ¶
func ReviewChanges(ctx context.Context, ctrl *control.Controller) error
ReviewChanges runs the agent on the current git diff.
Types ¶
type Theme ¶
type Theme struct {
// Name identifies the theme for /theme list.
Name string `json:"name"`
// Colors
Primary string `json:"primary,omitempty"` // user text / accent
Secondary string `json:"secondary,omitempty"` // assistant text
Muted string `json:"muted,omitempty"` // reasoning / notices
Error string `json:"error,omitempty"` // error messages
Success string `json:"success,omitempty"` // tool results
Warning string `json:"warning,omitempty"` // warnings
Bg string `json:"bg,omitempty"` // background
CodeBg string `json:"code_bg,omitempty"` // code block background
// Spacing
Padding int `json:"padding,omitempty"`
Gap int `json:"gap,omitempty"`
CodeWidth int `json:"code_width,omitempty"`
CodeHeight int `json:"code_height,omitempty"`
}
Theme defines customizable TUI colors and spacing.
func SolarizedTheme ¶
func SolarizedTheme() Theme
SolarizedTheme returns a solarized-inspired theme.