@formant/formant-cli 0.4.3 → 0.4.4
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/README.md +35 -2
- package/dist/commands/query/index.d.ts +1 -1
- package/dist/commands/query/index.js +20 -6
- package/dist/commands/query/index.js.map +1 -1
- package/oclif.manifest.json +529 -527
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -265,6 +265,18 @@ Retrieve historical telemetry and sensor data.
|
|
|
265
265
|
fcli query --device <device-id> --stream battery_level \
|
|
266
266
|
--start 2026-01-01 --end 2026-01-02
|
|
267
267
|
|
|
268
|
+
# Multiple streams in one query
|
|
269
|
+
fcli query --device <device-id> --stream heat.current --stream power.available \
|
|
270
|
+
--start 2026-02-01 --end 2026-02-20
|
|
271
|
+
|
|
272
|
+
# Multiple devices in one query
|
|
273
|
+
fcli query --device <id1> --device <id2> --stream battery_level \
|
|
274
|
+
--start 2026-02-01 --end 2026-02-20
|
|
275
|
+
|
|
276
|
+
# Aggregated data (downsample to hourly)
|
|
277
|
+
fcli query --device <device-id> --stream temperature \
|
|
278
|
+
--start 2026-01-01 --end 2026-02-01 --aggregate hour
|
|
279
|
+
|
|
268
280
|
# Latest values
|
|
269
281
|
fcli query latest-values --device <device-id> --stream battery_level
|
|
270
282
|
|
|
@@ -486,6 +498,27 @@ spot.localization text data 16962 2026-02-19T2
|
|
|
486
498
|
spot.hand.image custom config — — —
|
|
487
499
|
```
|
|
488
500
|
|
|
501
|
+
```bash
|
|
502
|
+
$ fcli query --device <device-id> --stream heat.current --stream power.available \
|
|
503
|
+
--start 2026-02-01 --end 2026-02-20 --dev
|
|
504
|
+
|
|
505
|
+
Telemetry Data (dev environment):
|
|
506
|
+
|
|
507
|
+
Stream: heat.current (numeric) Device: 01397354-d17a-4b53-ac27-61753de7918c
|
|
508
|
+
Points: 1
|
|
509
|
+
|
|
510
|
+
TIME VALUE
|
|
511
|
+
──────────────────────────────────────────────────────────────────────────────
|
|
512
|
+
2026-02-18T21:15:38.491Z 47
|
|
513
|
+
|
|
514
|
+
Stream: power.available (numeric) Device: 01397354-d17a-4b53-ac27-61753de7918c
|
|
515
|
+
Points: 1
|
|
516
|
+
|
|
517
|
+
TIME VALUE
|
|
518
|
+
──────────────────────────────────────────────────────────────────────────────
|
|
519
|
+
2026-02-18T21:15:38.520Z 72
|
|
520
|
+
```
|
|
521
|
+
|
|
489
522
|
### JSON
|
|
490
523
|
|
|
491
524
|
Machine-readable JSON for scripting and automation:
|
|
@@ -557,8 +590,8 @@ fcli investigation trigger <investigation-id> --input "Device stopped responding
|
|
|
557
590
|
# 3. Check investigation runs
|
|
558
591
|
fcli investigation runs <investigation-id>
|
|
559
592
|
|
|
560
|
-
# 4. Query relevant telemetry
|
|
561
|
-
fcli query --device <device-id> --stream temperature \
|
|
593
|
+
# 4. Query relevant telemetry (multiple streams and/or devices at once)
|
|
594
|
+
fcli query --device <device-id> --stream temperature --stream battery_level \
|
|
562
595
|
--start 2026-02-17T10:00:00Z --end 2026-02-17T12:00:00Z
|
|
563
596
|
```
|
|
564
597
|
|
|
@@ -4,7 +4,7 @@ export default class Query extends BaseCommand<typeof Query> {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
aggregate: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
device: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
device: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
end: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
latest: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -15,6 +15,8 @@ hour, 4 hours, 12 hours, day, week, month, year.`;
|
|
|
15
15
|
static examples = [
|
|
16
16
|
'<%= config.bin %> query --device <id> --stream battery_level --start 2026-01-01 --end 2026-01-02',
|
|
17
17
|
'<%= config.bin %> query --device <id> --stream speed --aggregate hour --start 2026-01-01 --end 2026-02-01',
|
|
18
|
+
'<%= config.bin %> query --device <id> --stream battery_level --stream temperature --start 2026-01-01 --end 2026-01-02',
|
|
19
|
+
'<%= config.bin %> query --device <id1> --device <id2> --stream battery_level --start 2026-01-01 --end 2026-01-02',
|
|
18
20
|
'<%= config.bin %> query --device <id> --stream battery_level --latest',
|
|
19
21
|
'<%= config.bin %> query --device <id> --stream temperature --type numeric --json',
|
|
20
22
|
];
|
|
@@ -25,7 +27,8 @@ hour, 4 hours, 12 hours, day, week, month, year.`;
|
|
|
25
27
|
}),
|
|
26
28
|
device: Flags.string({
|
|
27
29
|
char: 'd',
|
|
28
|
-
description: 'Device ID
|
|
30
|
+
description: 'Device ID(s), can be specified multiple times',
|
|
31
|
+
multiple: true,
|
|
29
32
|
required: true,
|
|
30
33
|
}),
|
|
31
34
|
end: Flags.string({
|
|
@@ -58,7 +61,7 @@ hour, 4 hours, 12 hours, day, week, month, year.`;
|
|
|
58
61
|
this.error('--start and --end are required (unless using --latest).');
|
|
59
62
|
}
|
|
60
63
|
const body = {
|
|
61
|
-
deviceIds:
|
|
64
|
+
deviceIds: this.flags.device,
|
|
62
65
|
names: this.flags.stream,
|
|
63
66
|
};
|
|
64
67
|
if (this.flags.start)
|
|
@@ -90,10 +93,21 @@ hour, 4 hours, 12 hours, day, week, month, year.`;
|
|
|
90
93
|
{ key: 'time', label: 'TIME', width: 28 },
|
|
91
94
|
{ key: 'value', label: 'VALUE', width: 50 },
|
|
92
95
|
];
|
|
93
|
-
const rows = points.map((p) =>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
const rows = points.map((p) => {
|
|
97
|
+
// Points can be [timestamp_ms, value] tuples or {time, value} objects
|
|
98
|
+
if (Array.isArray(p)) {
|
|
99
|
+
const [ts, val] = p;
|
|
100
|
+
return {
|
|
101
|
+
time: new Date(ts).toISOString(),
|
|
102
|
+
value: typeof val === 'object' ? JSON.stringify(val) : val,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const obj = p;
|
|
106
|
+
return {
|
|
107
|
+
time: obj.time,
|
|
108
|
+
value: typeof obj.value === 'object' ? JSON.stringify(obj.value) : obj.value,
|
|
109
|
+
};
|
|
110
|
+
});
|
|
97
111
|
this.log(formatTable(rows, columns));
|
|
98
112
|
this.log('');
|
|
99
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAyB;IAC1D,MAAM,CAAU,WAAW,GAAG;;;;;;;;;iDASiB,CAAA;IAE/C,MAAM,CAAU,QAAQ,GAAG;QACzB,kGAAkG;QAClG,2GAA2G;QAC3G,uEAAuE;QACvE,kFAAkF;KACnF,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;YACtB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,oCAAoC;SAClD,CAAC;QACF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAA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