npm package: @llmsignal/cli
Description: CLI for generating snippets and testing LLM Signal tracking endpoints.
Latest version: 0.2.1

# @llmsignal/cli

CLI for installing, validating, and testing LLM Signal tracking from the terminal.

## Canonical Links

- Public CLI docs: https://www.llmsignal.app/docs/cli
- Docs home: https://www.llmsignal.app/docs
- llms.txt: https://www.llmsignal.app/llms.txt
- Support: support@llmsignal.app

## Install and Run

Published package:

```bash
npx @llmsignal/cli@latest --help
```

Global install:

```bash
npm i -g @llmsignal/cli
llmsignal --help
```

From this repo:

```bash
node packages/cli/bin/llmsignal.js --help
```

## Quickstart (Copy/Paste)

Bash:

```bash
export LLMSIGNAL_BASE_URL="https://www.llmsignal.app"
export LLMSIGNAL_SITE_ID="YOUR_SITE_ID"
export LLMSIGNAL_API_KEY="YOUR_API_KEY"
export LLMSIGNAL_DOMAIN="example.com"

npx @llmsignal/cli@latest snippet --site-id "$LLMSIGNAL_SITE_ID" --domain "$LLMSIGNAL_DOMAIN"
npx @llmsignal/cli@latest ping --site-id "$LLMSIGNAL_SITE_ID" --domain "$LLMSIGNAL_DOMAIN"
npx @llmsignal/cli@latest ingest --site-id "$LLMSIGNAL_SITE_ID" --api-key "$LLMSIGNAL_API_KEY" --path /llmsignal-cli-test
npx @llmsignal/cli@latest canary --site-id "$LLMSIGNAL_SITE_ID" --domain "$LLMSIGNAL_DOMAIN"
npx @llmsignal/cli@latest status --site-id "$LLMSIGNAL_SITE_ID" --api-key "$LLMSIGNAL_API_KEY"
npx @llmsignal/cli@latest verify --site-id "$LLMSIGNAL_SITE_ID" --api-key "$LLMSIGNAL_API_KEY" --timeout-seconds 120
```

PowerShell:

```powershell
$env:LLMSIGNAL_BASE_URL = "https://www.llmsignal.app"
$env:LLMSIGNAL_SITE_ID = "YOUR_SITE_ID"
$env:LLMSIGNAL_API_KEY = "YOUR_API_KEY"
$env:LLMSIGNAL_DOMAIN = "example.com"

npx @llmsignal/cli@latest snippet --site-id $env:LLMSIGNAL_SITE_ID --domain $env:LLMSIGNAL_DOMAIN
npx @llmsignal/cli@latest ping --site-id $env:LLMSIGNAL_SITE_ID --domain $env:LLMSIGNAL_DOMAIN
npx @llmsignal/cli@latest ingest --site-id $env:LLMSIGNAL_SITE_ID --api-key $env:LLMSIGNAL_API_KEY --path /llmsignal-cli-test
npx @llmsignal/cli@latest canary --site-id $env:LLMSIGNAL_SITE_ID --domain $env:LLMSIGNAL_DOMAIN
npx @llmsignal/cli@latest status --site-id $env:LLMSIGNAL_SITE_ID --api-key $env:LLMSIGNAL_API_KEY
npx @llmsignal/cli@latest verify --site-id $env:LLMSIGNAL_SITE_ID --api-key $env:LLMSIGNAL_API_KEY --timeout-seconds 120
```

## Commands

Get command-specific help:

```bash
llmsignal snippet --help
llmsignal ping --help
llmsignal ingest --help
llmsignal canary --help
llmsignal bootstrap --help
llmsignal status --help
llmsignal verify --help
```

Generate script snippet:

```bash
llmsignal snippet --site-id YOUR_SITE_ID --domain example.com
```

Install ping:

```bash
llmsignal ping --site-id YOUR_SITE_ID --domain example.com
```

Ingest event:

```bash
llmsignal ingest --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --path /pricing
```

Canary script-fetch test:

```bash
llmsignal canary --site-id YOUR_SITE_ID --domain example.com
```

Agent bootstrap payload:

```bash
llmsignal bootstrap --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --json
```

Agent status:

```bash
llmsignal status --site-id YOUR_SITE_ID --api-key YOUR_API_KEY
```

Wait until installed:

```bash
llmsignal verify --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --timeout-seconds 120
```

## JSON Output

All commands support `--json`:

```bash
llmsignal snippet --site-id YOUR_SITE_ID --domain example.com --json
llmsignal ping --site-id YOUR_SITE_ID --domain example.com --json
llmsignal ingest --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --path /pricing --json
llmsignal canary --site-id YOUR_SITE_ID --domain example.com --json
llmsignal bootstrap --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --json
llmsignal status --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --json
llmsignal verify --site-id YOUR_SITE_ID --api-key YOUR_API_KEY --json
```

## Environment Variables

- `LLMSIGNAL_BASE_URL` default: `https://www.llmsignal.app`
- `LLMSIGNAL_SITE_ID`
- `LLMSIGNAL_API_KEY`
- `LLMSIGNAL_DOMAIN`

## Exit Codes

- `0`: success
- `1`: error (validation, auth, or network/API failure)

## Publishing

- Release instructions: `packages/cli/RELEASING.md`
- Version history: `packages/cli/CHANGELOG.md`

## Agent API v1

- `POST /api/agent/v1/bootstrap` (returns snippet + recommended commands)
- `POST /api/agent/v1/status` (returns install health + diagnostics)