This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is an entire CLI agent, it can do everything Claude code can do, using raw mode to support pasting, backspace, | |
| // escape to cancel agents turn, and multiline prompts with Shift + enter, | |
| // but with 2MB of RAM, neglibible CPU usage and one small C file. | |
| // It is a single C file for the openai responses api, with no dependency other than libcurl, and an | |
| // OPENAI_API_KEY env var. | |
| // compile with `cc -lcurl -o cgent this_file.c` then install where you please. | |
| // AI USAGE - This code was written without AI agents, largely to maintain my c skills, as such it is likely to have | |
| // memory safety bugs. | |
| #include <ctype.h> |