-
-
Notifications
You must be signed in to change notification settings - Fork 119
TUI
CortexPrism Bot edited this page Jun 21, 2026
·
4 revisions
CortexPrism ships with a custom Deno-native TUI framework (v0.48.0) providing flicker-free terminal rendering, rich components, and full keyboard interaction.
| File | Purpose |
|---|---|
buffer.ts |
Double-buffered VirtualScreen with cell-level diff-and-flush |
screen.ts |
Screen management, terminal size detection (getTermCols()/getTermRows()) |
style.ts |
Style system with ANSI color, bold, italic, underline support |
component.ts |
Class-based Component tree with lifecycle hooks (onMount, onUpdate, onDestroy, onResize, onKeyPress) |
layout.ts |
Layout engine — HSplit, VSplit, ScrollView, Box with flex/percentage sizing |
renderer.ts |
Renderer with SIGWINCH resize handling |
input-engine.ts |
Raw InputEngine with ANSI escape decoding and emacs-style keybindings (Ctrl+A/E/K/W/U, Alt+F/B/D, Ctrl+R history search) |
themes/dark.ts |
Dark theme |
themes/light.ts |
Light theme |
themes/contrast.ts |
High-contrast theme |
hyperlink.ts |
OSC-8 hyperlink rendering |
progress.ts |
Braille/ASCII spinners and progress bars |
completions.ts |
Completion provider for slash commands, file paths, agent names |
| Component | Description |
|---|---|
Header |
Title bar with session info |
StatusBar |
Footer with model, tokens, cost, session ID |
TextInput |
Multi-line input with cursor movement, history, selection |
CompletionMenu |
Floating dropdown for slash commands/file paths/agent names |
MarkdownBlock |
Headers, bold, italic, inline code rendering |
CodeBlock |
Syntax highlighting for TS/JS/Python/Go/Rust/Bash/SQL |
DiffBlock |
Unified diff with +/- coloring |
ToolCard |
Tool call status with spinner/checkmark/cross and duration |
ChatView |
Scrollable message list with streaming support |
┌─────────────────────────────────────────────────┐
│ Header (title) │
├─────────────────────────────────────────────────┤
│ ChatView (scrollable messages) │
│ │
│ │
│ │
├─────────────────────────────────────────────────┤
│ TextInput (> prompt) │
├─────────────────────────────────────────────────┤
│ StatusBar (model | tokens | cost | session) │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ Header (title) │
├───────────────────────┬─────────────────────────┤
│ ChatView (70%) │ ToolPanel (30%) │
│ │ • ToolCard (sub_agent) │
│ │ • ToolCard (file_read) │
│ │ • ToolCard (file_write) │
├───────────────────────┴─────────────────────────┤
│ TextInput (> prompt) │
├─────────────────────────────────────────────────┤
│ StatusBar (model | tokens | cost | session) │
└─────────────────────────────────────────────────┘
12 slash commands available in interactive chat sessions:
| Command | Description |
|---|---|
/model <name> |
Switch model mid-session |
/compact |
Trigger context compaction (runs automatically) |
/status |
Show session info (turns, tokens, cost) |
/clear |
Clear chat history |
/save [file] |
Save transcript to file |
/load <file> |
Load transcript from file |
/export |
Export session as markdown |
/theme <name> |
Switch theme (dark/light/contrast) |
/diff |
Show last file change |
/review |
Review pending approvals |
/plan |
Planning mode (runs automatically) |
/help |
List all commands |
/! <cmd> |
Bash command passthrough |
/soul |
Show soul context |
Non-interactive one-shot mode for CI and scripting:
cortex agent exec "summarize this repo" --json
cortex agent exec "fix eslint config" --max-turns 5
cortex agent exec "write a script" -o output.sh--json flag outputs { success, output, cost, durationMs, turns, tokensIn, tokensOut } for machine consumption.
cortex agent chat # Interactive streaming chat (TUI)
cortex agent tui # Full-featured TUI with tool panel
cortex agent exec <prompt> # One-shot non-interactive execution- Agent Loop — Core agent turn processing
- CLI Reference — All commands and their usage
- Workflow Engine — DAG workflows with step callbacks
CortexPrism — Open-source AI agent operating system · Discord · Apache 2.0 License · Built with Deno 2.x + TypeScript
- Agent Loop
- Built-in Agents
- Metacognition
- Memory System
- Skills System
- Sub-Agents
- Built-in Tools
- Code Intelligence
- Code Sandbox
- Cross-Agent Context Protocol
- Prompt Lab
- PKM Assistant
- Voice Pipeline
- Computer Use
- Browser Tool
- Git & GitHub
- Scheduler & Jobs
- Dashboard
- Observability
- A2A Protocol
- MCP Gateway
- Distributed Nodes
- Memori Checkpoints
- Eval System
- Workflow Engine
- Triggers
- Projects
- TUI
- Glossary
- Update System
- Chrome Bridge
- Swarm
- AgentLint
- Model Benchmarking
- Smart Context
- Cost Optimizer