@formant/formant-cli 0.1.0 → 0.3.0
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 +380 -116
- package/dist/base-command.d.ts +5 -0
- package/dist/base-command.js +9 -0
- package/dist/base-command.js.map +1 -1
- package/dist/commands/devices/create.d.ts +13 -0
- package/dist/commands/devices/create.js +62 -0
- package/dist/commands/devices/create.js.map +1 -0
- package/dist/commands/devices/delete.d.ts +10 -0
- package/dist/commands/devices/delete.js +49 -0
- package/dist/commands/devices/delete.js.map +1 -0
- package/dist/commands/devices/rename.d.ts +11 -0
- package/dist/commands/devices/rename.js +42 -0
- package/dist/commands/devices/rename.js.map +1 -0
- package/dist/commands/devices/tag.d.ts +13 -0
- package/dist/commands/devices/tag.js +69 -0
- package/dist/commands/devices/tag.js.map +1 -0
- package/dist/commands/devices/untag.d.ts +13 -0
- package/dist/commands/devices/untag.js +79 -0
- package/dist/commands/devices/untag.js.map +1 -0
- package/dist/commands/ingest/batch.d.ts +21 -0
- package/dist/commands/ingest/batch.js +170 -0
- package/dist/commands/ingest/batch.js.map +1 -0
- package/dist/commands/ingest/bitset.d.ts +15 -0
- package/dist/commands/ingest/bitset.js +128 -0
- package/dist/commands/ingest/bitset.js.map +1 -0
- package/dist/commands/ingest/health.d.ts +15 -0
- package/dist/commands/ingest/health.js +94 -0
- package/dist/commands/ingest/health.js.map +1 -0
- package/dist/commands/ingest/image.d.ts +15 -0
- package/dist/commands/ingest/image.js +99 -0
- package/dist/commands/ingest/image.js.map +1 -0
- package/dist/commands/ingest/json.d.ts +16 -0
- package/dist/commands/ingest/json.js +92 -0
- package/dist/commands/ingest/json.js.map +1 -0
- package/dist/commands/ingest/numeric.d.ts +16 -0
- package/dist/commands/ingest/numeric.js +83 -0
- package/dist/commands/ingest/numeric.js.map +1 -0
- package/dist/commands/ingest/text.d.ts +16 -0
- package/dist/commands/ingest/text.js +80 -0
- package/dist/commands/ingest/text.js.map +1 -0
- package/dist/commands/ingest/video.d.ts +16 -0
- package/dist/commands/ingest/video.js +120 -0
- package/dist/commands/ingest/video.js.map +1 -0
- package/dist/commands/org/get.d.ts +7 -0
- package/dist/commands/org/get.js +54 -0
- package/dist/commands/org/get.js.map +1 -0
- package/dist/commands/org/update.d.ts +11 -0
- package/dist/commands/org/update.js +75 -0
- package/dist/commands/org/update.js.map +1 -0
- package/dist/help.js +103 -53
- package/dist/help.js.map +1 -1
- package/dist/lib/api.d.ts +1 -1
- package/dist/lib/api.js +3 -0
- package/dist/lib/api.js.map +1 -1
- package/oclif.manifest.json +1861 -612
- package/package.json +7 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
export default class IngestText extends BaseCommand {
|
|
4
|
+
static args = {
|
|
5
|
+
value: Args.string({ description: 'Text value to ingest', required: true }),
|
|
6
|
+
};
|
|
7
|
+
static description = `Ingest a text data point to a device stream.
|
|
8
|
+
|
|
9
|
+
Sends a single text/string value to the specified device stream. Text streams are commonly
|
|
10
|
+
used for logs, status messages, error messages, and other string data.`;
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> ingest text "Robot started successfully" --device <device-id> --stream status',
|
|
13
|
+
'<%= config.bin %> ingest text "Error: sensor offline" --device <device-id> --stream errors --tag severity=high',
|
|
14
|
+
'<%= config.bin %> ingest text "Checkpoint A reached" --device <device-id> --stream waypoints',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
device: Flags.string({
|
|
18
|
+
char: 'd',
|
|
19
|
+
description: 'Device ID (UUID)',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
stream: Flags.string({
|
|
23
|
+
char: 's',
|
|
24
|
+
description: 'Stream name',
|
|
25
|
+
required: true,
|
|
26
|
+
}),
|
|
27
|
+
tag: Flags.string({
|
|
28
|
+
char: 't',
|
|
29
|
+
description: 'Tag as key=value where both are strings (can be specified multiple times)',
|
|
30
|
+
multiple: true,
|
|
31
|
+
}),
|
|
32
|
+
timestamp: Flags.string({
|
|
33
|
+
description: 'Unix timestamp in milliseconds (defaults to now)',
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
static summary = 'Ingest text data';
|
|
37
|
+
async run() {
|
|
38
|
+
const textValue = this.args.value;
|
|
39
|
+
// Parse tags
|
|
40
|
+
const tags = {};
|
|
41
|
+
if (this.flags.tag) {
|
|
42
|
+
for (const tag of this.flags.tag) {
|
|
43
|
+
const [key, ...valueParts] = tag.split('=');
|
|
44
|
+
if (!key || valueParts.length === 0) {
|
|
45
|
+
this.error(`Invalid tag format: "${tag}". Must be key=value.`);
|
|
46
|
+
}
|
|
47
|
+
tags[key] = valueParts.join('=');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Parse timestamp
|
|
51
|
+
let timestamp = Date.now();
|
|
52
|
+
if (this.flags.timestamp) {
|
|
53
|
+
timestamp = Number.parseInt(this.flags.timestamp, 10);
|
|
54
|
+
if (Number.isNaN(timestamp) || timestamp <= 0) {
|
|
55
|
+
this.error(`Invalid timestamp: "${this.flags.timestamp}". Must be a positive integer.`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Build request body
|
|
59
|
+
const body = {
|
|
60
|
+
items: [
|
|
61
|
+
{
|
|
62
|
+
deviceId: this.flags.device,
|
|
63
|
+
name: this.flags.stream,
|
|
64
|
+
type: 'text',
|
|
65
|
+
tags,
|
|
66
|
+
points: [[timestamp, textValue]],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
// Send request (expect 204 No Content)
|
|
71
|
+
await this.api('ingest', 'batch', { body, method: 'POST' });
|
|
72
|
+
if (!this.jsonEnabled()) {
|
|
73
|
+
const preview = textValue.length > 50 ? `${textValue.slice(0, 47)}...` : textValue;
|
|
74
|
+
this.log(`\n✓ Ingested text "${preview}" to stream "${this.flags.stream}" on device ${this.flags.device} (${this.env})\n`);
|
|
75
|
+
}
|
|
76
|
+
// Return the request body for --json output
|
|
77
|
+
return body;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/commands/ingest/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACpE,MAAM,CAAU,IAAI,GAAG;QACrB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC1E,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;;uEAGuC,CAAA;IAErE,MAAM,CAAU,QAAQ,GAAG;QACzB,iGAAiG;QACjG,gHAAgH;QAChH,8FAA8F;KAC/F,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,2EAA2E;YACxF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,kDAAkD;SAChE,CAAC;KACH,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,kBAAkB,CAAA;IAEr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MAAM,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;iBACjC;aACF;SACF,CAAA;QAED,uCAAuC;QACvC,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC,CAAA;QAEzD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;YAClF,IAAI,CAAC,GAAG,CACN,sBAAsB,OAAO,gBAAgB,IAAI,CAAC,KAAK,CAAC,MAAM,eAAe,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,GAAG,KAAK,CACjH,CAAA;QACH,CAAC;QAED,4CAA4C;QAC5C,OAAO,IAAI,CAAA;IACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class IngestVideo extends BaseCommand<typeof IngestVideo> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
device: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
stream: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
url: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
duration: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
size: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
tag: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
timestamp: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
static summary: string;
|
|
15
|
+
run(): Promise<Record<string, unknown>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
export default class IngestVideo extends BaseCommand {
|
|
4
|
+
static description = `Ingest a video URL to a device stream.
|
|
5
|
+
|
|
6
|
+
Sends a video reference (by URL) to the specified device stream. The video must be accessible
|
|
7
|
+
via HTTP/HTTPS. You must provide the video duration in milliseconds.
|
|
8
|
+
|
|
9
|
+
Video streams are used for recorded video clips, timelapse videos, event recordings, etc.
|
|
10
|
+
|
|
11
|
+
The MIME type is auto-detected from the file extension (.mp4, .webm, .mov).`;
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> ingest video --device <device-id> --stream recordings --url https://example.com/video.mp4 --duration 5000',
|
|
14
|
+
'<%= config.bin %> ingest video --device <device-id> --stream clips --url https://example.com/clip.webm --duration 3500 --size 2048000',
|
|
15
|
+
'<%= config.bin %> ingest video --device <device-id> --stream event_video --url https://example.com/event.mov --duration 10000 --tag event=collision',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
device: Flags.string({
|
|
19
|
+
char: 'd',
|
|
20
|
+
description: 'Device ID (UUID)',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
stream: Flags.string({
|
|
24
|
+
char: 's',
|
|
25
|
+
description: 'Stream name',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
url: Flags.string({
|
|
29
|
+
char: 'u',
|
|
30
|
+
description: 'Video URL (must be http:// or https://)',
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
duration: Flags.integer({
|
|
34
|
+
description: 'Video duration in milliseconds (required)',
|
|
35
|
+
required: true,
|
|
36
|
+
}),
|
|
37
|
+
size: Flags.integer({
|
|
38
|
+
description: 'Video size in bytes (optional)',
|
|
39
|
+
}),
|
|
40
|
+
tag: Flags.string({
|
|
41
|
+
char: 't',
|
|
42
|
+
description: 'Tag as key=value where both are strings (can be specified multiple times)',
|
|
43
|
+
multiple: true,
|
|
44
|
+
}),
|
|
45
|
+
timestamp: Flags.string({
|
|
46
|
+
description: 'Unix timestamp in milliseconds (defaults to now)',
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
static summary = 'Ingest video data';
|
|
50
|
+
async run() {
|
|
51
|
+
// Validate URL format
|
|
52
|
+
if (!this.flags.url.match(/^https?:\/\//i)) {
|
|
53
|
+
this.error('Video URL must start with http:// or https://');
|
|
54
|
+
}
|
|
55
|
+
// Validate duration
|
|
56
|
+
if (this.flags.duration <= 0) {
|
|
57
|
+
this.error('Video duration must be a positive number (milliseconds)');
|
|
58
|
+
}
|
|
59
|
+
// Auto-detect MIME type from extension
|
|
60
|
+
const urlLower = this.flags.url.toLowerCase();
|
|
61
|
+
let mimeType = 'video/mp4'; // default
|
|
62
|
+
if (urlLower.endsWith('.webm')) {
|
|
63
|
+
mimeType = 'video/webm';
|
|
64
|
+
}
|
|
65
|
+
else if (urlLower.endsWith('.mov')) {
|
|
66
|
+
mimeType = 'video/quicktime';
|
|
67
|
+
}
|
|
68
|
+
// Build video value object
|
|
69
|
+
const videoValue = {
|
|
70
|
+
duration: this.flags.duration,
|
|
71
|
+
mimeType,
|
|
72
|
+
url: this.flags.url,
|
|
73
|
+
};
|
|
74
|
+
if (this.flags.size !== undefined) {
|
|
75
|
+
if (this.flags.size <= 0) {
|
|
76
|
+
this.error('Video size must be a positive number');
|
|
77
|
+
}
|
|
78
|
+
videoValue.size = this.flags.size;
|
|
79
|
+
}
|
|
80
|
+
// Parse tags
|
|
81
|
+
const tags = {};
|
|
82
|
+
if (this.flags.tag) {
|
|
83
|
+
for (const tag of this.flags.tag) {
|
|
84
|
+
const [key, ...valueParts] = tag.split('=');
|
|
85
|
+
if (!key || valueParts.length === 0) {
|
|
86
|
+
this.error(`Invalid tag format: "${tag}". Must be key=value.`);
|
|
87
|
+
}
|
|
88
|
+
tags[key] = valueParts.join('=');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Parse timestamp
|
|
92
|
+
let timestamp = Date.now();
|
|
93
|
+
if (this.flags.timestamp) {
|
|
94
|
+
timestamp = Number.parseInt(this.flags.timestamp, 10);
|
|
95
|
+
if (Number.isNaN(timestamp) || timestamp <= 0) {
|
|
96
|
+
this.error(`Invalid timestamp: "${this.flags.timestamp}". Must be a positive integer.`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Build request body
|
|
100
|
+
const body = {
|
|
101
|
+
items: [
|
|
102
|
+
{
|
|
103
|
+
deviceId: this.flags.device,
|
|
104
|
+
name: this.flags.stream,
|
|
105
|
+
type: 'video',
|
|
106
|
+
tags,
|
|
107
|
+
points: [[timestamp, videoValue]],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
// Send request (expect 204 No Content)
|
|
112
|
+
await this.api('ingest', 'batch', { body, method: 'POST' });
|
|
113
|
+
if (!this.jsonEnabled()) {
|
|
114
|
+
this.log(`\n✓ Ingested video ${this.flags.url} (${this.flags.duration}ms, ${mimeType}) to stream "${this.flags.stream}" on device ${this.flags.device} (${this.env})\n`);
|
|
115
|
+
}
|
|
116
|
+
// Return the request body for --json output
|
|
117
|
+
return body;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/commands/ingest/video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AAEjD,MAAM,CAA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BAAgB,IAAI,CAAC,KAAK,CAAC,MAAM,eAAe,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,GAAG,KAAK,CAC/J,CAAA;QACH,CAAC;QAED,4CAA4C;QAC5C,OAAO,IAAI,CAAA;IACb,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
import { formatDetail } from '../../lib/formatters.js';
|
|
3
|
+
export default class OrgGet extends BaseCommand {
|
|
4
|
+
static description = `Get information about your organization.
|
|
5
|
+
|
|
6
|
+
Displays the organization associated with your authenticated account.
|
|
7
|
+
No ID is needed — it is resolved automatically from your credentials.`;
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> org get',
|
|
10
|
+
'<%= config.bin %> org get --json',
|
|
11
|
+
];
|
|
12
|
+
static summary = 'Get your organization';
|
|
13
|
+
async run() {
|
|
14
|
+
const orgId = await this.getOrgId();
|
|
15
|
+
const org = await this.api('admin', `organizations/${orgId}`, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
});
|
|
18
|
+
if (!this.jsonEnabled()) {
|
|
19
|
+
// Curated view for human output — full object available via --json
|
|
20
|
+
const summary = {
|
|
21
|
+
id: org.id,
|
|
22
|
+
name: org.name,
|
|
23
|
+
description: org.description,
|
|
24
|
+
plan: org.plan,
|
|
25
|
+
industry: org.industry,
|
|
26
|
+
website: org.website,
|
|
27
|
+
enabled: org.enabled,
|
|
28
|
+
onlineSensitivity: org.onlineSensitivity,
|
|
29
|
+
daysDataRetained: org.daysDataRetained,
|
|
30
|
+
supportTier: org.supportTier,
|
|
31
|
+
createdAt: org.createdAt,
|
|
32
|
+
updatedAt: org.updatedAt,
|
|
33
|
+
};
|
|
34
|
+
this.log(`\nOrganization (${this.env}):\n`);
|
|
35
|
+
this.log(formatDetail(summary, {
|
|
36
|
+
createdAt: 'Created',
|
|
37
|
+
daysDataRetained: 'Data Retention (days)',
|
|
38
|
+
description: 'Description',
|
|
39
|
+
enabled: 'Enabled',
|
|
40
|
+
id: 'ID',
|
|
41
|
+
industry: 'Industry',
|
|
42
|
+
name: 'Name',
|
|
43
|
+
onlineSensitivity: 'Online Sensitivity (s)',
|
|
44
|
+
plan: 'Plan',
|
|
45
|
+
supportTier: 'Support Tier',
|
|
46
|
+
updatedAt: 'Updated',
|
|
47
|
+
website: 'Website',
|
|
48
|
+
}));
|
|
49
|
+
this.log('');
|
|
50
|
+
}
|
|
51
|
+
return org;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/org/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAA0B;IAC5D,MAAM,CAAU,WAAW,GAAG;;;sEAGsC,CAAA;IAEpE,MAAM,CAAU,QAAQ,GAAG;QACzB,2BAA2B;QAC3B,kCAAkC;KACnC,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,uBAAuB,CAAA;IAE1C,KAAK,CAAC,GAAG;QACd,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;QAEnC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,iBAAiB,KAAK,EAAE,EAAE;YACrF,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,mEAAmE;YACnE,MAAM,OAAO,GAA4B;gBACvC,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;gBACxC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;gBACtC,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,SAAS,EAAE,GAAG,CAAC,SAAS;aACzB,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,mBAAmB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC3C,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE;gBAC7B,SAAS,EAAE,SAAS;gBACpB,gBAAgB,EAAE,uBAAuB;gBACzC,WAAW,EAAE,aAAa;gBAC1B,OAAO,EAAE,SAAS;gBAClB,EAAE,EAAE,IAAI;gBACR,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,MAAM;gBACZ,iBAAiB,EAAE,wBAAwB;gBAC3C,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,cAAc;gBAC3B,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,SAAS;aACnB,CAAC,CAAC,CAAA;YACH,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,GAAG,CAAA;IACZ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class OrgUpdate extends BaseCommand<typeof OrgUpdate> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static summary: string;
|
|
10
|
+
run(): Promise<Record<string, unknown>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { formatDetail } from '../../lib/formatters.js';
|
|
4
|
+
export default class OrgUpdate extends BaseCommand {
|
|
5
|
+
static description = `Update your organization's details.
|
|
6
|
+
|
|
7
|
+
At least one of --name or --description must be provided.`;
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> org update --name "My Fleet"',
|
|
10
|
+
'<%= config.bin %> org update --description "Production robot fleet"',
|
|
11
|
+
'<%= config.bin %> org update --name "My Fleet" --description "Production robot fleet"',
|
|
12
|
+
'<%= config.bin %> org update --name "My Fleet" --json',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
description: Flags.string({
|
|
16
|
+
char: 'd',
|
|
17
|
+
description: 'New description for the organization',
|
|
18
|
+
}),
|
|
19
|
+
name: Flags.string({
|
|
20
|
+
char: 'n',
|
|
21
|
+
description: 'New name for the organization',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
static summary = 'Update your organization';
|
|
25
|
+
async run() {
|
|
26
|
+
const { description, name } = this.flags;
|
|
27
|
+
if (!name && !description) {
|
|
28
|
+
this.error('Provide at least one of --name or --description.');
|
|
29
|
+
}
|
|
30
|
+
const orgId = await this.getOrgId();
|
|
31
|
+
const body = {};
|
|
32
|
+
if (name)
|
|
33
|
+
body.name = name;
|
|
34
|
+
if (description)
|
|
35
|
+
body.description = description;
|
|
36
|
+
const updated = await this.api('admin', `organizations/${orgId}`, {
|
|
37
|
+
body,
|
|
38
|
+
method: 'PATCH',
|
|
39
|
+
});
|
|
40
|
+
if (!this.jsonEnabled()) {
|
|
41
|
+
const summary = {
|
|
42
|
+
id: updated.id,
|
|
43
|
+
name: updated.name,
|
|
44
|
+
description: updated.description,
|
|
45
|
+
plan: updated.plan,
|
|
46
|
+
industry: updated.industry,
|
|
47
|
+
website: updated.website,
|
|
48
|
+
enabled: updated.enabled,
|
|
49
|
+
onlineSensitivity: updated.onlineSensitivity,
|
|
50
|
+
daysDataRetained: updated.daysDataRetained,
|
|
51
|
+
supportTier: updated.supportTier,
|
|
52
|
+
createdAt: updated.createdAt,
|
|
53
|
+
updatedAt: updated.updatedAt,
|
|
54
|
+
};
|
|
55
|
+
this.log(`\nOrganization Updated (${this.env}):\n`);
|
|
56
|
+
this.log(formatDetail(summary, {
|
|
57
|
+
createdAt: 'Created',
|
|
58
|
+
daysDataRetained: 'Data Retention (days)',
|
|
59
|
+
description: 'Description',
|
|
60
|
+
enabled: 'Enabled',
|
|
61
|
+
id: 'ID',
|
|
62
|
+
industry: 'Industry',
|
|
63
|
+
name: 'Name',
|
|
64
|
+
onlineSensitivity: 'Online Sensitivity (s)',
|
|
65
|
+
plan: 'Plan',
|
|
66
|
+
supportTier: 'Support Tier',
|
|
67
|
+
updatedAt: 'Updated',
|
|
68
|
+
website: 'Website',
|
|
69
|
+
}));
|
|
70
|
+
this.log('');
|
|
71
|
+
}
|
|
72
|
+
return updated;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/org/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAA6B;IAClE,MAAM,CAAU,WAAW,GAAG;;0DAE0B,CAAA;IAExD,MAAM,CAAU,QAAQ,GAAG;QACzB,gDAAgD;QAChD,qEAAqE;QACrE,uFAAuF;QACvF,uDAAuD;KACxD,C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AAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;gBAC1C,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,2BAA2B,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YACnD,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE;gBAC7B,SAAS,EAAE,SAAS;gBACpB,gBAAgB,EAAE,uBAAuB;gBACzC,WAAW,EAAE,aAAa;gBAC1B,OAAO,EAAE,SAAS;gBAClB,EAAE,EAAE,IAAI;gBACR,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,MAAM;gBACZ,iBAAiB,EAAE,wBAAwB;gBAC3C,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,cAAc;gBAC3B,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,SAAS;aACnB,CAAC,CAAC,CAAA;YACH,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC"}
|
package/dist/help.js
CHANGED
|
@@ -9,81 +9,131 @@ export default class FcliHelp extends Help {
|
|
|
9
9
|
██║ ╚██████╗███████╗██║
|
|
10
10
|
╚═╝ ╚═════╝╚══════╝╚═╝
|
|
11
11
|
|
|
12
|
+
ABOUT
|
|
13
|
+
Formant is a cloud platform for monitoring, operating, and analyzing robot fleets.
|
|
14
|
+
This CLI lets you interact with your robots, query telemetry data, trigger AI-powered
|
|
15
|
+
investigations, manage users and permissions, and automate fleet operations — all from
|
|
16
|
+
your terminal.
|
|
17
|
+
|
|
12
18
|
USAGE
|
|
13
19
|
$ fcli <command> [flags]
|
|
14
20
|
|
|
15
|
-
CONCEPTS
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
KEY CONCEPTS
|
|
22
|
+
Organization Your Formant account with users, devices, and settings
|
|
23
|
+
Device A robot, sensor, or IoT device in your fleet that sends telemetry
|
|
24
|
+
Event An important occurrence (alert, warning, error) emitted by a device
|
|
25
|
+
Signal A point of interest that triggers investigation or analysis
|
|
26
|
+
Investigation AI-powered workflow that analyzes device data and diagnoses issues
|
|
27
|
+
Stream Real-time telemetry data (battery, temperature, location, sensors)
|
|
28
|
+
Command Remote instruction sent to a device to perform an action
|
|
29
|
+
Fleet A logical group of devices (by location, type, or tags)
|
|
21
30
|
|
|
22
31
|
COMMANDS
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
org View and update your Formant organization
|
|
33
|
+
devices Create, list, tag, and manage robots/sensors in your fleet
|
|
34
|
+
events View and filter important events emitted by devices
|
|
35
|
+
query Retrieve historical telemetry data and latest sensor values
|
|
36
|
+
ingest Send telemetry data to devices via the Formant ingestion API
|
|
37
|
+
signals List, query, and analyze signals that trigger investigations
|
|
38
|
+
investigations Trigger, monitor, and analyze AI-powered diagnostic workflows
|
|
39
|
+
commands Send remote commands to devices and view command history
|
|
40
|
+
event-triggers Configure rules that automatically generate events and signals
|
|
41
|
+
users List and inspect users in your organization
|
|
42
|
+
fleets Manage device groups and organize your fleet
|
|
43
|
+
schedules Set up recurring tasks and one-time scheduled jobs
|
|
44
|
+
analytics Execute custom SQL queries against your analytics database
|
|
45
|
+
kv Store and retrieve metadata in the key-value store
|
|
35
46
|
help Display help for fcli
|
|
36
47
|
|
|
37
48
|
GLOBAL FLAGS
|
|
38
|
-
--dev Target the dev environment
|
|
39
|
-
--stage Target the stage environment
|
|
40
|
-
--json
|
|
41
|
-
-h, --help Show help for
|
|
49
|
+
--dev Target the dev environment (for testing)
|
|
50
|
+
--stage Target the stage environment (for staging)
|
|
51
|
+
--json Output raw JSON instead of formatted tables
|
|
52
|
+
-h, --help Show help for any command
|
|
42
53
|
|
|
43
54
|
AUTHENTICATION
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
Formant CLI uses service account credentials. Set these environment variables:
|
|
56
|
+
|
|
57
|
+
FORMANT_USER Your service account email (e.g., bot@org.iam.formant.io)
|
|
58
|
+
FORMANT_PASSWORD Your service account password
|
|
59
|
+
|
|
60
|
+
You can also create a .env file in your project directory with these values.
|
|
47
61
|
|
|
48
62
|
EXAMPLES
|
|
49
|
-
#
|
|
50
|
-
$ fcli
|
|
51
|
-
$ fcli
|
|
52
|
-
$ fcli devices config <device-id> --dev
|
|
63
|
+
# Organization management
|
|
64
|
+
$ fcli org get # View your org details
|
|
65
|
+
$ fcli org update --name "Acme Robotics" # Update org name
|
|
53
66
|
|
|
54
|
-
#
|
|
55
|
-
$ fcli
|
|
56
|
-
$ fcli
|
|
67
|
+
# Device management
|
|
68
|
+
$ fcli devices list --online # List all online devices
|
|
69
|
+
$ fcli devices list --tag location=warehouse # Filter by tags
|
|
70
|
+
$ fcli devices create --name "robot-001" # Create a new device
|
|
71
|
+
$ fcli devices tag <device-id> --key env --value prod # Add tags
|
|
72
|
+
$ fcli devices rename <device-id> --name "robot-new" # Rename a device
|
|
57
73
|
|
|
58
|
-
#
|
|
74
|
+
# Telemetry queries
|
|
59
75
|
$ fcli query --device <id> --stream battery_level --start 2026-01-01 --end 2026-01-02
|
|
76
|
+
$ fcli query latest-values --device <id> --stream battery_level
|
|
77
|
+
$ fcli devices streams <device-id> # List available streams
|
|
78
|
+
|
|
79
|
+
# Ingest telemetry data
|
|
80
|
+
$ fcli ingest numeric 42.5 --device <id> --stream battery_level
|
|
81
|
+
$ fcli ingest text "hello" --device <id> --stream status --tag env=prod
|
|
82
|
+
$ fcli ingest health operational --device <id> --stream health_status
|
|
83
|
+
$ fcli ingest batch --file payload.json # Batch ingest from file
|
|
84
|
+
|
|
85
|
+
# Events and monitoring
|
|
86
|
+
$ fcli events list --severity critical --limit 50 # View critical events
|
|
87
|
+
$ fcli events list --device <id> --start 2026-01-01 # Events for one device
|
|
88
|
+
$ fcli events get <event-id> # Get event details
|
|
89
|
+
|
|
90
|
+
# AI investigations
|
|
91
|
+
$ fcli investigations list # List all investigations
|
|
92
|
+
$ fcli investigations trigger <inv-id> <device-id> # Trigger an investigation
|
|
93
|
+
$ fcli investigations runs <inv-id> # View investigation runs
|
|
94
|
+
$ fcli investigations stats --start 2026-01-01 # Get investigation metrics
|
|
95
|
+
|
|
96
|
+
# Signals (investigation triggers)
|
|
97
|
+
$ fcli signals list --start 2026-01-01 --end 2026-02-01
|
|
98
|
+
$ fcli signals query --start 2026-01-01 # Query by time range
|
|
99
|
+
$ fcli signals count # Count signals by type
|
|
100
|
+
$ fcli signals get <signal-id> # Get signal details
|
|
101
|
+
|
|
102
|
+
# Remote commands
|
|
103
|
+
$ fcli commands list # List command templates
|
|
104
|
+
$ fcli commands for-device <device-id> # Commands for one device
|
|
105
|
+
$ fcli commands send <device-id> <template-id> --param speed=10
|
|
106
|
+
$ fcli commands history <device-id> # View command history
|
|
60
107
|
|
|
61
|
-
#
|
|
62
|
-
$ fcli
|
|
63
|
-
$ fcli
|
|
64
|
-
$ fcli signals get <signal-id> --trace --dev
|
|
108
|
+
# Event triggers (automation)
|
|
109
|
+
$ fcli event-triggers list # List all trigger rules
|
|
110
|
+
$ fcli event-triggers get <trigger-id> # View trigger details
|
|
65
111
|
|
|
66
|
-
#
|
|
67
|
-
$ fcli
|
|
68
|
-
$ fcli
|
|
69
|
-
$ fcli
|
|
112
|
+
# User and fleet management
|
|
113
|
+
$ fcli users list # List all users
|
|
114
|
+
$ fcli users get <user-id> # View user details
|
|
115
|
+
$ fcli fleets list # List device groups
|
|
116
|
+
$ fcli fleets get <fleet-id> # View fleet details
|
|
70
117
|
|
|
71
|
-
#
|
|
72
|
-
$ fcli
|
|
73
|
-
$ fcli
|
|
74
|
-
$ fcli commands send <device-id> <template-id> --param speed=5 --dev
|
|
118
|
+
# Analytics and data queries
|
|
119
|
+
$ fcli analytics tables # List available tables
|
|
120
|
+
$ fcli analytics query --sql "SELECT * FROM events LIMIT 10"
|
|
75
121
|
|
|
76
|
-
#
|
|
77
|
-
$ fcli
|
|
78
|
-
$ fcli
|
|
122
|
+
# Metadata storage
|
|
123
|
+
$ fcli kv list <device-id> # List all keys for device
|
|
124
|
+
$ fcli kv get <device-id> <key> # Get a value
|
|
125
|
+
$ fcli kv set <device-id> <key> <value> # Store a value
|
|
79
126
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
127
|
+
TIPS
|
|
128
|
+
• Use --json with any command to get machine-readable output for scripting
|
|
129
|
+
• Pipe output to jq for advanced JSON processing: fcli devices list --json | jq
|
|
130
|
+
• Set --dev or --stage to target non-production environments
|
|
131
|
+
• Use fcli <command> --help to see detailed help for any command
|
|
83
132
|
|
|
84
133
|
LEARN MORE
|
|
85
|
-
|
|
86
|
-
|
|
134
|
+
Documentation: https://formant.io/docs
|
|
135
|
+
Support: support@formant.io
|
|
136
|
+
GitHub: https://github.com/FormantIO/formant-cli
|
|
87
137
|
`;
|
|
88
138
|
this.log(output);
|
|
89
139
|
}
|
package/dist/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,IAAI;IACrB,KAAK,CAAC,YAAY;QACnC,MAAM,MAAM,GAAG;;qDAEkC,IAAI,CAAC,MAAM,CAAC,OAAO
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,IAAI;IACrB,KAAK,CAAC,YAAY;QACnC,MAAM,MAAM,GAAG;;qDAEkC,IAAI,CAAC,MAAM,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIvE,CAAA;QAEG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAClB,CAAC;CACF"}
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Environment } from './config.js';
|
|
2
|
-
export type ApiTarget = 'admin' | 'query' | 'theopolis';
|
|
2
|
+
export type ApiTarget = 'admin' | 'ingest' | 'query' | 'theopolis';
|
|
3
3
|
interface RequestOptions {
|
|
4
4
|
body?: unknown;
|
|
5
5
|
method?: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT';
|
package/dist/lib/api.js
CHANGED
package/dist/lib/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAC,MAAM,aAAa,CAAA;AACrD,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAA;AAU/B,SAAS,YAAY,CAAC,GAAgB,EAAE,MAAiB;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACzB,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,QAAQ,WAAW,CAAA;QACpC,CAAC;QAED,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,QAAQ,aAAa,CAAA;QACtC,CAAC;QAED,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,OAAO,GA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