# Analytics CLI reference

Source: `@socra/analytics-cli@0.0.0`.

This reference includes every command, argument, and option declared by this released package. Defaults and accepted values are included where the package declares them. Command-specific validation and permissions also apply; see the [API reference](/docs/analytics/reference/api) for resource contracts.

Use `socra analytics --help`, or append `--help` to any command, to inspect the locally installed version.

## socra analytics

Collect and query project-owned analytics

| Command | Purpose |
| --- | --- |
| `socra analytics dataset` | Manage isolated analytics datasets |
| `socra analytics event` | Ingest and inspect analytics events |
| `socra analytics report` | Query analytics reports |

## socra analytics dataset

Manage isolated analytics datasets

| Command | Purpose |
| --- | --- |
| `socra analytics dataset create` | Create a dataset |
| `socra analytics dataset list` | List datasets |
| `socra analytics dataset get` | Get a dataset |
| `socra analytics dataset update` | Update a dataset |
| `socra analytics dataset rotate-key` | Replace a dataset ingestion write key |
| `socra analytics dataset delete` | Delete a dataset |

## socra analytics dataset create

Create a dataset

```text
socra analytics dataset create <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Dataset name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |
| `--environment` | Value | Environment name (default production) |
| `--retention-days` | Value | Event retention in days (default 90) |

## socra analytics dataset list

List datasets

```text
socra analytics dataset list [options]
```

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |
| `--limit` | Value | Maximum rows to return (default 20) |
| `--after` | Value | Cursor from a previous page |

## socra analytics dataset get

Get a dataset

```text
socra analytics dataset get <id> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `id` | Yes | Dataset id |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |

## socra analytics dataset update

Update a dataset

```text
socra analytics dataset update <id> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `id` | Yes | Dataset id |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |
| `--name` | Value | Dataset name |
| `--environment` | Value | Environment name |
| `--retention-days` | Value | Event retention in days |
| `--status` | Value | active or suspended |

## socra analytics dataset rotate-key

Replace a dataset ingestion write key

```text
socra analytics dataset rotate-key <id> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `id` | Yes | Dataset id |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |

## socra analytics dataset delete

Delete a dataset

```text
socra analytics dataset delete <id> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `id` | Yes | Dataset id |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |

## socra analytics event

Ingest and inspect analytics events

| Command | Purpose |
| --- | --- |
| `socra analytics event track` | Send one event using a dataset write key |
| `socra analytics event list` | List events in a dataset |

## socra analytics event track

Send one event using a dataset write key

```text
socra analytics event track <name> [options]
```

### Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | Yes | Stable event name |

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--write-key` | Value | Dataset write key |
| `--distinct-id` | Value | User or actor identifier |
| `--session-id` | Value | Session identifier |
| `--source` | Value | Origin such as web, ios, or backend |
| `--properties` | Value | JSON object of event properties |
| `--idempotency-key` | Value | Stable retry identifier |

## socra analytics event list

List events in a dataset

```text
socra analytics event list [options]
```

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |
| `--dataset` | Value | Dataset id |
| `--name` | Value | Event name |
| `--since` | Value | Start time |
| `--until` | Value | End time |
| `--limit` | Value | Maximum rows to return (default 20) |
| `--after` | Value | Cursor from a previous page |

## socra analytics report

Query analytics reports

| Command | Purpose |
| --- | --- |
| `socra analytics report events` | Count events over time |

## socra analytics report events

Count events over time

```text
socra analytics report events [options]
```

### Options

| Option | Input | Description |
| --- | --- | --- |
| `--project` | Value | Owning Socra project |
| `--dataset` | Value | Dataset id |
| `--since` | Value | Start time (default 24 hours ago) |
| `--until` | Value | End time (default now) |
| `--interval` | Value | hour or day (default hour) |
| `--name` | Value | Event name |

## Next step

Return to the [Analytics overview](/docs/analytics).

---

Company: Socra — Multiply Your Judgment
Canonical URL: https://cloud.socra.com/docs/analytics/reference/cli
