explaingit

thalesmms/autocomp

22SwiftAudience · developerComplexity · 4/5ActiveSetup · hard

TLDR

Prototype macOS menu bar app that adds AI autocomplete to almost any focused text field, with Tab accepting the next word and backtick accepting the whole suggestion.

Mindmap

mindmap
  root((AutoComp))
    Inputs
      Focused text field
      User keystrokes
      Backend model
    Outputs
      Inline suggestion
      Mirror window
      Emoji on colon
    Use Cases
      Cross app text completion
      Local private completion
      Apple Intelligence completion
    Tech Stack
      Swift
      macOS Accessibility
      FoundationModels
      llama cpp

Things people build with this

USE CASE 1

Add cross-app AI autocomplete to any focused text field on macOS

USE CASE 2

Run completions locally with a llama.cpp GGUF model

USE CASE 3

Use Apple Intelligence FoundationModels as the completion backend

USE CASE 4

Trigger AutoComp builds from inside the Codex editor via the .codex file

Tech stack

SwiftmacOSllama.cppFoundationModels

Getting it running

Difficulty · hard Time to first run · 1h+

Requires macOS 14 or newer on Apple Silicon, accessibility and screen recording permissions, and optional Homebrew llama.cpp headers for the local backend.

In plain English

AutoComp is a prototype macOS app that adds AI text autocomplete to almost any program you type into. It lives in the menu bar, watches whichever text field currently has focus, asks an AI model what you are likely to type next, and shows the guess either inline inside the field or in a small mirror window next to it. Pressing Tab accepts the next word of the suggestion, and pressing the backtick key accepts the whole thing. It runs on macOS 14 or newer on Apple Silicon machines. To start it, you run a shell script in the repo that builds the Swift package, stages an app bundle into a dist folder, launches it, and confirms the process is alive. The same script is wired into the Run button of the Codex app through a file in the .codex folder, so you can trigger it from inside that editor too. The app reads the focused text field through the macOS accessibility system. It asks for accessibility permission on first launch and can also ask for screen recording. It refuses to read password fields or other fields flagged as unsupported, and it ships a compatibility list for browsers, writing apps, terminals, and code editors, plus a special case for Google Docs and a known unsupported state for Sheets and Slides. When you start a word with a colon, it offers emoji suggestions. For the actual completion, AutoComp can talk to three different backends. The default is a remote endpoint that follows the OpenAI API shape, which you configure in Settings under Model, with optional defaults read from a .env.local file. If the Mac supports Apple Intelligence through the FoundationModels framework, AutoComp can use that instead, and fall back to the remote one when it is unavailable. The third option is a local in-process model that uses llama.cpp and a GGUF model file, but only in builds that explicitly link the optional runtime, which requires Homebrew installed llama.cpp headers and libraries. The README is upfront that this is a prototype. Data collection is off by default, local personalization is stored encrypted with keys managed in the Keychain, and there is a delete-all control for that data.

Copy-paste prompts

Prompt 1
Build and launch AutoComp from the included shell script and confirm the menu bar app is alive
Prompt 2
Configure AutoComp to use an OpenAI-shaped remote endpoint with a .env.local file
Prompt 3
Enable the optional llama.cpp backend in AutoComp using Homebrew installed headers and a GGUF model
Prompt 4
Walk me through granting accessibility and screen recording permissions to AutoComp on first launch
Prompt 5
Add a new app to the AutoComp compatibility list and respect the password-field skip rule
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.