Skip to content

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):

text
┌────────────────────────────────────────────────────────┬───────────────────────────┐
│ 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 (split or auto layout, default 35% width) organizing structured result cards into six collapsible sections — tools, processes, subagents, todos, sources, and custom. When the terminal is narrower than minChatColumns (60 columns by default), auto mode 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:
    1. Pending queued messages submitted while a turn is running.
    2. Live / slash-command autocomplete candidates (so opening completions never scrolls the transcript).
    3. 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.

Kompile's interactive wizards (kompile configure, /ui, /setup, /model, /workflow, /resume) share a consistent numbered picker model:

  • Type a number (1..N) and press Enter to select an item or drill into a sub-menu.
  • Type 0 to 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+C to discard edits cleanly without writing to disk.
  • Use Up / Down or the mouse wheel to scroll long picker pages while keeping your cursor on the choice prompt.

Contextual keyboard shortcuts ​

Key / ChordContextAction
/ + TabInput paneOpens slash-command autocomplete inside the fixed Activity Pane
Up / DownModal picker openScrolls the picker content 3 lines at a time
Up / DownSidebar focused (blank prompt)Moves selection between result cards in the Results Sidebar
Down / UpActivity Pane (blank prompt)Down enters the Activity Pane below the prompt; Up moves back up to the prompt
LeftActivity Pane focusedJumps to the parent item in the activity hierarchy
UpBlank prompt + queued draftsLoads the latest queued message back into the input buffer for editing (never overwrites an existing single-line draft)
Up / DownNormal promptNavigates multi-line drafts or recalls input history
EnterActivity item selectedOpens 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
DeleteActivity Pane or Results Sidebar focusedStops an owned process, cancels a running subagent, or cancels an armed wake-up monitor (without killing the process); safely refuses foreign SHARED rows
EnterTurn actively runningQueues a follow-up message in the Queue Pane for the next turn boundary
Ctrl+X SStandard chatToggles Results Sidebar visibility (configurable chord; conflict-checked)
Ctrl+X RStandard chatToggles keyboard focus on the Results Sidebar (configurable chord)
Ctrl+BBlocking tool / subagent runningBackgrounds the active subagent/task (or forwards native backgrounding in passthrough when the child supports it)
EscapeActive turn / modal / subagent viewCancels the foreground operation or returns to the main transcript view
Ctrl+CPassthrough / IdleInterrupts the active child subprocess in passthrough; cancels or exits at idle
Ctrl+GManaged passthroughForce-cancels Kompile's managed agent process
Ctrl+]Raw /passthrough (/keys) modeExits direct key-forwarding mode and returns input control to Kompile
PageUp / PageDownAnywherePages up/down through the managed transcript
Ctrl+Home / Ctrl+EndAnywhereJumps directly to the top or bottom of the transcript
Shift+Ctrl+CTranscript text selectedCopies 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 & mirrored SHARED process rows, monitor, tool, task, auxiliary chat, and /activity project rows) with ↑ / ↓ and jump to a parent node with ←.
  • Press Enter to inspect a 2,000-line live process log or bounded subagent transcript (scroll with PageUp / PageDown; while a live subagent is open, typing sends follow-ups directly to that child).
  • Press Delete to kill an owned process, cancel a running subagent, or cancel a wake-up monitor without touching the underlying process (foreign SHARED processes are inspect-only, and selection clears automatically if a row exits so Delete never 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:

bash
# 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 --status

Every section in kompile configure is also a direct subcommand:

CommandWhat It Configures
kompile configure initProject .kompile/ directory and global ~/.kompile/ defaults
kompile configure chatChat mode (Standard / Passthrough / Server), provider, model, and project intent
kompile configure uiDisplay preset, layout mode, per-kind content routing, sidebar sections, and key chords (shared with /ui)
kompile configure passthroughInspect external CLIs (claude, codex, agy, opencode) and MCP/tool injection setup
kompile configure enforcerProject enforcer rules, banned tools, judge mode, and semantic matching
kompile configure judgeJudge backend, model selection, and quality scoring defaults
kompile configure agent-defaultsDefault models and per-model thinking effort for Codex, Claude, and OpenCode
kompile configure mcpMCP tool profile/schema and custom MCP servers
kompile configure code-indexLocal code search indexing for this or another source tree
kompile configure gatewayLLM-based tool gateway evaluation rules
kompile configure appFull 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 ​

PresetDefault LayoutInline Chat ContentSidebar ContentBest When…
classic (default)inlineFull inline assistant, thinking, tools, processes, subagents, todos, errorsOffYou want a traditional linear terminal transcript
focusedautoAssistant replies, thinking, and task plans (todos) stay full inline; errors show concise inline summarySuccessful tools, processes, subagents, sources, and custom blocks collapse into sidebar cards; errors expand in sidebarYou want a clean narrative thread with rich inspection on demand
verboseautoFull inline output for every block kindCollapsed sidebar cards alongside inline outputYou 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, default 35%).
  • auto: Uses split whenever the terminal can keep at least minChatColumns (60 columns) for chat, and automatically switches to a full-width drawer fallback on narrower terminals.

Direct /ui commands ​

text
/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 view

NOTE

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) ​

  1. Global: ~/.kompile/chat-ui-config.json
  2. Project: <repo>/.kompile/chat-ui-config.json
  3. 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 ​

FileScopeControls
~/.kompile/config/chat-config.json / <repo>/.kompile/chat-config.jsonGlobal / ProjectActive provider, model, auth method, chat mode, thinking effort
~/.kompile/config/subagent-config.jsonGlobalSubagent concurrency caps, banned model globs, per-role routes, failover rungs, token/dollar budgets
~/.kompile/config/enforcer-config.json / <repo>/.kompile/enforcer-config.jsonGlobal / ProjectTool guardrails, banned shell patterns, judge mode
~/.kompile/config/gc-config.json & log-retention.jsonGlobalSession archive age, disk limits, trash grace period
AGENTS.md / <repo>/.kompile/rules/ProjectProject 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:

bash
# 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-json

Released under the Apache-2.0 License.