# Coding agent collector installer

This self-contained archive installs the shared analytics collector hooks for
Claude Code, Codex, and Pi on macOS or Linux. It does not need a mono checkout
and does not install system packages.

## Requirements

- macOS or Linux (including Ubuntu)
- Bash
- Python 3.10 or newer
- OpenSSH `ssh-keygen`

The installer checks these requirements before changing anything.

## Install

```bash
tar -xzf coding-agent-collector-installer.tar.gz
cd coding-agent-collector-installer
bash install-collector.sh
```

The guided flow copies the collector runtime to
`~/.collector/bin/collector.py`, creates or reuses a collector-specific Ed25519
key, gives you the public key to register in CACP, previews the exact settings
changes, and installs only after confirmation.

Install a single agent target with `--target claude`, `--target codex`, or
`--target pi`. Set `COLLECTOR_URL_BASE` or pass
`--var url_base=https://collector.example/hook` to use another collector.

The distributed hooks send the agent hook payload plus bounded host, session,
model, and group metadata. They pass `--no-env`, so they do not send the host's
full environment-variable set.

## Verify the download

The download directory also contains
`coding-agent-collector-installer.tar.gz.sha256`.

```bash
# macOS
shasum -a 256 -c coding-agent-collector-installer.tar.gz.sha256

# Ubuntu/Linux
sha256sum -c coding-agent-collector-installer.tar.gz.sha256
```

## Update or remove

Re-run a newer installer archive to update the collector and hooks
idempotently. Remove only the collector-owned hooks with:

```bash
bash install-collector.sh --remove
```

The removal flow preserves foreign hooks, signing keys, the installed collector
runtime, and unrelated agent settings.
