Documentation
¶
Overview ¶
Command headless embeds PiG as a library: a coding session with MCP servers and one provider (Anthropic), and no terminal. It reads a prompt from its arguments, runs it, and prints the last assistant message.
ANTHROPIC_API_KEY=... go run ./examples/headless "list the files in the current directory"
MCP servers come from mcp.json in the agent directory and in the project's .pig directory, as for the pig command.
The size of this program is what an embedder pays for MCP, the session API and the provider code. Build it with the strip tags that drop the features it never uses (see docs/site/docs/embedding.md and TestHeadlessEmbedBinarySizeGate).
Click to show internal directories.
Click to hide internal directories.