Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/javierpr0/Notchly/llms.txt

Use this file to discover all available pages before exploring further.

As you type in the Notchly terminal, a ghost text suggestion appears inline after your cursor. The suggestion is drawn from the same command store as the command palette — your recorded commands, imported zsh history, and ~450 built-in defaults — and is ranked by how often and how recently you’ve used each command. You don’t need to open any menu; the suggestion appears automatically and disappears the moment it’s no longer relevant.

How it works

Autocomplete activates when you have typed 2 or more characters at a shell prompt (detected by a trailing $, %, or > character). After a short debounce delay following each keypress, the engine scans the command store for the current project directory and picks the best match.
The engine tries two passes in order:
  1. Prefix match — the command starts with exactly what you’ve typed (case-insensitive). Prefix matches receive a base score of 100.
  2. Fuzzy match — the typed characters appear in order anywhere in the command. Fuzzy matches receive a base score of 40.
Commands that don’t match either way are excluded entirely.
After the base score, two bonuses are applied:
  • Frequency bonuslog2(run_count + 1) × 5, capped at 30. This rewards commands you use often without letting a single heavily-used command permanently dominate every suggestion.
  • Recency bonus — 20 points if used today, 10 points within the last 7 days, 5 points within the last 30 days, 0 otherwise.
A small length penalty (−0.1 × character_count) gives a slight preference to shorter, less-noisy commands when scores are otherwise equal. The top suggestion from this ranked list is shown as the ghost text.
The suggestion is rendered by GhostTextView, an NSView subview placed directly inside the terminal view at the cursor position. The text is drawn in white at 35% opacity using the same monospaced font as the terminal. Cell width is computed using the same glyph-advancement formula that SwiftTerm uses internally, so the ghost text aligns precisely with the terminal grid at any font size.

Accepting a suggestion

Two keys accept the current ghost text suggestion:
  • Tab — accepts the full ghost text and inserts the complete command into the terminal input.
  • Right Arrow → — accepts the suggestion without moving your hands away from the arrow keys.
Keep typing to filter the suggestion to a different command. The ghost text updates after each keystroke. It clears automatically when you:
  • Press Enter to run a command
  • Press Backspace past the point where the suggestion matched
  • Press Escape
  • Type a character that leaves no matching suggestion

Performance

Autocomplete is designed to add no overhead to tabs you’re not actively using.
  • Focus-only scanning — the suggestion engine only runs for the terminal pane that currently has keyboard focus. Background tabs do not schedule debounce timers or scan their command store, so opening many tabs does not add CPU work on each keystroke.
  • Lowercased cache — each command string is lowercased once and cached. The per-keystroke scoring loop reads the cached lowercase form instead of re-lowercasing on every comparison, which matters when the store holds hundreds of entries.
  • Bounded suggestions — after scoring all commands in the store, the engine returns at most 7 top-ranked results. The suggestion shown as ghost text is always the highest-scoring entry from that set.
If suggestions feel stale or empty for a new project, run a few commands in the terminal first. The store seeds itself per directory the first time you type there — once a handful of project-specific commands are recorded, they’ll appear as suggestions immediately.

Relationship to the command palette

Autocomplete and the command palette share the same CommandStore. Any command you run — whether typed directly, accepted from ghost text, or executed from the palette — is recorded in one place. The zsh history import (~/.zsh_history) runs at most once per process launch and the result is cached in memory, so reopening a project directory doesn’t trigger another disk read.

Build docs developers (and LLMs) love