@owlmetry/cli 0.1.12 → 0.1.13
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
|
@@ -6359,6 +6359,9 @@ var METRIC_PHASES = ["start", "complete", "fail", "cancel", "record"];
|
|
|
6359
6359
|
// ../../packages/shared/dist/audit.js
|
|
6360
6360
|
init_cjs_shims();
|
|
6361
6361
|
|
|
6362
|
+
// ../../packages/shared/dist/time.js
|
|
6363
|
+
init_cjs_shims();
|
|
6364
|
+
|
|
6362
6365
|
// src/commands/apps.ts
|
|
6363
6366
|
var appsCommand = new Command("apps").description("Manage apps");
|
|
6364
6367
|
appsCommand.command("list").description("List apps").option("--project-id <id>", "Filter by project ID").action(async (opts, cmd) => {
|
|
@@ -6492,33 +6495,6 @@ function resolveJsonArray(inline, filePath, opts) {
|
|
|
6492
6495
|
return parsed;
|
|
6493
6496
|
}
|
|
6494
6497
|
|
|
6495
|
-
// src/utils/time.ts
|
|
6496
|
-
init_cjs_shims();
|
|
6497
|
-
var RELATIVE_PATTERN = /^(\d+)([smhdw])$/;
|
|
6498
|
-
var MULTIPLIERS = {
|
|
6499
|
-
s: 1e3,
|
|
6500
|
-
m: 6e4,
|
|
6501
|
-
h: 36e5,
|
|
6502
|
-
d: 864e5,
|
|
6503
|
-
w: 6048e5
|
|
6504
|
-
};
|
|
6505
|
-
function parseTimeInput(input) {
|
|
6506
|
-
const match = input.match(RELATIVE_PATTERN);
|
|
6507
|
-
if (match) {
|
|
6508
|
-
const amount = parseInt(match[1], 10);
|
|
6509
|
-
const unit = match[2];
|
|
6510
|
-
const ms = amount * MULTIPLIERS[unit];
|
|
6511
|
-
return new Date(Date.now() - ms).toISOString();
|
|
6512
|
-
}
|
|
6513
|
-
const date = new Date(input);
|
|
6514
|
-
if (isNaN(date.getTime())) {
|
|
6515
|
-
throw new Error(
|
|
6516
|
-
`Invalid time input: "${input}". Use relative (e.g. 1h, 30m, 7d) or ISO 8601 format.`
|
|
6517
|
-
);
|
|
6518
|
-
}
|
|
6519
|
-
return date.toISOString();
|
|
6520
|
-
}
|
|
6521
|
-
|
|
6522
6498
|
// src/utils/pagination.ts
|
|
6523
6499
|
init_cjs_shims();
|
|
6524
6500
|
function paginationHint(result) {
|
|
@@ -6538,8 +6514,8 @@ var eventsCommand = new Command("events").description("Query events").option("--
|
|
|
6538
6514
|
new Option("--data-mode <mode>", "Data mode: production, development, or all").choices(["production", "development", "all"]).default("production")
|
|
6539
6515
|
).action(async (opts, cmd) => {
|
|
6540
6516
|
const { client, globals } = createClient(cmd);
|
|
6541
|
-
const since = opts.since
|
|
6542
|
-
const until = opts.until
|
|
6517
|
+
const since = opts.since ?? (!opts.until ? "24h" : void 0);
|
|
6518
|
+
const until = opts.until;
|
|
6543
6519
|
const result = await client.queryEvents({
|
|
6544
6520
|
project_id: opts.projectId,
|
|
6545
6521
|
app_id: opts.appId,
|
|
@@ -6797,8 +6773,8 @@ metricsCommand.command("events <slug>").description("Query raw metric events for
|
|
|
6797
6773
|
new Option("--data-mode <mode>", "Data mode: production, development, or all").choices(["production", "development", "all"]).default("production")
|
|
6798
6774
|
).action(async (slug, opts, cmd) => {
|
|
6799
6775
|
const { client, globals } = createClient(cmd);
|
|
6800
|
-
const since = opts.since
|
|
6801
|
-
const until = opts.until
|
|
6776
|
+
const since = opts.since ?? (!opts.until ? "24h" : void 0);
|
|
6777
|
+
const until = opts.until;
|
|
6802
6778
|
const result = await client.queryMetricEvents(slug, opts.projectId, {
|
|
6803
6779
|
phase: opts.phase,
|
|
6804
6780
|
tracking_id: opts.trackingId,
|
|
@@ -6840,7 +6816,7 @@ metricsCommand.command("create").description("Create a new metric definition").r
|
|
|
6840
6816
|
});
|
|
6841
6817
|
output(globals.format, metric, () => formatMetricDetail(metric));
|
|
6842
6818
|
});
|
|
6843
|
-
metricsCommand.command("query <slug>").description("Query metric aggregation").requiredOption("--project-id <id>", "Project ID").option("--since <date>", "Start
|
|
6819
|
+
metricsCommand.command("query <slug>").description("Query metric aggregation").requiredOption("--project-id <id>", "Project ID").option("--since <date>", "Start time (e.g. 1h, 30m, 7d, or ISO 8601)").option("--until <date>", "End time (e.g. 1h, 30m, 7d, or ISO 8601)").option("--app-id <id>", "Filter by app ID").option("--app-version <version>", "Filter by app version").option("--device-model <model>", "Filter by device model").option("--os-version <version>", "Filter by OS version").option("--user-id <id>", "Filter by user ID").option("--environment <env>", "Filter by environment (ios, ipados, macos, android, web, backend)").option("--group-by <field>", "Group by: app_id, app_version, device_model, os_version, environment, time:hour, time:day, time:week").addOption(
|
|
6844
6820
|
new Option("--data-mode <mode>", "Data mode: production, development, or all").choices(["production", "development", "all"]).default("production")
|
|
6845
6821
|
).action(async (slug, opts, cmd) => {
|
|
6846
6822
|
const { client, globals } = createClient(cmd);
|
|
@@ -7010,7 +6986,7 @@ funnelsCommand.command("delete <slug>").description("Delete a funnel definition"
|
|
|
7010
6986
|
await client.deleteFunnel(slug, opts.projectId);
|
|
7011
6987
|
console.log(source_default.green(`Funnel "${slug}" deleted.`));
|
|
7012
6988
|
});
|
|
7013
|
-
funnelsCommand.command("query <slug>").description("Query funnel analytics").requiredOption("--project-id <id>", "Project ID").option("--since <date>", "Start
|
|
6989
|
+
funnelsCommand.command("query <slug>").description("Query funnel analytics").requiredOption("--project-id <id>", "Project ID").option("--since <date>", "Start time (e.g. 1h, 30m, 7d, or ISO 8601)").option("--until <date>", "End time (e.g. 1h, 30m, 7d, or ISO 8601)").option("--open", "Make this an open funnel. In an open funnel, users don't have to complete a previous step in order to be included in a subsequent step.").option("--app-version <version>", "Filter by app version").option("--environment <env>", "Filter by environment (ios, ipados, macos, android, web, backend)").option("--experiment <name:variant>", "Filter by experiment (format: name:variant)").option("--group-by <field>", "Group by: environment, app_version, or experiment:<name>").addOption(
|
|
7014
6990
|
new Option("--data-mode <mode>", "Data mode: production, development, or all").choices(["production", "development", "all"]).default("production")
|
|
7015
6991
|
).action(async (slug, opts, cmd) => {
|
|
7016
6992
|
const { client, globals } = createClient(cmd);
|
|
@@ -7036,15 +7012,13 @@ auditLogCommand.command("list").description("List audit log entries").requiredOp
|
|
|
7036
7012
|
new Option("--limit <n>", "Max entries to return").argParser((v) => parsePositiveInt(v, "--limit"))
|
|
7037
7013
|
).option("--cursor <cursor>", "Pagination cursor").action(async (opts, cmd) => {
|
|
7038
7014
|
const { client, globals } = createClient(cmd);
|
|
7039
|
-
const since = opts.since ? parseTimeInput(opts.since) : void 0;
|
|
7040
|
-
const until = opts.until ? parseTimeInput(opts.until) : void 0;
|
|
7041
7015
|
const result = await client.queryAuditLogs(opts.teamId, {
|
|
7042
7016
|
resource_type: opts.resourceType,
|
|
7043
7017
|
resource_id: opts.resourceId,
|
|
7044
7018
|
actor_id: opts.actorId,
|
|
7045
7019
|
action: opts.action,
|
|
7046
|
-
since,
|
|
7047
|
-
until,
|
|
7020
|
+
since: opts.since,
|
|
7021
|
+
until: opts.until,
|
|
7048
7022
|
cursor: opts.cursor,
|
|
7049
7023
|
limit: opts.limit
|
|
7050
7024
|
});
|
|
@@ -7198,7 +7172,7 @@ var switchCommand = new Command("switch").description("Switch active team profil
|
|
|
7198
7172
|
});
|
|
7199
7173
|
|
|
7200
7174
|
// src/index.ts
|
|
7201
|
-
var program2 = new Command().name("owlmetry").version("0.1.
|
|
7175
|
+
var program2 = new Command().name("owlmetry").version("0.1.13").description("OwlMetry CLI \u2014 query metrics and manage your apps from the terminal").addOption(
|
|
7202
7176
|
new Option("--format <format>", "Output format").choices(["table", "json", "log"]).default("table")
|
|
7203
7177
|
).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
7178
|
program2.addCommand(authCommand);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: owlmetry-cli
|
|
3
|
-
version: 0.1.
|
|
3
|
+
version: 0.1.13
|
|
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
|
|
@@ -164,7 +164,7 @@ owlmetry metrics create --project-id <id> --name <name> --slug <slug> [--lifecyc
|
|
|
164
164
|
owlmetry metrics update <slug> --project-id <id> [--name <name>] [--status active|paused] --format json
|
|
165
165
|
owlmetry metrics delete <slug> --project-id <id>
|
|
166
166
|
owlmetry metrics events <slug> --project-id <id> [--phase <phase>] [--user-id <id>] [--since <time>] [--until <time>] --format json
|
|
167
|
-
owlmetry metrics query <slug> --project-id <id> [--since <
|
|
167
|
+
owlmetry metrics query <slug> --project-id <id> [--since <time>] [--until <time>] [--app-id <id>] [--user-id <id>] [--group-by <field>] --format json
|
|
168
168
|
|
|
169
169
|
# Funnels
|
|
170
170
|
owlmetry funnels list --project-id <id> --format json
|
|
@@ -172,7 +172,7 @@ owlmetry funnels view <slug> --project-id <id> --format json
|
|
|
172
172
|
owlmetry funnels create --project-id <id> --name <name> --slug <slug> --steps-file <path> [--description <desc>] --format json
|
|
173
173
|
owlmetry funnels update <slug> --project-id <id> --steps-file <path> --format json
|
|
174
174
|
owlmetry funnels delete <slug> --project-id <id>
|
|
175
|
-
owlmetry funnels query <slug> --project-id <id> [--since <
|
|
175
|
+
owlmetry funnels query <slug> --project-id <id> [--since <time>] [--until <time>] [--open] [--group-by <field>] --format json
|
|
176
176
|
|
|
177
177
|
# Events
|
|
178
178
|
owlmetry events [--project-id <id>] [--app-id <id>] [--level <level>] [--user-id <id>] [--session-id <id>] [--since <time>] [--limit <n>] --format json
|
|
@@ -317,7 +317,7 @@ There are two ways to look at metric data:
|
|
|
317
317
|
|
|
318
318
|
```bash
|
|
319
319
|
owlmetry metrics events <slug> --project-id <id> [--phase start|complete|fail|cancel|record] [--tracking-id <id>] [--user-id <id>] [--since <time>] [--until <time>] [--environment <env>] [--data-mode <mode>] --format json
|
|
320
|
-
owlmetry metrics query <slug> --project-id <id> [--since <
|
|
320
|
+
owlmetry metrics query <slug> --project-id <id> [--since <time>] [--until <time>] [--app-id <id>] [--app-version <v>] [--environment <env>] [--user-id <id>] [--group-by app_id|app_version|device_model|os_version|environment|time:hour|time:day|time:week] [--data-mode <mode>] --format json
|
|
321
321
|
```
|
|
322
322
|
|
|
323
323
|
### Funnel Analytics
|
|
@@ -325,7 +325,7 @@ owlmetry metrics query <slug> --project-id <id> [--since <date>] [--until <date>
|
|
|
325
325
|
Funnel queries return conversion rates and drop-off between steps. The output shows how many users entered each step and what percentage continued to the next. Use `--group-by` to segment results and compare conversion across environments, app versions, or A/B experiment variants.
|
|
326
326
|
|
|
327
327
|
```bash
|
|
328
|
-
owlmetry funnels query <slug> --project-id <id> [--since <
|
|
328
|
+
owlmetry funnels query <slug> --project-id <id> [--since <time>] [--until <time>] [--open] [--app-version <v>] [--environment <env>] [--experiment <name:variant>] [--group-by environment|app_version|experiment:<name>] [--data-mode <mode>] --format json
|
|
329
329
|
```
|
|
330
330
|
|
|
331
331
|
`--open` = open funnel mode (steps evaluated independently, not sequentially).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmetry/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
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",
|