tui

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation ยถ

Index ยถ

Constants ยถ

View Source
const (
	GroupCode     = "Code"
	GroupGo       = "Go Tools"
	GroupPython   = "Python Tools"
	GroupSecurity = "Security"
	GroupSkills   = "Skills"
	GroupMCP      = "MCP & Serve"
	GroupSystem   = "System"
)

Group constants.

Variables ยถ

View Source
var Commands = []Command{

	{Key: "code", Title: "๐Ÿš€ sin code", Description: "Unified coding workflow hub", Group: GroupCode},
	{Key: "code review", Title: "๐Ÿ” review", Description: "Semantic review of a change (IBD)", Group: GroupCode, Args: "<files>"},
	{Key: "code debt", Title: "๐Ÿš๏ธ  debt", Description: "Show current architectural debt", Group: GroupCode, Args: "<path>"},
	{Key: "code verify", Title: "โœ… verify", Description: "Independent execution-based verification", Group: GroupCode, Args: "<target>"},
	{Key: "code preflight", Title: "โœˆ๏ธ  preflight", Description: "Fresh GitNexus index for coder agents", Group: GroupCode},
	{Key: "code codocs", Title: "๐Ÿ“š codocs", Description: "Validate co-located .doc.md companions", Group: GroupCode, Args: "<path>"},
	{Key: "code sckg", Title: "๐Ÿ•ธ๏ธ  sckg", Description: "Semantic codebase knowledge graph", Group: GroupCode, Args: "<path>"},
	{Key: "code audit", Title: "๐Ÿ›ก๏ธ  audit", Description: "47-gate CEO-audit (security/perf/quality)", Group: GroupCode, Args: "<path>"},
	{Key: "code full", Title: "โšก full pipeline", Description: "preflight โ†’ codocs โ†’ debt โ†’ sckg โ†’ ...", Group: GroupCode, Args: "<path>"},

	{Key: "sin-code run discover", Title: "๐Ÿ—‚๏ธ  discover", Description: "File discovery with relevance scoring", Group: GroupGo, Args: "<path>"},
	{Key: "sin-code run map", Title: "๐Ÿ—บ๏ธ  map", Description: "Architecture map + dependency graph", Group: GroupGo, Args: "<path>"},
	{Key: "sin-code run grasp", Title: "๐Ÿค– grasp", Description: "Deep single-file analysis", Group: GroupGo, Args: "<file>"},
	{Key: "sin-code run scout", Title: "๐Ÿ”ญ scout", Description: "Regex/semantic/symbol code search", Group: GroupGo, Args: "<query>"},
	{Key: "sin-code run harvest", Title: "๐ŸŒพ harvest", Description: "URL fetch + cache + structure extract", Group: GroupGo, Args: "<url>"},
	{Key: "sin-code run execute", Title: "โš™๏ธ  execute", Description: "Safe exec with secret redaction", Group: GroupGo, Args: "<cmd>"},
	{Key: "sin-code run orchestrate", Title: "๐Ÿช„ orchestrate", Description: "Task deps + parallel exec + rollback", Group: GroupGo},

	{Key: "ibd", Title: "๐Ÿงฌ ibd", Description: "Intent-Based Diffing (semantic AST)", Group: GroupPython, Args: "<files>"},
	{Key: "poc", Title: "๐Ÿ“ poc", Description: "Proof-of-Correctness verification", Group: GroupPython, Args: "<target>"},
	{Key: "adw", Title: "๐Ÿ›๏ธ  adw", Description: "Architectural Debt Watchdog", Group: GroupPython, Args: "<path>"},
	{Key: "oracle", Title: "๐Ÿ”ฎ oracle", Description: "Independent Verification Oracle", Group: GroupPython, Args: "<target>"},
	{Key: "efm", Title: "๐Ÿงช efm", Description: "Ephemeral Full-Stack Mocking", Group: GroupPython, Args: "<spec>"},
	{Key: "sckg", Title: "๐Ÿ•ธ๏ธ  sckg", Description: "SCKG โ€” knowledge graph (11 cmds)", Group: GroupPython, Args: "<cmd> [args]"},

	{Key: "security", Title: "๐Ÿ” security", Description: "8-tool security bundle (Snyk alt.)", Group: GroupSecurity, Args: "scan <path>"},

	{Key: "brain", Title: "๐Ÿง  brain", Description: "Global/project behavioral rules", Group: GroupSkills},
	{Key: "context-bridge", Title: "๐ŸŒ‰ context-bridge", Description: "Unified SCKG+brain+gitnexus query", Group: GroupSkills, Args: "<query>"},
	{Key: "websearch", Title: "๐Ÿ”Ž websearch", Description: "SerpAPI multi-key pool", Group: GroupSkills, Args: "<query>"},
	{Key: "scheduler", Title: "โฐ scheduler", Description: "Cron/interval job scheduling", Group: GroupSkills},
	{Key: "goal-mode", Title: "๐ŸŽฏ goal-mode", Description: "Goal tracking with checkpoints", Group: GroupSkills},
	{Key: "grill-me", Title: "๐Ÿ”ฅ grill-me", Description: "Adversarial design-review interview", Group: GroupSkills, Args: "<topic>"},
	{Key: "doc-coauthoring", Title: "๐Ÿ“ doc-coauthoring", Description: "Collaborative README/ADR/SPEC", Group: GroupSkills},
	{Key: "codocs", Title: "๐Ÿ“˜ codocs", Description: "CoDocs standard + sprint", Group: GroupSkills, Args: "<path>"},
	{Key: "marketplace", Title: "๐Ÿ›๏ธ  marketplace", Description: "Skill catalog search/install", Group: GroupSkills},
	{Key: "browser", Title: "๐ŸŒ browser", Description: "106 browser-automation tools", Group: GroupSkills},

	{Key: "serve", Title: "๐Ÿ“ก serve", Description: "Expose tools as unified MCP server", Group: GroupMCP},
	{Key: "serve-mcp", Title: "๐Ÿ›ฐ๏ธ  serve-mcp", Description: "Start MCP server (stdio)", Group: GroupMCP},
	{Key: "mcp-config", Title: "๐Ÿ“‹ mcp-config", Description: "Generate ready-to-use MCP config", Group: GroupMCP},
	{Key: "simone", Title: "๐Ÿ”ฌ simone", Description: "Simone-MCP code analysis", Group: GroupMCP},

	{Key: "status", Title: "๐Ÿ“Š status", Description: "Which subsystems are installed", Group: GroupSystem},
	{Key: "doctor", Title: "๐Ÿฉบ doctor", Description: "Diagnose environment + audit chain", Group: GroupSystem},
	{Key: "bootstrap", Title: "๐ŸŽฌ bootstrap", Description: "Initialize subsystems for repo", Group: GroupSystem, Args: "<path>"},
	{Key: "agents-md", Title: "๐Ÿค agents-md", Description: "Create/update AGENTS.md", Group: GroupSystem},
	{Key: "policy", Title: "๐Ÿ“œ policy", Description: "Inspect/init SIN policy + audit log", Group: GroupSystem},
	{Key: "skills", Title: "๐ŸŽ“ skills", Description: "Compile portable skills to agent fmt", Group: GroupSystem},
	{Key: "update", Title: "โฌ†๏ธ  update", Description: "Self-update stack (pipx + Go)", Group: GroupSystem},
	{Key: "config", Title: "โš™๏ธ  config", Description: "Unified config management", Group: GroupSystem},
}

