@owlmetry/cli 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -6899,7 +6899,7 @@ ${funnel.description}`);
|
|
|
6899
6899
|
const step = funnel.steps[i];
|
|
6900
6900
|
const filter = step.event_filter;
|
|
6901
6901
|
const filterParts = [];
|
|
6902
|
-
if (filter.
|
|
6902
|
+
if (filter.step_name) filterParts.push(`step=${filter.step_name}`);
|
|
6903
6903
|
if (filter.screen_name) filterParts.push(`screen=${filter.screen_name}`);
|
|
6904
6904
|
lines.push(` ${i + 1}. ${step.name} ${source_default.dim(filterParts.join(", "))}`);
|
|
6905
6905
|
}
|
|
@@ -7198,7 +7198,7 @@ var switchCommand = new Command("switch").description("Switch active team profil
|
|
|
7198
7198
|
});
|
|
7199
7199
|
|
|
7200
7200
|
// src/index.ts
|
|
7201
|
-
var program2 = new Command().name("owlmetry").version("0.1.
|
|
7201
|
+
var program2 = new Command().name("owlmetry").version("0.1.12").description("OwlMetry CLI \u2014 query metrics and manage your apps from the terminal").addOption(
|
|
7202
7202
|
new Option("--format <format>", "Output format").choices(["table", "json", "log"]).default("table")
|
|
7203
7203
|
).option("--endpoint <url>", "OwlMetry API server URL").option("--api-key <key>", "API key").option("--ingest-endpoint <url>", "OwlMetry ingest endpoint URL (for SDKs; defaults to API endpoint for self-hosted)").option("--team <name-or-id>", "Use a specific team profile for this command");
|
|
7204
7204
|
program2.addCommand(authCommand);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: owlmetry-cli
|
|
3
|
-
version: 0.1.
|
|
3
|
+
version: 0.1.12
|
|
4
4
|
description: >-
|
|
5
5
|
Install the OwlMetry CLI, sign up, and manage projects, apps, metrics,
|
|
6
6
|
funnels, and events. Use when adding OwlMetry to a project, querying
|
|
@@ -106,6 +106,15 @@ Use the `client_key` from Step 3 to configure the appropriate SDK:
|
|
|
106
106
|
|
|
107
107
|
Pass the **ingest endpoint** and client key to the SDK's `configure()` call. Read `~/.owlmetry/config.json` for the `ingest_endpoint` value (set during auth). For the hosted platform it's `https://ingest.owlmetry.com`. For self-hosted it defaults to the API endpoint.
|
|
108
108
|
|
|
109
|
+
### Step 5 — Add to project's CLAUDE.md
|
|
110
|
+
|
|
111
|
+
Add this to the project's `CLAUDE.md` so future sessions know OwlMetry is integrated and load the right skills:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
### OwlMetry
|
|
115
|
+
Load the `/owlmetry-cli` skill before running any `owlmetry` CLI commands or doing analytics work — it links to the appropriate SDK skill for your platform.
|
|
116
|
+
```
|
|
117
|
+
|
|
109
118
|
## Resource Hierarchy
|
|
110
119
|
|
|
111
120
|
OwlMetry organises resources in a `Team → Project → Apps` hierarchy:
|
|
@@ -116,6 +125,14 @@ OwlMetry organises resources in a `Team → Project → Apps` hierarchy:
|
|
|
116
125
|
|
|
117
126
|
Projects group apps cross-platform: an iOS app and its backend API can share the same project, enabling unified funnel and metric analysis across both.
|
|
118
127
|
|
|
128
|
+
## Discovering IDs
|
|
129
|
+
|
|
130
|
+
Always use CLI commands to get IDs — never read `~/.owlmetry/config.json` directly.
|
|
131
|
+
|
|
132
|
+
- **Team ID**: `owlmetry whoami --format json` → `.teams[].id`
|
|
133
|
+
- **Project ID**: `owlmetry projects --format json` → `[].id`
|
|
134
|
+
- **App ID**: `owlmetry apps list --format json` → `[].id` (also returns `client_key`)
|
|
135
|
+
|
|
119
136
|
## Command Quick Reference
|
|
120
137
|
|
|
121
138
|
Copy-paste ready. All commands support `--format json` for machine-readable output. Global flags: `--endpoint <url>`, `--api-key <key>`, `--team <name-or-id>`.
|
|
@@ -219,9 +236,9 @@ Slugs: lowercase letters, numbers, hyphens only (`/^[a-z0-9-]+$/`).
|
|
|
219
236
|
|
|
220
237
|
### Funnel Definitions
|
|
221
238
|
|
|
222
|
-
Funnels measure how users progress through a multi-step flow and where they drop off. Each funnel has an ordered list of steps, and each step has an `event_filter` that matches
|
|
239
|
+
Funnels measure how users progress through a multi-step flow and where they drop off. Each funnel has an ordered list of steps, and each step has an `event_filter` that matches on `step_name` and/or `screen_name`.
|
|
223
240
|
|
|
224
|
-
|
|
241
|
+
Step definitions match directly on the step name passed to `track()` in the SDK — no prefix or transformation needed.
|
|
225
242
|
|
|
226
243
|
Funnels support two analysis modes:
|
|
227
244
|
- **Closed mode** (default): sequential — a user must complete steps in order (step 2 only counts if step 1 was completed first). Use for linear flows like onboarding or checkout.
|
|
@@ -241,8 +258,8 @@ owlmetry funnels delete <slug> --project-id <id>
|
|
|
241
258
|
# 1. Write steps to a JSON file
|
|
242
259
|
cat > /tmp/funnel-steps.json << 'EOF'
|
|
243
260
|
[
|
|
244
|
-
{"name": "Step Name", "event_filter": {"
|
|
245
|
-
{"name": "Next Step", "event_filter": {"
|
|
261
|
+
{"name": "Step Name", "event_filter": {"step_name": "step-name"}},
|
|
262
|
+
{"name": "Next Step", "event_filter": {"step_name": "next-step"}}
|
|
246
263
|
]
|
|
247
264
|
EOF
|
|
248
265
|
|
|
@@ -258,7 +275,7 @@ owlmetry funnels update <slug> --project-id <id> --steps-file /tmp/updated-steps
|
|
|
258
275
|
|
|
259
276
|
Inline `--steps '<json>'` also works but is error-prone in shell environments due to JSON quoting. Prefer `--steps-file`.
|
|
260
277
|
|
|
261
|
-
Steps JSON format: `[{"name":"Step Name","event_filter":{"
|
|
278
|
+
Steps JSON format: `[{"name":"Step Name","event_filter":{"step_name":"step-name"}}]`
|
|
262
279
|
|
|
263
280
|
## Querying
|
|
264
281
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: owlmetry-node
|
|
3
|
-
version: 0.1.
|
|
3
|
+
version: 0.1.12
|
|
4
4
|
description: >-
|
|
5
5
|
Integrate the OwlMetry Node.js SDK into a backend service for server-side
|
|
6
6
|
analytics, event tracking, metrics, funnels, and A/B experiments. Use when
|
|
@@ -175,7 +175,7 @@ const owl = Owl.withUser(userId);
|
|
|
175
175
|
owl.track('checkout-completed', { item_count: '3' });
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
The step name you pass to `track()` must match the `step_name` in the funnel definition's `event_filter`. For example, if the step filter is `{"step_name": "signup-started"}`, then call `Owl.track('signup-started')`. Define matching funnels via `/owlmetry-cli`.
|
|
179
179
|
|
|
180
180
|
**Note:** `track()` attributes must be `Record<string, string>` (string values only).
|
|
181
181
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: owlmetry-swift
|
|
3
|
-
version: 0.1.
|
|
3
|
+
version: 0.1.12
|
|
4
4
|
description: >-
|
|
5
5
|
Integrate the OwlMetry Swift SDK into an iOS or macOS app for analytics,
|
|
6
6
|
event tracking, metrics, funnels, and A/B experiments. Use when
|
|
@@ -256,10 +256,17 @@ Owl.clearUser(newAnonymousId: true)
|
|
|
256
256
|
Funnels measure how users progress through a multi-step flow (onboarding, checkout, activation) and where they drop off. The system has three parts:
|
|
257
257
|
|
|
258
258
|
1. **Define** the funnel server-side (via CLI or API) with ordered steps and event filters.
|
|
259
|
-
2. **Track** steps client-side with `Owl.track("step-name")
|
|
259
|
+
2. **Track** steps client-side with `Owl.track("step-name")`.
|
|
260
260
|
3. **Query** analytics to see conversion rates and drop-off between steps.
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
The step name you pass to `Owl.track()` must match the `step_name` in the funnel definition's `event_filter`. For example, if the step filter is `{"step_name": "welcome-screen"}`, then call `Owl.track("welcome-screen")`.
|
|
263
|
+
|
|
264
|
+
**Funnel design rules:**
|
|
265
|
+
- Each step must be a point that **every user in the funnel passes through** on the way to the goal. If a step is conditional (e.g., paywall only shown to free users), it breaks the chain — users who skip it show as 0% conversion from that point.
|
|
266
|
+
- Keep funnels focused on **one flow**. Don't combine "import a model" + "explore features" into one funnel — those are separate journeys with separate goals.
|
|
267
|
+
- **Optional interactions are not steps.** Toggling a setting, viewing info, or using a tool are engagement events (log with `Owl.info()`), not funnel progression. A funnel step should represent the user moving closer to the goal.
|
|
268
|
+
- Split alternative paths into **separate funnels**. If users can take a screenshot OR record a video, create two funnels — don't put both paths in one.
|
|
269
|
+
- Aim for **3-6 steps** per funnel. Too few = no drop-off insight. Too many = noise.
|
|
263
270
|
|
|
264
271
|
Use `attributes` when you need to segment funnel analytics later (e.g., by signup method or referral source).
|
|
265
272
|
|
|
@@ -270,15 +277,15 @@ Owl.track("complete-profile")
|
|
|
270
277
|
Owl.track("first-post")
|
|
271
278
|
```
|
|
272
279
|
|
|
273
|
-
|
|
280
|
+
Define matching funnel definitions via `/owlmetry-cli`:
|
|
274
281
|
```bash
|
|
275
282
|
# Write steps to a JSON file (avoids shell quoting issues)
|
|
276
283
|
cat > /tmp/funnel-steps.json << 'EOF'
|
|
277
284
|
[
|
|
278
|
-
{"name": "Welcome", "event_filter": {"
|
|
279
|
-
{"name": "Account", "event_filter": {"
|
|
280
|
-
{"name": "Profile", "event_filter": {"
|
|
281
|
-
{"name": "First Post", "event_filter": {"
|
|
285
|
+
{"name": "Welcome", "event_filter": {"step_name": "welcome-screen"}},
|
|
286
|
+
{"name": "Account", "event_filter": {"step_name": "create-account"}},
|
|
287
|
+
{"name": "Profile", "event_filter": {"step_name": "complete-profile"}},
|
|
288
|
+
{"name": "First Post", "event_filter": {"step_name": "first-post"}}
|
|
282
289
|
]
|
|
283
290
|
EOF
|
|
284
291
|
|
|
@@ -388,13 +395,27 @@ Owl.clearExperiments()
|
|
|
388
395
|
- All events automatically include an `experiments` field with current assignments.
|
|
389
396
|
- Query funnel analytics segmented by variant via CLI: `owlmetry funnels query <slug> --project <id> --group-by experiment:checkout-redesign`
|
|
390
397
|
|
|
398
|
+
## What the SDK Tracks Automatically
|
|
399
|
+
|
|
400
|
+
Do not re-implement any of these — they are built into the SDK and emitted without any code:
|
|
401
|
+
|
|
402
|
+
- **`sdk:configured`** — emitted on `Owl.configure()`
|
|
403
|
+
- **`sdk:backgrounded`** / **`sdk:foregrounded`** — app state transitions
|
|
404
|
+
- **`sdk:shutdown`** — on `Owl.shutdown()`
|
|
405
|
+
- **`session_id`** — fresh UUID per `configure()` call, included on every event
|
|
406
|
+
- **`_launch_time_ms`** — app launch time, included in the `session_started` event
|
|
407
|
+
- **`_connection`** — network type (wifi, cellular, etc.), included on every event
|
|
408
|
+
- **Device model, OS version, locale** — included on every event
|
|
409
|
+
- **`is_dev`** — automatically `true` in DEBUG builds
|
|
410
|
+
|
|
411
|
+
You do NOT need to manually track app launch, app foreground/background, session start, network type, or device info. These are already covered.
|
|
412
|
+
|
|
391
413
|
## Instrumentation Strategy
|
|
392
414
|
|
|
393
415
|
When instrumenting a new app, follow this priority:
|
|
394
416
|
|
|
395
417
|
**Always instrument (events — no CLI setup needed):**
|
|
396
418
|
- Screen views (`.owlScreen("ScreenName")` on every distinct screen)
|
|
397
|
-
- App launch / cold start (`info` in `init()` or `didFinishLaunching`)
|
|
398
419
|
- Authentication events (login, logout, signup)
|
|
399
420
|
- Caught exceptions (`error` in `catch` blocks, error handlers)
|
|
400
421
|
- Validation failures and pre-checks (`warn` for bad input, missing optional data, fallback paths)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmetry/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "OwlMetry CLI — manage projects, apps, metrics, funnels, and events from the terminal. Includes AI skill files for agent-assisted development.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|