Metadata-Version: 2.4
Name: agenteye
Version: 0.1.5
Summary: Command-line client for the AgentEye dashboard API
Author-email: Failproof AI <support@exosphere.host>
License: Proprietary
Project-URL: Homepage, https://befailproof.ai
Project-URL: Documentation, https://github.com/agenteye-enterprise/releases
Keywords: agents,observability,ai,monitoring,agenteye,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13
Requires-Dist: posthog<4,>=3.5
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"

# AgentEye CLI (`agenteye`)

A command-line client for the AgentEye **dashboard** API. It lets a developer —
or the coding agent working alongside them — authenticate and query agent
sessions, event logs, and evaluations from the terminal, with a `--json` flag on
every command for scripting.

> This is the **`agenteye` CLI**, distinct from the collector daemon
> (`agenteye-collector`). The PyPI package and the installed command are both
> `agenteye`.

## Install

```bash
pipx install agenteye      # recommended (isolated)
# or: uv tool install agenteye  /  pip install agenteye
```

Install isolated (pipx / uv tool) — the AgentEye Python SDK shares the `agenteye`
distribution name, so isolation avoids a clash in a shared virtualenv.

For development in this repo:

```bash
cd cli
uv sync --extra dev
uv run agenteye --help
```

## Authentication

The CLI talks to your dashboard (set `--base-url` or `AGENTEYE_DASHBOARD_URL`) and logs in with
an emailed one-time code:

```bash
agenteye login --email you@example.com
# enter the 6-digit code; the session is stored in ~/.agenteye/cli.json (mode 0600)
agenteye whoami
agenteye logout
```

Sessions expire (24h by default); re-run `agenteye login` when prompted.

## Commands

```text
agenteye sessions [--since 24h] [--status error] [--agent-id <id>] [--score helpfulness:..0.5] [--all]
agenteye events --session-id <id> [--event-type tool_use,tool_result] [--all]
agenteye logs ...                       # alias of events
agenteye evals --score helpfulness:0.5..0.8 --latest-per-session
agenteye session show <id>
agenteye session export <id> -o out.json
agenteye re-evaluate <id>
agenteye jobs                           # in-flight evaluation queue
agenteye environments [--source events|evals]
agenteye version                        # print the CLI version
agenteye help                           # show top-level help
```

Every command and subcommand has `--help` / `-h`; `agenteye -h` documents auth, exit codes, and
the global options. **Global options go before the command** (`agenteye --json events`, not
`agenteye events --json`).

Add `--json` for machine-readable output, and `--fields` to project just the keys you need:

```bash
agenteye --json events --session-id run-001 --all | jq '.events[].payload'
agenteye --json sessions --since 7d --fields session_id,status,scores
```

## Configuration

| Setting | Flag | Env var | Default |
|---|---|---|---|
| Dashboard URL | `--base-url` | `AGENTEYE_DASHBOARD_URL` | **required** (no default) |
| Session token | `--token` | `AGENTEYE_CLI_TOKEN` | from `~/.agenteye/cli.json` |
| JSON output | `--json` | `AGENTEYE_CLI_JSON` | off |
| Skip TLS verification | `--insecure` / `--secure` | `AGENTEYE_INSECURE` | off (saved at login) |
| Disable usage telemetry | _(none)_ | `AGENTEYE_ANALYTICS_DISABLED` (or `DO_NOT_TRACK`) | telemetry on |

Precedence is **flag > environment variable > config file**. The dashboard URL is
**required** (no default) — set `--base-url` or `AGENTEYE_DASHBOARD_URL`, or it's saved
after your first `login`. The config directory honours `AGENTEYE_HOME` (same as the SDK
and collector).

For a dashboard with a self-signed or internal TLS certificate, add `--insecure` to skip
certificate verification (saved at login, so you set it once). This disables protection
against man-in-the-middle attacks — prefer a valid certificate outside internal/testing use.

## Telemetry

The CLI sends anonymous usage analytics (which commands run, success/exit status, and duration)
to help prioritise improvements. **No data, URLs, tokens, emails, or query values are ever sent**,
and operators are identified only by an opaque id. It's on by default — disable it with
`AGENTEYE_ANALYTICS_DISABLED=1` (or the cross-tool `DO_NOT_TRACK=1`). Sending is time-bounded, so it
never delays a command. See `enterprise-docs/cli.md` for the full privacy details.

## Exit codes

| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage error (bad arguments) |
| 3 | Cannot reach the dashboard |
| 4 | Not logged in / session expired |
| 5 | Authenticated but missing permission |

## Tests

```bash
cd cli
uv run --extra dev pytest
```