Commands is the full menu catalog. Order within a group = display order.

Functions ยถ

func ByGroup ยถ

func ByGroup(cmds []Command) map[string][]Command

ByGroup groups commands by their Group field, preserving catalog order.

func Groups ยถ

func Groups() []string

Groups returns the menu groups in display order.

Types ยถ

type AppState ยถ

type AppState int

AppState โ€” the finite-state machine of the TUI.

const (
	StateMenu    AppState = iota // user is browsing the menu
	StateSearch                  // user is typing in the search bar
	StatePrompt                  // user is providing Args value
	StateRunning                 // a command is currently executing
	StateOutput                  // command finished; showing output
)

type Command ยถ

type Command struct {
	// Key is the canonical subcommand name, e.g. "sckg", "code", "doctor".
	Key string
	// Title is shown in the menu, supports emojis and short labels.
	Title string
	// Description is a one-line explanation shown beside the menu item.
	Description string
	// Group classifies the command in the menu (Code, Skills, MCP, ...).
	Group string
	// Args is the raw argument template. If non-empty, the TUI prompts for
	// a value before running. The placeholder is rendered as the prompt hint.
	Args string
	// Danger marks destructive commands (e.g. "policy reset") for red styling.
	Danger bool
}

Command describes one callable sin subcommand exposed in the TUI menu.

func Filter ยถ

func Filter(query string) []Command

Filter returns the commands matching the current query (case-insensitive substring match on key, title, or description).

type Model ยถ

type Model struct {
	// contains filtered or unexported fields
}

Model is the Bubbletea top-level model.

func NewModel ยถ

func NewModel() *Model

NewModel builds a fresh TUI model.

func (*Model) Accent ยถ

func (m *Model) Accent() lipgloss.Style

makeAccent returns a style for an inline accent (workaround helper).

func (*Model) Init ยถ

func (m *Model) Init() tea.Cmd

Init starts the spinner.

func (*Model) Update ยถ

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View ยถ

func (m *Model) View() string

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL