> ## 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 external agent plugins

External agent plugins are discovered 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 plugin communicates with the CLI through **subcommands** that read/write JSON over stdin/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`)         |

The working directory is always set to the repository root.

The plugin follows these conventions:

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