Navigation
Copy page

Work in the TUI

On this page

You talk to kli through one editor at the bottom of the terminal. You type a prompt, send it, and the conversation scrolls above. This guide covers the keys you use every session, how to complete file paths and skill names as you type, how to fold and unfold tool output, and how to set the color theme. For the exhaustive key table see Keymap; for every color token see Themes.

Send, edit, and quit

Enter sends the prompt. For a multi-line prompt, insert a line break with Ctrl+J or Shift+Enter, keep typing, and send the whole thing with Enter.

The editor takes standard readline keys; see Keymap for the full table and rebinding.

Ctrl+L clears the screen. Ctrl+C takes two presses to quit: the first prints Press Ctrl+C again to quit., the second exits.

Esc depends on what kli is doing. While a turn is streaming, press it twice within about 1.5 seconds to interrupt the turn. At an idle prompt, press it twice to open the rewind menu over your earlier prompts; accept one to send the conversation back to before it.

Complete a file path with @

Type @ at the start of a token to reference a file. A menu of paths under the working directory opens as you type, ranked against what you have entered. In every completion menu, Up/Down move the selection, Tab or Enter accepts, and Esc dismisses. Hidden files stay out of the menu unless your text starts with a dot.

Selecting a directory keeps the menu open and steps into it, so you can walk down a tree one segment at a time. Selecting a file inserts the path and a trailing space. Esc closes the menu and leaves what you typed.

Complete a skill with $

Type $ at the start of a token to run a skill. The menu lists the skills available in this session; each row shows the skill name and its description.

Slash commands complete the same way. Type / and the command menu opens, then accepting a command offers help or candidates for its arguments. See Commands for what is available.

Complete a bare path with Tab

When no completion menu is open, Tab completes the path token directly before the cursor — no @ needed. One match is inserted at once; several open the menu to choose from. With a menu already open, Tab accepts the current selection instead.

Fold and unfold tool output with Ctrl+O

When kli runs a tool, the result is shown as a card in the transcript: a shell command's output, a file you asked it to read, the diff of an edit. By default these cards are collapsed so the conversation stays readable.

Press Ctrl+O to expand every committed tool card to its full output, including the full diff of each edit. Press Ctrl+O again to collapse them. The toggle reprints the transcript, so it applies to the whole session at once rather than one card at a time.

Let kli pick the theme

kli ships a dark and a light theme. By default it reads your terminal's background color at startup and selects the matching one, so a light terminal gets the light theme without any configuration. Detection happens once per session and is skipped under GNU screen.

If you do nothing, auto-detection stays on. To return to it after pinning a theme, set theme to "auto" or remove the key.

Pin a theme

To always use one theme regardless of the terminal background, set the theme key in settings.json to "dark" or "light":

json
{
  "theme": "dark"
}

Set it in settings.json (global ~/.config/kli/settings.json, project <repo>/.kli/settings.json; project wins) — see Settings.

A pinned theme turns off background detection for the session. An unknown name is ignored with a warning and the previous theme stays in effect. The setting is read at startup, so restart kli for a change to take hold.

Rebind a key

Bind a key through the keybindings object in settings.json. The keys are key-id strings like ctrl+r; the values are action names like delete-to-line-start:

json
{
  "keybindings": {
    "ctrl+r": "delete-to-line-start"
  }
}

Each entry sets one key and leaves the rest of the defaults in place. An unknown action name is skipped with a warning. For every key-id, action name, and the default binding of each key, see Keymap.