Skip to content

Commit 9b7403e

Browse files
committed
Expand CLI with site management and realtime stats workflows
1 parent 37774b9 commit 9b7403e

File tree

5 files changed

+750
-94
lines changed

5 files changed

+750
-94
lines changed

docs/000-v1-plan.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
Deliver an ergonomic CLI that surfaces Plausible Analytics capabilities to humans and LLMs, while respecting rate limits, juggling multiple accounts, and enabling queued API execution.
55

66
## Current Status — 2025-10-29
7-
- ✅ Foundations in place: repo scaffolding, account store (file-backed), Plausible client (sites + stats aggregate/timeseries/breakdown + events send), rate limiter scaffold, queue/worker with inspect/drain, CLI surface (`status`, `sites list`, `stats aggregate/timeseries/breakdown`, `events template/send/import`, `accounts` CRUD), docs/LLM artefacts, CI wiring (latest on `main` @ 3a2b77c).
8-
- ⏳ Features to extend: stats `realtime`, sites CRUD/reset/delete, queue retry/backoff controls, daily budget configurability, secure keyring fallback, telemetry export.
9-
- 🔬 Test gaps: full CLI integration coverage via `assert_cmd` + JSON snapshots, expanded HTTP mocks (sites CRUD, realtime), backpressure + large import cases, keyring mock coverage.
7+
- ✅ Foundations in place: repo scaffolding, account store (file-backed), Plausible client (sites list/create/update/reset/delete, stats aggregate/timeseries/breakdown/realtime, events send), rate limiter scaffold, queue/worker with inspect/drain, CLI surface (`status`, `sites list/create/update/reset/delete`, `stats aggregate/timeseries/breakdown/realtime`, `events template/send/import`, `queue inspect/drain`, `accounts` CRUD), docs/LLM artefacts, CI wiring (latest on `main` @ 37774b9).
8+
- ⏳ Features to extend: queue retry/backoff controls, daily budget configurability, secure keyring fallback, richer telemetry/export surfaces.
9+
- 🔬 Test gaps: full CLI integration coverage via `assert_cmd` + JSON snapshots, expanded HTTP mocks (sites destructive actions, realtime edge cases), backpressure + large import cases, keyring mock coverage.
1010
- 🚀 Distribution polish pending: GitHub release workflow, `cargo install` docs, Homebrew tap automation, tagged release + changelog.
11-
- 🧭 Next sprint focus: persistence polish (daily budget + keyring), extend site/event surface, then harden integration tests before release packaging.
11+
- 🧭 Next sprint focus: persistence polish (daily budget + keyring), queue resilience, and end-to-end CLI tests before release packaging.
1212

1313
## Release Scope
1414
- Sites, Stats, Events API coverage.
@@ -82,8 +82,8 @@ gantt
8282
- ⏳ Tests: concurrency under load, ensures queue drains, error propagation.
8383

8484
### 6. CLI Commands & Output
85-
- ✅ Sites `list`; ⏳ `create/update/reset/delete`.
86-
- ✅ Stats `aggregate/timeseries/breakdown`; ⏳ `realtime` with shared flags.
85+
- ✅ Sites `list/create/update/reset/delete`.
86+
- ✅ Stats `aggregate/timeseries/breakdown/realtime` with shared flags.
8787
- ✅ Events `template/send/import`.
8888
- ✅ Queue `inspect/drain`.
8989
- ✅ Status (reports account, limits, queue stats, API health).

docs/architeture.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
- Expose machine-readable JSON outputs and human-readable table narratives.
88

99
## Status Snapshot — 2025-10-29
10-
- ✅ Implemented: account store (file-backed) with CRUD, Plausible client (sites list, stats aggregate/timeseries/breakdown, events send), rate limiter with hourly ledger, queue + telemetry + inspect/drain snapshotting, CLI commands (`status`, `sites list`, `stats aggregate/timeseries/breakdown`, `events template/send/import`, `accounts` subcommands), documentation set, CI pipeline.
11-
- ⏳ In progress: extend Plausible client (sites CRUD/reset/delete, stats realtime, advanced events batching), integration tests & CLI snapshots, daily budget overrides, secure keyring/OS credential fallback, queue retry/backoff controls.
10+
- ✅ Implemented: account store (file-backed) with CRUD, Plausible client (sites list/create/update/reset/delete, stats aggregate/timeseries/breakdown/realtime, events send), rate limiter with hourly ledger, queue + telemetry + inspect/drain snapshotting, CLI commands (`status`, `sites list/create/update/reset/delete`, `stats aggregate/timeseries/breakdown/realtime`, `events template/send/import`, `queue inspect/drain`, `accounts` subcommands), documentation set, CI pipeline.
11+
- ⏳ In progress: integration tests & CLI snapshots, daily budget overrides, secure keyring/OS credential fallback, queue retry/backoff controls, advanced telemetry export.
1212
- 🚀 Pending release tasks: distribution automation (GitHub releases, Homebrew tap), versioning, `plausible doctor`, TDD expansion before v1 tag.
1313

1414
## API Surface Summary
@@ -46,16 +46,16 @@
4646

4747
### `plausible sites`
4848
-`list` – summarizes domains, visibility status, timezone (wired through queue + Plausible client).
49-
- `create` – accept domain, timezone, optional public flag.
50-
- `update` – patch properties via key-value flags.
51-
- `reset` – trigger stats reset with date range confirmation.
52-
- `delete` – queued destructive call requiring confirmation.
49+
- `create` – accept domain, timezone, optional public flag.
50+
- `update` – patch properties via key-value flags (`--timezone`, `--public`, `--main-site`).
51+
- `reset` – trigger stats reset with optional date range confirmation.
52+
- `delete` – queued destructive call requiring `--force` or interactive confirmation.
5353

5454
### `plausible stats`
5555
-`aggregate` – returns KPI metrics; supports `--metric` repeatable flags.
5656
-`timeseries` – emits chronologically sorted rows; optional `--json` or `--csv`.
5757
-`breakdown` – slices by dimensions with pagination; handles `--dimension` values.
58-
- `realtime` – fetch visitors currently on site.
58+
- `realtime` – fetch visitors currently on site and prints visitors/pageviews/bounce rate.
5959
- Shared flags: `--site`, `--period|--date`, `--filters`, `--props`, `--format`.
6060

6161
### `plausible events`

0 commit comments

Comments
 (0)