The CLI Harness: Terminal UI, Navigation & Configuration
Kompile's CLI Harness (kompile chat) is a full-screen, scroll-region terminal interface built for long-running agentic coding sessions. It separates live transcript output, typed tool/process results, queued drafts, background activity, and status telemetry into fixed terminal regions so concurrent subagents, autocomplete popups, and background builds never corrupt your active prompt.
TIP
Deciding between the terminal and the browser? See the companion getting-started guide: CLI vs. Web Harness.
Terminal UI outline
KompileTui divides your terminal into five dedicated regions (plus an optional Typed Results Sidebar on the right):
┌────────────────────────────────────────────────────────┬───────────────────────────┐
│ kompile [claude] session: cli-a1b2 [plan] │ │ Row 1: TopBar (agent, session, mode)
│ ⚠ transient alert ctx: 42k/200k · tok: 18.4k │ Results Sidebar │ Row 2: Alert or context/token summary
│ ⚒ build-lane: mvn test (active) │ (split / auto / drawer) │ Row 3: Build/lane row (when space fits)
│ Fix OAuth token refresh race condition │ │ Wrapped scrollable chat title
├────────────────────────────────────────────────────────┤ ▸ Tools (12) │
│ │ ✓ read ChatRepl.java │
│ Managed Transcript Region │ ✓ grep keyMap.bind │
│ (assistant replies, thinking, diffs, markdown, │ ▸ Processes (1) │
│ up to 2,000 retained lines; click [↓ Scroll to │ ⠋ mvn test (42s) │
│ bottom] when scrolled up) │ ▸ Subagents (1) │
│ │ ▸ Todos (4) │
│ │ ▸ Sources / Custom │
│ │ [↓ Latest] │
├────────────────────────────────────────────────────────┴───────────────────────────┤
│ kompile > your draft input (full-width JLine editor) │ Input Pane
│ Queue · 2 pending · ↑ edits latest │ Fixed Queue & Activity Pane
│ → upcoming [a1b2c3d4] run the integration tests next │ (queued drafts, slash completions,
│ ▸ ⠋ proc-001 mvn test (42s) ▸ ◐ subagent-1 exploring auth │ clickable/navigable activity rows)
├────────────────────────────────────────────────────────────────────────────────────┤
│ ⠋ proc-001 (42s) │ ◐ 1 bg │ Q:2 │ code-index: ready │ coder │ StatusBar (pinned bottom 2 rows)
└────────────────────────────────────────────────────────────────────────────────────┘What each region owns
- TopBar (
TopBar): Pinned at the top. Displays the active agent/provider, session ID, mode badges (passthrough,[plan], enforcer status), transient alerts (or idle context-window + session token summary), an optional build-lane indicator, and the wrapped chat title (scrollable with the mouse wheel). - Managed Transcript Region: Scrollable main conversation history (up to 2,000 retained lines). Displays a clickable
[↓ Scroll to bottom]indicator whenever you scroll up to read earlier turns. - Typed Results Sidebar / Drawer (
ChatSidebar): Optional right-hand pane (splitorautolayout, default 35% width) organizing structured result cards into six collapsible sections —tools,processes,subagents,todos,sources, andcustom. When the terminal is narrower thanminChatColumns(60columns by default),automode falls back cleanly to a full-width Results Drawer instead of squashing your chat text. Retains up to 256 completed items (~2 MiB) while protecting running, selected, and pinned cards, and opens full Result Inspector cards up to 128 KiB per section. - Input Pane: Full-width JLine editor that always spans the entire terminal width below the transcript and sidebar.
- Fixed Queue & Activity Pane (
StandardChatActivityPanel): Reserves fixed rows directly below the input pane so layout height never shifts while you type. Hosts:- Pending queued messages submitted while a turn is running.
- Live
/slash-command autocomplete candidates (so opening completions never scrolls the transcript). - Live activity rows for running processes, active subagents, background tasks, and armed completion wake-up monitors.
- StatusBar (
StatusBar): Pinned to the bottom two rows with live spinners for running processes, background task counts, message queue depth (Q:N), local code-index status, and your active role/mode. - Temporary Modal Windows: Interactive wizards (
/ui,/setup,/resume,/model,/workflow) open cleanly inside the managed content area and restore your exact transcript position when closed.
Menu navigation, keybindings & mouse controls
Navigating interactive menus & wizards
Kompile's interactive wizards (kompile configure, /ui, /setup, /model, /workflow, /resume) share a consistent numbered picker model:
- Type a number (
1..N) and pressEnterto select an item or drill into a sub-menu. - Type
0to go Back (or Done at the top level — in/ui, finishing saves your live-previewed changes automatically). - Choose the last option (Cancel unsaved changes) or press
Ctrl+Cto discard edits cleanly without writing to disk. - Use
Up/Downor the mouse wheel to scroll long picker pages while keeping your cursor on the choice prompt.
Contextual keyboard shortcuts
| Key / Chord | Context | Action |
|---|---|---|
/ + Tab | Input pane | Opens slash-command autocomplete inside the fixed Activity Pane |
Up / Down | Modal picker open | Scrolls the picker content 3 lines at a time |
Up / Down | Sidebar focused (blank prompt) | Moves selection between result cards in the Results Sidebar |
Down / Up | Activity Pane (blank prompt) | Down enters the Activity Pane below the prompt; Up moves back up to the prompt |
Left | Activity Pane focused | Jumps to the parent item in the activity hierarchy |
Up | Blank prompt + queued drafts | Loads the latest queued message back into the input buffer for editing (never overwrites an existing single-line draft) |
Up / Down | Normal prompt | Navigates multi-line drafts or recalls input history |
Enter | Activity item selected | Opens that process log (2,000-line view) or opens a live subagent view — while viewing a subagent, typing in the input bar sends messages directly to that subagent |
Delete | Activity Pane or Results Sidebar focused | Stops an owned process, cancels a running subagent, or cancels an armed wake-up monitor (without killing the process); safely refuses foreign SHARED rows |
Enter | Turn actively running | Queues a follow-up message in the Queue Pane for the next turn boundary |
Ctrl+X S | Standard chat | Toggles Results Sidebar visibility (configurable chord; conflict-checked) |
Ctrl+X R | Standard chat | Toggles keyboard focus on the Results Sidebar (configurable chord) |
Ctrl+B | Blocking tool / subagent running | Backgrounds the active subagent/task (or forwards native backgrounding in passthrough when the child supports it) |
Escape | Active turn / modal / subagent view | Cancels the foreground operation or returns to the main transcript view |
Ctrl+C | Passthrough / Idle | Interrupts the active child subprocess in passthrough; cancels or exits at idle |
Ctrl+G | Managed passthrough | Force-cancels Kompile's managed agent process |
Ctrl+] | Raw /passthrough (/keys) mode | Exits direct key-forwarding mode and returns input control to Kompile |
PageUp / PageDown | Anywhere | Pages up/down through the managed transcript |
Ctrl+Home / Ctrl+End | Anywhere | Jumps directly to the top or bottom of the transcript |
Shift+Ctrl+C | Transcript text selected | Copies the highlighted transcript selection to the system clipboard |
Process & Subagent Browser (below the input pane)
Whenever background builds, completion monitors, tool logs, or subagents are active, press ↓ from a blank prompt to move directly into the Process & Subagent Browser (StandardChatActivityPanel) below kompile >:
- Browse the live parent/child tree (
main,subagent, local & mirroredSHAREDprocessrows,monitor,tool,task, auxiliarychat, and/activityprojectrows) with↑/↓and jump to a parent node with←. - Press
Enterto inspect a 2,000-line live process log or bounded subagent transcript (scroll withPageUp/PageDown; while a live subagent is open, typing sends follow-ups directly to that child). - Press
Deleteto kill an owned process, cancel a running subagent, or cancel a wake-up monitor without touching the underlying process (foreignSHAREDprocesses are inspect-only, and selection clears automatically if a row exits soDeletenever hits a shifted neighbor).
See Monitors & Reactive Wake-Ups for the full row reference and Web /processes counterpart.
Mouse controls
- Scroll wheel: Scrolls whichever region your pointer is over — the Results Sidebar, the wrapped chat title in the TopBar, or the main transcript.
- Left-click: Click sidebar cards,
[↓ Latest], or[↓ Scroll to bottom]; click and drag across the transcript to highlight text. - Right-click: Copies highlighted transcript text when clicking inside the transcript, or pastes from your clipboard when nothing is selected.
- Middle-click: Pastes clipboard text directly into the input pane.
Four ways to configure the CLI
Kompile lets you configure both behavior (providers, models, enforcer, judge, subagents, MCP, code index) and display (presets, layout, sidebar routing, keybindings) through four complementary mechanisms.
1. Guided interactive wizards (kompile configure & kompile onboard)
Start from the top-level configuration hub or jump straight to a specific wizard:
# First-run setup: detect installed harnesses, auth, import chats, connect peers
kompile onboard
# Master interactive configuration menu (or inspect current state read-only)
kompile configure
kompile configure --statusEvery section in kompile configure is also a direct subcommand:
| Command | What It Configures |
|---|---|
kompile configure init | Project .kompile/ directory and global ~/.kompile/ defaults |
kompile configure chat | Chat mode (Standard / Passthrough / Server), provider, model, and project intent |
kompile configure ui | Display preset, layout mode, per-kind content routing, sidebar sections, and key chords (shared with /ui) |
kompile configure passthrough | Inspect external CLIs (claude, codex, agy, opencode) and MCP/tool injection setup |
kompile configure enforcer | Project enforcer rules, banned tools, judge mode, and semantic matching |
kompile configure judge | Judge backend, model selection, and quality scoring defaults |
kompile configure agent-defaults | Default models and per-model thinking effort for Codex, Claude, and OpenCode |
kompile configure mcp | MCP tool profile/schema and custom MCP servers |
kompile configure code-index | Local code search indexing for this or another source tree |
kompile configure gateway | LLM-based tool gateway evaluation rules |
kompile configure app | Full platform app config (vector store, embeddings, ingestion, feature flags) |
Inside an active chat session, you can configure everything live without exiting: /setup, /ui, /model (and /model failover), /auth, /subagent-config, /workflow, /permissions, /hooks, /auto-compact, and /resources.
2. Live display presets, layouts & /ui commands
Run bare /ui inside chat (or kompile configure ui from your shell) to preview display changes live before saving, or apply settings directly with /ui subcommands:
Built-in display presets
| Preset | Default Layout | Inline Chat Content | Sidebar Content | Best When… |
|---|---|---|---|---|
classic (default) | inline | Full inline assistant, thinking, tools, processes, subagents, todos, errors | Off | You want a traditional linear terminal transcript |
focused | auto | Assistant replies, thinking, and task plans (todos) stay full inline; errors show concise inline summary | Successful tools, processes, subagents, sources, and custom blocks collapse into sidebar cards; errors expand in sidebar | You want a clean narrative thread with rich inspection on demand |
verbose | auto | Full inline output for every block kind | Collapsed sidebar cards alongside inline output | You want both full scrollback and structured sidebar indexing |
Layout modes
inline: Single-column transcript only (sidebar hidden).split: Side-by-side transcript + right-hand Results Sidebar (sidebarWidthPercent, default35%).auto: Usessplitwhenever the terminal can keep at leastminChatColumns(60columns) for chat, and automatically switches to a full-widthdrawerfallback on narrower terminals.
Direct /ui commands
/ui # Launch interactive numbered display wizard (live preview)
/ui status # Print active UI settings and where they loaded from
/ui preset classic|focused|verbose # Switch display preset and save
/ui layout inline|split|auto # Switch layout mode and save
/ui set layout.sidebarWidthPercent 40
/ui set bindings.toggle "ctrl-x s" # Rebind sidebar toggle chord (conflict-checked)
/ui set bindings.focus "ctrl-x r" # Rebind sidebar focus chord (conflict-checked)
/ui set content.tool.inline none # Fine-tune inline/sidebar routing per content kind
/ui save global|project|session # Persist current UI overrides to a specific scope
# Controlling the sidebar & inspector directly
/ui sidebar toggle|focus|expand # Show/hide, focus, or expand the selected card
/ui results # Open the full-width results drawer
/ui inspect [item-key] # Open the 128 KiB section inspector for a result card
/ui next | /ui previous # Step through sidebar result cards
/ui section <group> # Toggle a sidebar section (tools, processes, subagents, todos, sources, custom)
/ui filter <kind|all> # Filter visible sidebar cards
/ui pin # Pin the selected card against eviction
/ui close # Close the inspector / drawer and return to main viewNOTE
Per-kind routing supports 14 granular content types: assistant, thinking, tool, error, process, subagent, todos, sources, custom, arguments, diff, content, output, and metadata.
3. Scoped layered configuration files (Global → Project → Session)
Kompile separates presentation preferences from provider/policy config and merges layers field-by-field from broadest to most specific:
Display preferences (chat-ui-config.json)
- Global:
~/.kompile/chat-ui-config.json - Project:
<repo>/.kompile/chat-ui-config.json - Session:
~/.kompile/conversations/<session-id>.chat-ui-config.json
chat-ui-config.json stores presentation preferences only — never provider credentials or model context. Invalid files warn and fall back cleanly instead of blocking startup.
Runtime, policy & agent configuration files
| File | Scope | Controls |
|---|---|---|
~/.kompile/config/chat-config.json / <repo>/.kompile/chat-config.json | Global / Project | Active provider, model, auth method, chat mode, thinking effort |
~/.kompile/config/subagent-config.json | Global | Subagent concurrency caps, banned model globs, per-role routes, failover rungs, token/dollar budgets |
~/.kompile/config/enforcer-config.json / <repo>/.kompile/enforcer-config.json | Global / Project | Tool guardrails, banned shell patterns, judge mode |
~/.kompile/config/gc-config.json & log-retention.json | Global | Session archive age, disk limits, trash grace period |
AGENTS.md / <repo>/.kompile/rules/ | Project | Project instructions and standing rules injected into sessions |
4. One-shot CLI flags & session-scoped overrides
Override saved configuration for a single terminal launch without rewriting your project or global defaults:
# Override provider, model, auth method, and reasoning effort for one run
kompile chat --provider openai --auth oauth --model gpt-5.6-sol --effort high
# Pin a specific named account only for this session
kompile chat --provider anthropic --auth oauth --credential work --auth-scope session
# Launch managed passthrough with inline real-time enforcer rules
kompile chat --mode passthrough --agent claude --rules "Run unit tests after every edit"
# Point at a different repo or ignore project-level overrides
kompile chat --working-dir /path/to/repo --global-config
# Headless non-interactive execution for CI / scripts
kompile chat --prompt "Summarize uncommitted changes" --output-format stream-jsonRelated guides
- How the Chat REPL Works — Internal REPL architecture: input routing, async turn ownership, message queueing, and
.pending-events.json - Edit Coordinator & Message Bus — File-based multi-agent locking, durable mailboxes, wakes, and
CoordinationMessageMandate - CLI vs. Web Harness — Side-by-side getting-started guide for picking terminal vs. browser
- The Web Harness — Companion architecture deep dive for
kompile chat --web - Slash Commands (
/) — Complete reference of every/command - Interactive Workflows — Multi-model workflow teams, loops, and resource policies
- Import & Resume — Resuming and migrating sessions across 11 external CLIs/IDEs
- Peers & Sources — Multi-machine TLS peers, unified
/sources, federated search, and remote GPU sharing - Configuration Reference — Full schema and environment variable reference