InvisibleGPT: Ambient AI Assistant
A small tool that takes a prompt from wherever you already are and puts the answer wherever you actually want it. The point was to never open a chat window. Copying a question and having the answer land back in the clipboard is a different interaction from tabbing to a browser, and the difference compounds over a day.
Built with Sahil, who wrote the first version.
Getting a prompt in
Three ways in. Clipboard mode polls and fires when you copy something that looks like a prompt. Keyboard mode captures on Cmd+. and submits on Cmd+Shift+.. Terminal mode reads stdin, which is what makes it scriptable.
Clipboard polling is the ugly part: a 100ms loop comparing against the last value.
last_clipboard = ""
while True:
current = pyperclip.paste()
if current != last_clipboard and should_process(current):
process_prompt(current)
time.sleep(0.1) # 100ms poll
It works, it burns CPU it shouldn't, and OS-level clipboard hooks are the right fix. I left the polling in because it was portable and the tool was for me.
Getting an answer out
Four routes. Clipboard writes silently so you paste it wherever you were. Terminal prints colored. File appends to a log. PDF renders a two-column article through pdflatex, which sounds absurd until you are trying to read a long technical answer and a research-paper layout is genuinely the most readable thing available.
The PDF path needed real LaTeX escaping for \, {, }, $, &, %, #, _, ~, and ^. Before that, roughly nine out of ten PDF failures were one unescaped character in a code block.
Configuration
TOML, with environment variable and CLI overrides:
[model]
name = "o4-mini-2025-04-16"
[input]
method = "keyboard"
[output]
method = "clipboard"
file = "output.txt"
[pdf]
pdflatex_path = ""
output_file = "output.pdf"
python src/main.py --input clipboard --output pdf --model gpt-4o
In practice
Clipboard detection is under 100ms, the API call is 1 to 5 seconds depending on model, PDF generation is half a second to a second, and it idles under 1% CPU at about 50MB.
The uses I did not design for were the ones that stuck: taking notes during a live lecture in clipboard mode, generating SQL from natural language by piping through terminal mode, drafting code review comments with the keyboard hotkey.
What it never got, and should have: streaming, so you aren't waiting on a full response before seeing anything, and session management, since there is exactly one conversation and no way to keep two threads apart.