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

# Development

> Install the CLI, configure providers, and run ECP locally

This page focuses on developing and running ECP locally. It does not cover how this documentation site is built.

## Prerequisites

* **Node.js** 22+ (required for schema generation and CI)
* **npm** (v7+ for workspaces) or pnpm
* For **OpenAI**: set `OPENAI_API_KEY`
* For **Ollama**: [install Ollama](https://ollama.com/) and run it locally

## Install from npm (published packages)

```bash theme={null}
npm install -g @executioncontrolprotocol/cli
ecp validate spec.yaml --input shopifyStoreId=test --input jiraProject=TEST
```

## Build and use the CLI from the repo

From the **repository root**:

```bash theme={null}
npm install
npm run build
```

`npm run build` runs a full clean of package `dist/` outputs first, then compiles (see the repo root `package.json`).

Then either use the workspace binary:

```bash theme={null}
npx ecp validate spec.yaml --input shopifyStoreId=test --input jiraProject=TEST
```

Or link the CLI globally:

```bash theme={null}
cd packages/cli && npm link && cd ../..
```

(`ecp` runs compiled `dist/index.js` via `bin/ecp.cjs`.)

## Environment and config

* **OpenAI:** Set `OPENAI_API_KEY`.
* **Ollama:** Default base URL is `http://localhost:11434`; override with `--ollama-base-url` or `OLLAMA_BASE_URL`.
* **System config:** Optional `ecp.config.yaml` (e.g. from `config/ecp.config.example.yaml`) with **`version: "0.5"`**, wiring under **`models`**, **`tools`**, **`loggers`**, …, and policy under the **`security`** mirror. The CLI loads it from `--config`, `./ecp.config.yaml`, or `~/.ecp/config.yaml`.

See [SETUP.md](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/SETUP.md) for full details.

## Run examples

From the repo root (after `npm run build`):

```bash theme={null}
ecp run examples/single-executor/context.yaml --enable openai -i topic="ECP"
ecp validate examples/single-executor/context.yaml -i topic=test
```

To inspect what happened during a run, use `ecp trace` (tracing is enabled by default; disable with `--no-trace`).

For the full, up-to-date flag list, run `ecp --help` or `ecp <command> --help` (for example `ecp run --help`).

## Tests

Unit tests expect built packages (`dist/`). From the root:

```bash theme={null}
npm run build
npm run test:unit
```

Or `npm test` (builds first, then unit + integration + e2e).
