> ## Documentation Index
> Fetch the complete documentation index at: https://docs.entire.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> How the Entire CLI discovers and communicates with agent integrations

Entire discovers agent integrations through executable naming and `$PATH` lookup:

1. You create an executable named `entire-agent-<name>`
2. Place it anywhere on your `$PATH`
3. The CLI discovers it at startup and registers it as a new agent

The integration communicates with the CLI through **subcommands** that read and write JSON over stdin and stdout. Each invocation is stateless.

Every subcommand invocation receives these environment variables:

| Variable                  | Description                              |
| ------------------------- | ---------------------------------------- |
| `ENTIRE_REPO_ROOT`        | Absolute path to the git repository root |
| `ENTIRE_PROTOCOL_VERSION` | Protocol version (currently `1`)         |

Entire runs every subcommand from the repository root.

The integration follows these conventions:

* **Output:** JSON on stdout (unless noted otherwise)
* **Errors:** Nonzero exit code and message on stderr
* **Stateless:** Each invocation is independent, no persistent connection
