@primitivedotdev/sdk 0.17.0 → 0.18.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/dist/oclif/api-command.js +132 -88
- package/dist/oclif/commands/emails-latest.js +39 -34
- package/dist/oclif/commands/send.js +36 -31
- package/dist/oclif/commands/whoami.js +36 -31
- package/oclif.manifest.json +217 -1
- package/package.json +1 -1
|
@@ -302,6 +302,45 @@ export function writeErrorWithHints(payload) {
|
|
|
302
302
|
process.stderr.write(`${ERROR_CODE_HINTS[code]}\n`);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
+
// Format milliseconds as a short human-readable wall-clock duration.
|
|
306
|
+
// Sub-second uses 2 decimal places (e.g. `0.18s`); seconds use 2
|
|
307
|
+
// decimals up to 60s (`12.34s`); minute-plus uses `Mm SS.SSs`.
|
|
308
|
+
// Display-only; the underlying ms value is what the caller computed.
|
|
309
|
+
export function formatElapsed(ms) {
|
|
310
|
+
const seconds = ms / 1000;
|
|
311
|
+
if (seconds < 60)
|
|
312
|
+
return `${seconds.toFixed(2)}s`;
|
|
313
|
+
const minutes = Math.floor(seconds / 60);
|
|
314
|
+
const rem = seconds - minutes * 60;
|
|
315
|
+
return `${minutes}m ${rem.toFixed(2)}s`;
|
|
316
|
+
}
|
|
317
|
+
// Run `fn` and, when `enabled` is true, write a one-line wall-clock
|
|
318
|
+
// timing report to stderr after it completes. Stderr keeps the row
|
|
319
|
+
// data on stdout grep/jq-friendly. The timer captures the full
|
|
320
|
+
// duration of the function (HTTPS round trip, server-side gate +
|
|
321
|
+
// agent + delivery, polling, etc.), not just the API call's
|
|
322
|
+
// server-side processing.
|
|
323
|
+
//
|
|
324
|
+
// Used by every `--time` callsite across the CLI: generated
|
|
325
|
+
// operation commands and hand-coded shortcuts (send, whoami,
|
|
326
|
+
// emails:latest, describe). Pulled out as a helper so timing is
|
|
327
|
+
// uniform across commands and a single render-format change
|
|
328
|
+
// propagates everywhere.
|
|
329
|
+
export async function runWithTiming(enabled, fn) {
|
|
330
|
+
if (!enabled)
|
|
331
|
+
return fn();
|
|
332
|
+
const start = Date.now();
|
|
333
|
+
try {
|
|
334
|
+
return await fn();
|
|
335
|
+
}
|
|
336
|
+
finally {
|
|
337
|
+
process.stderr.write(`[time: ${formatElapsed(Date.now() - start)}]\n`);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
// Shared `--time` flag definition every CLI command spreads into its
|
|
341
|
+
// own static flags. Lives here so the flag's description and short
|
|
342
|
+
// name stay consistent across the hand-coded and generated commands.
|
|
343
|
+
export const TIME_FLAG_DESCRIPTION = "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.";
|
|
305
344
|
// Reserved flag names the body-field expander must never overwrite.
|
|
306
345
|
// `--raw-body` and `--body-file` are the JSON escape hatches.
|
|
307
346
|
// `--api-key`, `--base-url`, `--output` are infra. Path and query
|
|
@@ -363,6 +402,9 @@ function buildFlags(operation) {
|
|
|
363
402
|
description: "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
364
403
|
env: "PRIMITIVE_API_URL",
|
|
365
404
|
}),
|
|
405
|
+
time: Flags.boolean({
|
|
406
|
+
description: TIME_FLAG_DESCRIPTION,
|
|
407
|
+
}),
|
|
366
408
|
};
|
|
367
409
|
for (const parameter of [...operation.pathParams, ...operation.queryParams]) {
|
|
368
410
|
flags[flagName(parameter.name)] = flagForParameter(parameter);
|
|
@@ -460,101 +502,103 @@ export function createOperationCommand(operation) {
|
|
|
460
502
|
async run() {
|
|
461
503
|
const { flags } = await this.parse(OperationCommand);
|
|
462
504
|
const parsedFlags = flags;
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
if (
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
505
|
+
await runWithTiming(parsedFlags.time === true, async () => {
|
|
506
|
+
const apiClient = new PrimitiveApiClient({
|
|
507
|
+
apiKey: typeof parsedFlags["api-key"] === "string"
|
|
508
|
+
? parsedFlags["api-key"]
|
|
509
|
+
: undefined,
|
|
510
|
+
baseUrl: typeof parsedFlags["base-url"] === "string"
|
|
511
|
+
? parsedFlags["base-url"]
|
|
512
|
+
: undefined,
|
|
513
|
+
});
|
|
514
|
+
// Two body sources, merged: explicit JSON via --body /
|
|
515
|
+
// --body-file (the base) plus per-field flags (the
|
|
516
|
+
// overrides). Per-field flag values take precedence on key
|
|
517
|
+
// conflicts so a caller can pass a base payload via --body
|
|
518
|
+
// and override one field on the command line.
|
|
519
|
+
let body;
|
|
520
|
+
if (operation.hasJsonBody) {
|
|
521
|
+
const explicit = readJsonBody(parsedFlags);
|
|
522
|
+
const overrides = collectBodyFieldFlags(parsedFlags, bodyFieldFlagToProperty);
|
|
523
|
+
if (Object.keys(overrides).length > 0) {
|
|
524
|
+
if (explicit === undefined) {
|
|
525
|
+
body = overrides;
|
|
526
|
+
}
|
|
527
|
+
else if (explicit !== null &&
|
|
528
|
+
typeof explicit === "object" &&
|
|
529
|
+
!Array.isArray(explicit)) {
|
|
530
|
+
body = { ...explicit, ...overrides };
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
// Caller passed --raw-body as null, an array, or a
|
|
534
|
+
// primitive AND also passed per-field flags. We can't
|
|
535
|
+
// merge per-field overrides into a non-object body
|
|
536
|
+
// shape, and silently dropping either source would
|
|
537
|
+
// leave the caller's actual intent unclear. Refuse
|
|
538
|
+
// loudly so the next attempt is unambiguous.
|
|
539
|
+
const explicitKind = explicit === null
|
|
540
|
+
? "null"
|
|
541
|
+
: Array.isArray(explicit)
|
|
542
|
+
? "array"
|
|
543
|
+
: typeof explicit;
|
|
544
|
+
const overrideFlags = Object.keys(overrides)
|
|
545
|
+
.map((p) => `--${flagName(p)}`)
|
|
546
|
+
.join(", ");
|
|
547
|
+
throw new Errors.CLIError(`--raw-body must be a JSON object when also passing per-field flags (got ${explicitKind}); supplied per-field flags: ${overrideFlags}. Either drop --raw-body and rely on the per-field flags, or move every field into the JSON --raw-body and drop the flags.`);
|
|
548
|
+
}
|
|
488
549
|
}
|
|
489
550
|
else {
|
|
490
|
-
|
|
491
|
-
// primitive AND also passed per-field flags. We can't
|
|
492
|
-
// merge per-field overrides into a non-object body
|
|
493
|
-
// shape, and silently dropping either source would
|
|
494
|
-
// leave the caller's actual intent unclear. Refuse
|
|
495
|
-
// loudly so the next attempt is unambiguous.
|
|
496
|
-
const explicitKind = explicit === null
|
|
497
|
-
? "null"
|
|
498
|
-
: Array.isArray(explicit)
|
|
499
|
-
? "array"
|
|
500
|
-
: typeof explicit;
|
|
501
|
-
const overrideFlags = Object.keys(overrides)
|
|
502
|
-
.map((p) => `--${flagName(p)}`)
|
|
503
|
-
.join(", ");
|
|
504
|
-
throw new Errors.CLIError(`--raw-body must be a JSON object when also passing per-field flags (got ${explicitKind}); supplied per-field flags: ${overrideFlags}. Either drop --raw-body and rely on the per-field flags, or move every field into the JSON --raw-body and drop the flags.`);
|
|
551
|
+
body = explicit;
|
|
505
552
|
}
|
|
506
553
|
}
|
|
507
|
-
|
|
508
|
-
body
|
|
554
|
+
if (operation.bodyRequired && body === undefined) {
|
|
555
|
+
throw new Errors.CLIError(`Operation ${operation.operationId} requires a body. Pass each field as a --flag (see --help) or supply JSON via --raw-body / --body-file.`);
|
|
509
556
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
});
|
|
523
|
-
if (result.error) {
|
|
524
|
-
writeErrorWithHints(extractErrorPayload(result.error));
|
|
525
|
-
process.exitCode = 1;
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
if (operation.binaryResponse) {
|
|
529
|
-
const blob = result.data;
|
|
530
|
-
const bytes = Buffer.from(await blob.arrayBuffer());
|
|
531
|
-
const output = parsedFlags.output;
|
|
532
|
-
if (typeof output === "string") {
|
|
533
|
-
writeFileSync(output, bytes);
|
|
557
|
+
const operationFn = operations[operation.sdkName];
|
|
558
|
+
const result = await operationFn({
|
|
559
|
+
body,
|
|
560
|
+
client: apiClient.client,
|
|
561
|
+
parseAs: operation.binaryResponse ? "blob" : "auto",
|
|
562
|
+
path: collectValues(operation.pathParams, parsedFlags),
|
|
563
|
+
query: collectValues(operation.queryParams, parsedFlags),
|
|
564
|
+
responseStyle: "fields",
|
|
565
|
+
});
|
|
566
|
+
if (result.error) {
|
|
567
|
+
writeErrorWithHints(extractErrorPayload(result.error));
|
|
568
|
+
process.exitCode = 1;
|
|
534
569
|
return;
|
|
535
570
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
571
|
+
if (operation.binaryResponse) {
|
|
572
|
+
const blob = result.data;
|
|
573
|
+
const bytes = Buffer.from(await blob.arrayBuffer());
|
|
574
|
+
const output = parsedFlags.output;
|
|
575
|
+
if (typeof output === "string") {
|
|
576
|
+
writeFileSync(output, bytes);
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
process.stdout.write(bytes);
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const envelope = result.data;
|
|
583
|
+
const cursor = envelope?.meta?.cursor;
|
|
584
|
+
if (cursor) {
|
|
585
|
+
process.stderr.write(`next cursor: ${cursor}\n`);
|
|
586
|
+
}
|
|
587
|
+
// Empty-result hint. When a list-style operation returns
|
|
588
|
+
// an empty array, emit an operation-specific note to
|
|
589
|
+
// stderr so a naive caller can distinguish "nothing here"
|
|
590
|
+
// from "something isn't set up." Stdout still gets the
|
|
591
|
+
// raw `[]` so machine-readable output is unchanged. The
|
|
592
|
+
// AGX walkthrough flagged this: `list-deliveries` returning
|
|
593
|
+
// `[]` left the agent unsure whether they had an empty
|
|
594
|
+
// delivery log or no endpoints configured at all.
|
|
595
|
+
if (Array.isArray(envelope?.data) && envelope.data.length === 0) {
|
|
596
|
+
const hint = EMPTY_RESULT_HINTS[operation.sdkName];
|
|
597
|
+
if (hint)
|
|
598
|
+
process.stderr.write(`${hint}\n`);
|
|
599
|
+
}
|
|
600
|
+
this.log(JSON.stringify(envelope?.data ?? null, null, 2));
|
|
601
|
+
});
|
|
558
602
|
}
|
|
559
603
|
}
|
|
560
604
|
return OperationCommand;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Flags } from "@oclif/core";
|
|
2
2
|
import { listEmails } from "../../api/generated/sdk.gen.js";
|
|
3
3
|
import { PrimitiveApiClient } from "../../api/index.js";
|
|
4
|
-
import { extractErrorPayload, writeErrorWithHints } from "../api-command.js";
|
|
4
|
+
import { extractErrorPayload, runWithTiming, TIME_FLAG_DESCRIPTION, writeErrorWithHints, } from "../api-command.js";
|
|
5
5
|
// `primitive emails:latest` is the agent-grade shortcut for "show me
|
|
6
6
|
// the most recent inbound emails as something I can read at a glance."
|
|
7
7
|
// `emails:list-emails` returns the full JSON envelope which is great
|
|
@@ -113,43 +113,48 @@ class EmailsLatestCommand extends Command {
|
|
|
113
113
|
json: Flags.boolean({
|
|
114
114
|
description: "Print the raw response envelope (with full UUIDs and meta) as JSON on STDOUT instead of the text table. Useful for piping into `jq`, capturing ids for follow-up commands, or scripting.",
|
|
115
115
|
}),
|
|
116
|
+
time: Flags.boolean({
|
|
117
|
+
description: TIME_FLAG_DESCRIPTION,
|
|
118
|
+
}),
|
|
116
119
|
};
|
|
117
120
|
async run() {
|
|
118
121
|
const { flags } = await this.parse(EmailsLatestCommand);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
await runWithTiming(flags.time, async () => {
|
|
123
|
+
const apiClient = new PrimitiveApiClient({
|
|
124
|
+
apiKey: flags["api-key"],
|
|
125
|
+
baseUrl: flags["base-url"],
|
|
126
|
+
});
|
|
127
|
+
const result = await listEmails({
|
|
128
|
+
client: apiClient.client,
|
|
129
|
+
query: { limit: flags.limit },
|
|
130
|
+
responseStyle: "fields",
|
|
131
|
+
});
|
|
132
|
+
if (result.error) {
|
|
133
|
+
writeErrorWithHints(extractErrorPayload(result.error));
|
|
134
|
+
process.exitCode = 1;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const envelope = result.data;
|
|
138
|
+
if (flags.json) {
|
|
139
|
+
// Raw envelope on stdout. Mirrors the shape `emails:list-emails`
|
|
140
|
+
// emits so callers can swap one for the other when they want
|
|
141
|
+
// table vs json without remembering different command names.
|
|
142
|
+
this.log(JSON.stringify(envelope ?? null, null, 2));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const rows = envelope?.data ?? [];
|
|
146
|
+
if (rows.length === 0) {
|
|
147
|
+
process.stderr.write("No inbound emails yet. Send an email to one of your verified domains to populate this list.\n");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const idWidth = pickIdWidth(Boolean(process.stdout.isTTY));
|
|
151
|
+
// Header on stderr so the table itself stays grep-friendly.
|
|
152
|
+
const header = `${"ID".padEnd(idWidth)} ${"RECEIVED (UTC)".padEnd(RECEIVED_DISPLAY_WIDTH)} ${"FROM".padEnd(ADDRESS_DISPLAY_WIDTH)} ${"TO".padEnd(ADDRESS_DISPLAY_WIDTH)} SUBJECT`;
|
|
153
|
+
process.stderr.write(`${header}\n`);
|
|
154
|
+
for (const row of rows) {
|
|
155
|
+
this.log(formatRow(row, idWidth));
|
|
156
|
+
}
|
|
127
157
|
});
|
|
128
|
-
if (result.error) {
|
|
129
|
-
writeErrorWithHints(extractErrorPayload(result.error));
|
|
130
|
-
process.exitCode = 1;
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const envelope = result.data;
|
|
134
|
-
if (flags.json) {
|
|
135
|
-
// Raw envelope on stdout. Mirrors the shape `emails:list-emails`
|
|
136
|
-
// emits so callers can swap one for the other when they want
|
|
137
|
-
// table vs json without remembering different command names.
|
|
138
|
-
this.log(JSON.stringify(envelope ?? null, null, 2));
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const rows = envelope?.data ?? [];
|
|
142
|
-
if (rows.length === 0) {
|
|
143
|
-
process.stderr.write("No inbound emails yet. Send an email to one of your verified domains to populate this list.\n");
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const idWidth = pickIdWidth(Boolean(process.stdout.isTTY));
|
|
147
|
-
// Header on stderr so the table itself stays grep-friendly.
|
|
148
|
-
const header = `${"ID".padEnd(idWidth)} ${"RECEIVED (UTC)".padEnd(RECEIVED_DISPLAY_WIDTH)} ${"FROM".padEnd(ADDRESS_DISPLAY_WIDTH)} ${"TO".padEnd(ADDRESS_DISPLAY_WIDTH)} SUBJECT`;
|
|
149
|
-
process.stderr.write(`${header}\n`);
|
|
150
|
-
for (const row of rows) {
|
|
151
|
-
this.log(formatRow(row, idWidth));
|
|
152
|
-
}
|
|
153
158
|
}
|
|
154
159
|
}
|
|
155
160
|
export default EmailsLatestCommand;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Errors, Flags } from "@oclif/core";
|
|
2
2
|
import { listDomains, sendEmail } from "../../api/generated/sdk.gen.js";
|
|
3
3
|
import { PrimitiveApiClient } from "../../api/index.js";
|
|
4
|
-
import { extractErrorCode, extractErrorPayload, formatErrorPayload, writeErrorWithHints, } from "../api-command.js";
|
|
4
|
+
import { extractErrorCode, extractErrorPayload, formatErrorPayload, runWithTiming, TIME_FLAG_DESCRIPTION, writeErrorWithHints, } from "../api-command.js";
|
|
5
5
|
// `primitive send` is the agent-grade shortcut for the most common
|
|
6
6
|
// case: send a fresh outbound email. It wraps `sending:send-email`
|
|
7
7
|
// with two ergonomic defaults that the underlying operation can't
|
|
@@ -139,43 +139,48 @@ class SendCommand extends Command {
|
|
|
139
139
|
"wait-timeout-ms": Flags.integer({
|
|
140
140
|
description: "Maximum time to wait when --wait is set. Defaults to 30000ms.",
|
|
141
141
|
}),
|
|
142
|
+
time: Flags.boolean({
|
|
143
|
+
description: TIME_FLAG_DESCRIPTION,
|
|
144
|
+
}),
|
|
142
145
|
};
|
|
143
146
|
async run() {
|
|
144
147
|
const { flags } = await this.parse(SendCommand);
|
|
145
148
|
if (!flags.body && !flags.html) {
|
|
146
149
|
throw new Errors.CLIError("Either --body or --html (or both) is required.");
|
|
147
150
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
151
|
+
await runWithTiming(flags.time, async () => {
|
|
152
|
+
const apiClient = new PrimitiveApiClient({
|
|
153
|
+
apiKey: flags["api-key"],
|
|
154
|
+
baseUrl: flags["base-url"],
|
|
155
|
+
});
|
|
156
|
+
const from = flags.from ?? (await pickDefaultFromAddress(apiClient));
|
|
157
|
+
const subject = flags.subject ?? (flags.body ? deriveSubject(flags.body) : "Message");
|
|
158
|
+
const result = await sendEmail({
|
|
159
|
+
body: {
|
|
160
|
+
from,
|
|
161
|
+
to: flags.to,
|
|
162
|
+
subject,
|
|
163
|
+
...(flags.body !== undefined ? { body_text: flags.body } : {}),
|
|
164
|
+
...(flags.html !== undefined ? { body_html: flags.html } : {}),
|
|
165
|
+
...(flags["in-reply-to"] !== undefined
|
|
166
|
+
? { in_reply_to: flags["in-reply-to"] }
|
|
167
|
+
: {}),
|
|
168
|
+
...(flags.wait !== undefined ? { wait: flags.wait } : {}),
|
|
169
|
+
...(flags["wait-timeout-ms"] !== undefined
|
|
170
|
+
? { wait_timeout_ms: flags["wait-timeout-ms"] }
|
|
171
|
+
: {}),
|
|
172
|
+
},
|
|
173
|
+
client: apiClient.client,
|
|
174
|
+
responseStyle: "fields",
|
|
175
|
+
});
|
|
176
|
+
if (result.error) {
|
|
177
|
+
writeErrorWithHints(extractErrorPayload(result.error));
|
|
178
|
+
process.exitCode = 1;
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const envelope = result.data;
|
|
182
|
+
this.log(JSON.stringify(envelope?.data ?? null, null, 2));
|
|
171
183
|
});
|
|
172
|
-
if (result.error) {
|
|
173
|
-
writeErrorWithHints(extractErrorPayload(result.error));
|
|
174
|
-
process.exitCode = 1;
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
const envelope = result.data;
|
|
178
|
-
this.log(JSON.stringify(envelope?.data ?? null, null, 2));
|
|
179
184
|
}
|
|
180
185
|
}
|
|
181
186
|
export default SendCommand;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Errors, Flags } from "@oclif/core";
|
|
2
2
|
import { getAccount } from "../../api/generated/sdk.gen.js";
|
|
3
3
|
import { PrimitiveApiClient } from "../../api/index.js";
|
|
4
|
-
import { extractErrorPayload, writeErrorWithHints } from "../api-command.js";
|
|
4
|
+
import { extractErrorPayload, runWithTiming, TIME_FLAG_DESCRIPTION, writeErrorWithHints, } from "../api-command.js";
|
|
5
5
|
// `primitive whoami` is the credentials smoke-test the AGX
|
|
6
6
|
// walkthrough kept asking for. Before this command, a user with a
|
|
7
7
|
// suspect API key had no fast way to verify "is my key live and
|
|
@@ -28,40 +28,45 @@ class WhoamiCommand extends Command {
|
|
|
28
28
|
description: "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
29
29
|
env: "PRIMITIVE_API_URL",
|
|
30
30
|
}),
|
|
31
|
+
time: Flags.boolean({
|
|
32
|
+
description: TIME_FLAG_DESCRIPTION,
|
|
33
|
+
}),
|
|
31
34
|
};
|
|
32
35
|
async run() {
|
|
33
36
|
const { flags } = await this.parse(WhoamiCommand);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
await runWithTiming(flags.time, async () => {
|
|
38
|
+
const apiClient = new PrimitiveApiClient({
|
|
39
|
+
apiKey: flags["api-key"],
|
|
40
|
+
baseUrl: flags["base-url"],
|
|
41
|
+
});
|
|
42
|
+
const result = await getAccount({
|
|
43
|
+
client: apiClient.client,
|
|
44
|
+
responseStyle: "fields",
|
|
45
|
+
});
|
|
46
|
+
if (result.error) {
|
|
47
|
+
writeErrorWithHints(extractErrorPayload(result.error));
|
|
48
|
+
process.exitCode = 1;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const envelope = result.data;
|
|
52
|
+
const account = envelope?.data;
|
|
53
|
+
if (!account) {
|
|
54
|
+
process.stderr.write("Server returned an empty account body; this should not happen for a valid key.\n");
|
|
55
|
+
throw new Errors.CLIError("unexpected empty response");
|
|
56
|
+
}
|
|
57
|
+
// Concise human-readable summary on stderr; the full account
|
|
58
|
+
// JSON goes to stdout so a script can pipe it.
|
|
59
|
+
const onboarding = account.onboarding_completed === true
|
|
60
|
+
? "complete"
|
|
61
|
+
: account.onboarding_step
|
|
62
|
+
? `in progress (step: ${account.onboarding_step})`
|
|
63
|
+
: "incomplete";
|
|
64
|
+
process.stderr.write(`Authenticated as ${account.email}\n`);
|
|
65
|
+
process.stderr.write(` Account id: ${account.id}\n`);
|
|
66
|
+
process.stderr.write(` Plan: ${account.plan}\n`);
|
|
67
|
+
process.stderr.write(` Onboarding: ${onboarding}\n`);
|
|
68
|
+
this.log(JSON.stringify(account, null, 2));
|
|
41
69
|
});
|
|
42
|
-
if (result.error) {
|
|
43
|
-
writeErrorWithHints(extractErrorPayload(result.error));
|
|
44
|
-
process.exitCode = 1;
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const envelope = result.data;
|
|
48
|
-
const account = envelope?.data;
|
|
49
|
-
if (!account) {
|
|
50
|
-
process.stderr.write("Server returned an empty account body; this should not happen for a valid key.\n");
|
|
51
|
-
throw new Errors.CLIError("unexpected empty response");
|
|
52
|
-
}
|
|
53
|
-
// Concise human-readable summary on stderr; the full account
|
|
54
|
-
// JSON goes to stdout so a script can pipe it.
|
|
55
|
-
const onboarding = account.onboarding_completed === true
|
|
56
|
-
? "complete"
|
|
57
|
-
: account.onboarding_step
|
|
58
|
-
? `in progress (step: ${account.onboarding_step})`
|
|
59
|
-
: "incomplete";
|
|
60
|
-
process.stderr.write(`Authenticated as ${account.email}\n`);
|
|
61
|
-
process.stderr.write(` Account id: ${account.id}\n`);
|
|
62
|
-
process.stderr.write(` Plan: ${account.plan}\n`);
|
|
63
|
-
process.stderr.write(` Onboarding: ${onboarding}\n`);
|
|
64
|
-
this.log(JSON.stringify(account, null, 2));
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
export default WhoamiCommand;
|
package/oclif.manifest.json
CHANGED
|
@@ -150,6 +150,12 @@
|
|
|
150
150
|
"hasDynamicHelp": false,
|
|
151
151
|
"multiple": false,
|
|
152
152
|
"type": "option"
|
|
153
|
+
},
|
|
154
|
+
"time": {
|
|
155
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
156
|
+
"name": "time",
|
|
157
|
+
"allowNo": false,
|
|
158
|
+
"type": "boolean"
|
|
153
159
|
}
|
|
154
160
|
},
|
|
155
161
|
"hasDynamicHelp": false,
|
|
@@ -186,6 +192,12 @@
|
|
|
186
192
|
"hasDynamicHelp": false,
|
|
187
193
|
"multiple": false,
|
|
188
194
|
"type": "option"
|
|
195
|
+
},
|
|
196
|
+
"time": {
|
|
197
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
198
|
+
"name": "time",
|
|
199
|
+
"allowNo": false,
|
|
200
|
+
"type": "boolean"
|
|
189
201
|
}
|
|
190
202
|
},
|
|
191
203
|
"hasDynamicHelp": false,
|
|
@@ -238,6 +250,12 @@
|
|
|
238
250
|
"name": "json",
|
|
239
251
|
"allowNo": false,
|
|
240
252
|
"type": "boolean"
|
|
253
|
+
},
|
|
254
|
+
"time": {
|
|
255
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
256
|
+
"name": "time",
|
|
257
|
+
"allowNo": false,
|
|
258
|
+
"type": "boolean"
|
|
241
259
|
}
|
|
242
260
|
},
|
|
243
261
|
"hasDynamicHelp": false,
|
|
@@ -270,6 +288,12 @@
|
|
|
270
288
|
"hasDynamicHelp": false,
|
|
271
289
|
"multiple": false,
|
|
272
290
|
"type": "option"
|
|
291
|
+
},
|
|
292
|
+
"time": {
|
|
293
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
294
|
+
"name": "time",
|
|
295
|
+
"allowNo": false,
|
|
296
|
+
"type": "boolean"
|
|
273
297
|
}
|
|
274
298
|
},
|
|
275
299
|
"hasDynamicHelp": false,
|
|
@@ -302,6 +326,12 @@
|
|
|
302
326
|
"hasDynamicHelp": false,
|
|
303
327
|
"multiple": false,
|
|
304
328
|
"type": "option"
|
|
329
|
+
},
|
|
330
|
+
"time": {
|
|
331
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
332
|
+
"name": "time",
|
|
333
|
+
"allowNo": false,
|
|
334
|
+
"type": "boolean"
|
|
305
335
|
}
|
|
306
336
|
},
|
|
307
337
|
"hasDynamicHelp": false,
|
|
@@ -334,6 +364,12 @@
|
|
|
334
364
|
"hasDynamicHelp": false,
|
|
335
365
|
"multiple": false,
|
|
336
366
|
"type": "option"
|
|
367
|
+
},
|
|
368
|
+
"time": {
|
|
369
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
370
|
+
"name": "time",
|
|
371
|
+
"allowNo": false,
|
|
372
|
+
"type": "boolean"
|
|
337
373
|
}
|
|
338
374
|
},
|
|
339
375
|
"hasDynamicHelp": false,
|
|
@@ -366,6 +402,12 @@
|
|
|
366
402
|
"hasDynamicHelp": false,
|
|
367
403
|
"multiple": false,
|
|
368
404
|
"type": "option"
|
|
405
|
+
},
|
|
406
|
+
"time": {
|
|
407
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
408
|
+
"name": "time",
|
|
409
|
+
"allowNo": false,
|
|
410
|
+
"type": "boolean"
|
|
369
411
|
}
|
|
370
412
|
},
|
|
371
413
|
"hasDynamicHelp": false,
|
|
@@ -399,6 +441,12 @@
|
|
|
399
441
|
"multiple": false,
|
|
400
442
|
"type": "option"
|
|
401
443
|
},
|
|
444
|
+
"time": {
|
|
445
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
446
|
+
"name": "time",
|
|
447
|
+
"allowNo": false,
|
|
448
|
+
"type": "boolean"
|
|
449
|
+
},
|
|
402
450
|
"raw-body": {
|
|
403
451
|
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
404
452
|
"name": "raw-body",
|
|
@@ -458,6 +506,12 @@
|
|
|
458
506
|
"multiple": false,
|
|
459
507
|
"type": "option"
|
|
460
508
|
},
|
|
509
|
+
"time": {
|
|
510
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
511
|
+
"name": "time",
|
|
512
|
+
"allowNo": false,
|
|
513
|
+
"type": "boolean"
|
|
514
|
+
},
|
|
461
515
|
"raw-body": {
|
|
462
516
|
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
463
517
|
"name": "raw-body",
|
|
@@ -511,6 +565,12 @@
|
|
|
511
565
|
"multiple": false,
|
|
512
566
|
"type": "option"
|
|
513
567
|
},
|
|
568
|
+
"time": {
|
|
569
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
570
|
+
"name": "time",
|
|
571
|
+
"allowNo": false,
|
|
572
|
+
"type": "boolean"
|
|
573
|
+
},
|
|
514
574
|
"id": {
|
|
515
575
|
"description": "Resource UUID",
|
|
516
576
|
"name": "id",
|
|
@@ -550,6 +610,12 @@
|
|
|
550
610
|
"hasDynamicHelp": false,
|
|
551
611
|
"multiple": false,
|
|
552
612
|
"type": "option"
|
|
613
|
+
},
|
|
614
|
+
"time": {
|
|
615
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
616
|
+
"name": "time",
|
|
617
|
+
"allowNo": false,
|
|
618
|
+
"type": "boolean"
|
|
553
619
|
}
|
|
554
620
|
},
|
|
555
621
|
"hasDynamicHelp": false,
|
|
@@ -583,6 +649,12 @@
|
|
|
583
649
|
"multiple": false,
|
|
584
650
|
"type": "option"
|
|
585
651
|
},
|
|
652
|
+
"time": {
|
|
653
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
654
|
+
"name": "time",
|
|
655
|
+
"allowNo": false,
|
|
656
|
+
"type": "boolean"
|
|
657
|
+
},
|
|
586
658
|
"id": {
|
|
587
659
|
"description": "Resource UUID",
|
|
588
660
|
"name": "id",
|
|
@@ -650,6 +722,12 @@
|
|
|
650
722
|
"multiple": false,
|
|
651
723
|
"type": "option"
|
|
652
724
|
},
|
|
725
|
+
"time": {
|
|
726
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
727
|
+
"name": "time",
|
|
728
|
+
"allowNo": false,
|
|
729
|
+
"type": "boolean"
|
|
730
|
+
},
|
|
653
731
|
"id": {
|
|
654
732
|
"description": "Resource UUID",
|
|
655
733
|
"name": "id",
|
|
@@ -690,6 +768,12 @@
|
|
|
690
768
|
"multiple": false,
|
|
691
769
|
"type": "option"
|
|
692
770
|
},
|
|
771
|
+
"time": {
|
|
772
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
773
|
+
"name": "time",
|
|
774
|
+
"allowNo": false,
|
|
775
|
+
"type": "boolean"
|
|
776
|
+
},
|
|
693
777
|
"id": {
|
|
694
778
|
"description": "Resource UUID",
|
|
695
779
|
"name": "id",
|
|
@@ -730,6 +814,12 @@
|
|
|
730
814
|
"multiple": false,
|
|
731
815
|
"type": "option"
|
|
732
816
|
},
|
|
817
|
+
"time": {
|
|
818
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
819
|
+
"name": "time",
|
|
820
|
+
"allowNo": false,
|
|
821
|
+
"type": "boolean"
|
|
822
|
+
},
|
|
733
823
|
"id": {
|
|
734
824
|
"description": "Resource UUID",
|
|
735
825
|
"name": "id",
|
|
@@ -770,6 +860,12 @@
|
|
|
770
860
|
"multiple": false,
|
|
771
861
|
"type": "option"
|
|
772
862
|
},
|
|
863
|
+
"time": {
|
|
864
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
865
|
+
"name": "time",
|
|
866
|
+
"allowNo": false,
|
|
867
|
+
"type": "boolean"
|
|
868
|
+
},
|
|
773
869
|
"id": {
|
|
774
870
|
"description": "Resource UUID",
|
|
775
871
|
"name": "id",
|
|
@@ -825,6 +921,12 @@
|
|
|
825
921
|
"multiple": false,
|
|
826
922
|
"type": "option"
|
|
827
923
|
},
|
|
924
|
+
"time": {
|
|
925
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
926
|
+
"name": "time",
|
|
927
|
+
"allowNo": false,
|
|
928
|
+
"type": "boolean"
|
|
929
|
+
},
|
|
828
930
|
"id": {
|
|
829
931
|
"description": "Resource UUID",
|
|
830
932
|
"name": "id",
|
|
@@ -880,6 +982,12 @@
|
|
|
880
982
|
"multiple": false,
|
|
881
983
|
"type": "option"
|
|
882
984
|
},
|
|
985
|
+
"time": {
|
|
986
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
987
|
+
"name": "time",
|
|
988
|
+
"allowNo": false,
|
|
989
|
+
"type": "boolean"
|
|
990
|
+
},
|
|
883
991
|
"id": {
|
|
884
992
|
"description": "Resource UUID",
|
|
885
993
|
"name": "id",
|
|
@@ -920,6 +1028,12 @@
|
|
|
920
1028
|
"multiple": false,
|
|
921
1029
|
"type": "option"
|
|
922
1030
|
},
|
|
1031
|
+
"time": {
|
|
1032
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1033
|
+
"name": "time",
|
|
1034
|
+
"allowNo": false,
|
|
1035
|
+
"type": "boolean"
|
|
1036
|
+
},
|
|
923
1037
|
"cursor": {
|
|
924
1038
|
"description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n",
|
|
925
1039
|
"name": "cursor",
|
|
@@ -1008,6 +1122,12 @@
|
|
|
1008
1122
|
"multiple": false,
|
|
1009
1123
|
"type": "option"
|
|
1010
1124
|
},
|
|
1125
|
+
"time": {
|
|
1126
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1127
|
+
"name": "time",
|
|
1128
|
+
"allowNo": false,
|
|
1129
|
+
"type": "boolean"
|
|
1130
|
+
},
|
|
1011
1131
|
"id": {
|
|
1012
1132
|
"description": "Resource UUID",
|
|
1013
1133
|
"name": "id",
|
|
@@ -1048,6 +1168,12 @@
|
|
|
1048
1168
|
"multiple": false,
|
|
1049
1169
|
"type": "option"
|
|
1050
1170
|
},
|
|
1171
|
+
"time": {
|
|
1172
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1173
|
+
"name": "time",
|
|
1174
|
+
"allowNo": false,
|
|
1175
|
+
"type": "boolean"
|
|
1176
|
+
},
|
|
1051
1177
|
"raw-body": {
|
|
1052
1178
|
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1053
1179
|
"name": "raw-body",
|
|
@@ -1114,6 +1240,12 @@
|
|
|
1114
1240
|
"multiple": false,
|
|
1115
1241
|
"type": "option"
|
|
1116
1242
|
},
|
|
1243
|
+
"time": {
|
|
1244
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1245
|
+
"name": "time",
|
|
1246
|
+
"allowNo": false,
|
|
1247
|
+
"type": "boolean"
|
|
1248
|
+
},
|
|
1117
1249
|
"id": {
|
|
1118
1250
|
"description": "Resource UUID",
|
|
1119
1251
|
"name": "id",
|
|
@@ -1153,6 +1285,12 @@
|
|
|
1153
1285
|
"hasDynamicHelp": false,
|
|
1154
1286
|
"multiple": false,
|
|
1155
1287
|
"type": "option"
|
|
1288
|
+
},
|
|
1289
|
+
"time": {
|
|
1290
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1291
|
+
"name": "time",
|
|
1292
|
+
"allowNo": false,
|
|
1293
|
+
"type": "boolean"
|
|
1156
1294
|
}
|
|
1157
1295
|
},
|
|
1158
1296
|
"hasDynamicHelp": false,
|
|
@@ -1186,6 +1324,12 @@
|
|
|
1186
1324
|
"multiple": false,
|
|
1187
1325
|
"type": "option"
|
|
1188
1326
|
},
|
|
1327
|
+
"time": {
|
|
1328
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1329
|
+
"name": "time",
|
|
1330
|
+
"allowNo": false,
|
|
1331
|
+
"type": "boolean"
|
|
1332
|
+
},
|
|
1189
1333
|
"id": {
|
|
1190
1334
|
"description": "Resource UUID",
|
|
1191
1335
|
"name": "id",
|
|
@@ -1226,6 +1370,12 @@
|
|
|
1226
1370
|
"multiple": false,
|
|
1227
1371
|
"type": "option"
|
|
1228
1372
|
},
|
|
1373
|
+
"time": {
|
|
1374
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1375
|
+
"name": "time",
|
|
1376
|
+
"allowNo": false,
|
|
1377
|
+
"type": "boolean"
|
|
1378
|
+
},
|
|
1229
1379
|
"id": {
|
|
1230
1380
|
"description": "Resource UUID",
|
|
1231
1381
|
"name": "id",
|
|
@@ -1300,6 +1450,12 @@
|
|
|
1300
1450
|
"multiple": false,
|
|
1301
1451
|
"type": "option"
|
|
1302
1452
|
},
|
|
1453
|
+
"time": {
|
|
1454
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1455
|
+
"name": "time",
|
|
1456
|
+
"allowNo": false,
|
|
1457
|
+
"type": "boolean"
|
|
1458
|
+
},
|
|
1303
1459
|
"raw-body": {
|
|
1304
1460
|
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1305
1461
|
"name": "raw-body",
|
|
@@ -1371,6 +1527,12 @@
|
|
|
1371
1527
|
"multiple": false,
|
|
1372
1528
|
"type": "option"
|
|
1373
1529
|
},
|
|
1530
|
+
"time": {
|
|
1531
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1532
|
+
"name": "time",
|
|
1533
|
+
"allowNo": false,
|
|
1534
|
+
"type": "boolean"
|
|
1535
|
+
},
|
|
1374
1536
|
"id": {
|
|
1375
1537
|
"description": "Resource UUID",
|
|
1376
1538
|
"name": "id",
|
|
@@ -1410,6 +1572,12 @@
|
|
|
1410
1572
|
"hasDynamicHelp": false,
|
|
1411
1573
|
"multiple": false,
|
|
1412
1574
|
"type": "option"
|
|
1575
|
+
},
|
|
1576
|
+
"time": {
|
|
1577
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1578
|
+
"name": "time",
|
|
1579
|
+
"allowNo": false,
|
|
1580
|
+
"type": "boolean"
|
|
1413
1581
|
}
|
|
1414
1582
|
},
|
|
1415
1583
|
"hasDynamicHelp": false,
|
|
@@ -1443,6 +1611,12 @@
|
|
|
1443
1611
|
"multiple": false,
|
|
1444
1612
|
"type": "option"
|
|
1445
1613
|
},
|
|
1614
|
+
"time": {
|
|
1615
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1616
|
+
"name": "time",
|
|
1617
|
+
"allowNo": false,
|
|
1618
|
+
"type": "boolean"
|
|
1619
|
+
},
|
|
1446
1620
|
"id": {
|
|
1447
1621
|
"description": "Resource UUID",
|
|
1448
1622
|
"name": "id",
|
|
@@ -1502,6 +1676,12 @@
|
|
|
1502
1676
|
"hasDynamicHelp": false,
|
|
1503
1677
|
"multiple": false,
|
|
1504
1678
|
"type": "option"
|
|
1679
|
+
},
|
|
1680
|
+
"time": {
|
|
1681
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1682
|
+
"name": "time",
|
|
1683
|
+
"allowNo": false,
|
|
1684
|
+
"type": "boolean"
|
|
1505
1685
|
}
|
|
1506
1686
|
},
|
|
1507
1687
|
"hasDynamicHelp": false,
|
|
@@ -1535,6 +1715,12 @@
|
|
|
1535
1715
|
"multiple": false,
|
|
1536
1716
|
"type": "option"
|
|
1537
1717
|
},
|
|
1718
|
+
"time": {
|
|
1719
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1720
|
+
"name": "time",
|
|
1721
|
+
"allowNo": false,
|
|
1722
|
+
"type": "boolean"
|
|
1723
|
+
},
|
|
1538
1724
|
"id": {
|
|
1539
1725
|
"description": "Resource UUID",
|
|
1540
1726
|
"name": "id",
|
|
@@ -1575,6 +1761,12 @@
|
|
|
1575
1761
|
"multiple": false,
|
|
1576
1762
|
"type": "option"
|
|
1577
1763
|
},
|
|
1764
|
+
"time": {
|
|
1765
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1766
|
+
"name": "time",
|
|
1767
|
+
"allowNo": false,
|
|
1768
|
+
"type": "boolean"
|
|
1769
|
+
},
|
|
1578
1770
|
"cursor": {
|
|
1579
1771
|
"description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n",
|
|
1580
1772
|
"name": "cursor",
|
|
@@ -1663,6 +1855,12 @@
|
|
|
1663
1855
|
"multiple": false,
|
|
1664
1856
|
"type": "option"
|
|
1665
1857
|
},
|
|
1858
|
+
"time": {
|
|
1859
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1860
|
+
"name": "time",
|
|
1861
|
+
"allowNo": false,
|
|
1862
|
+
"type": "boolean"
|
|
1863
|
+
},
|
|
1666
1864
|
"id": {
|
|
1667
1865
|
"description": "Resource UUID",
|
|
1668
1866
|
"name": "id",
|
|
@@ -1744,6 +1942,12 @@
|
|
|
1744
1942
|
"multiple": false,
|
|
1745
1943
|
"type": "option"
|
|
1746
1944
|
},
|
|
1945
|
+
"time": {
|
|
1946
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
1947
|
+
"name": "time",
|
|
1948
|
+
"allowNo": false,
|
|
1949
|
+
"type": "boolean"
|
|
1950
|
+
},
|
|
1747
1951
|
"raw-body": {
|
|
1748
1952
|
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1749
1953
|
"name": "raw-body",
|
|
@@ -1845,6 +2049,12 @@
|
|
|
1845
2049
|
"multiple": false,
|
|
1846
2050
|
"type": "option"
|
|
1847
2051
|
},
|
|
2052
|
+
"time": {
|
|
2053
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
2054
|
+
"name": "time",
|
|
2055
|
+
"allowNo": false,
|
|
2056
|
+
"type": "boolean"
|
|
2057
|
+
},
|
|
1848
2058
|
"cursor": {
|
|
1849
2059
|
"description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n",
|
|
1850
2060
|
"name": "cursor",
|
|
@@ -1931,6 +2141,12 @@
|
|
|
1931
2141
|
"multiple": false,
|
|
1932
2142
|
"type": "option"
|
|
1933
2143
|
},
|
|
2144
|
+
"time": {
|
|
2145
|
+
"description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
|
|
2146
|
+
"name": "time",
|
|
2147
|
+
"allowNo": false,
|
|
2148
|
+
"type": "boolean"
|
|
2149
|
+
},
|
|
1934
2150
|
"id": {
|
|
1935
2151
|
"description": "Delivery ID (numeric)",
|
|
1936
2152
|
"name": "id",
|
|
@@ -1951,5 +2167,5 @@
|
|
|
1951
2167
|
"enableJsonFlag": false
|
|
1952
2168
|
}
|
|
1953
2169
|
},
|
|
1954
|
-
"version": "0.
|
|
2170
|
+
"version": "0.18.0"
|
|
1955
2171
|
}
|