The ai-cli library detects programs that offer interactive command-line editing through the readline library, and modifies their interface to allow obtaining help from a GPT large language model, such as OpenAI's or one provided through a llama.cpp server. Think of it as a command line copilot.