@contextual-io/cli 0.3.0 → 0.4.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 CHANGED
@@ -20,7 +20,7 @@ $ npm install -g @contextual-io/cli
20
20
  $ ctxl COMMAND
21
21
  running command...
22
22
  $ ctxl (--version)
23
- @contextual-io/cli/0.3.0 linux-x64 node-v25.2.1
23
+ @contextual-io/cli/0.4.0 linux-x64 node-v25.2.1
24
24
  $ ctxl --help [COMMAND]
25
25
  USAGE
26
26
  $ ctxl COMMAND
@@ -48,6 +48,14 @@ USAGE
48
48
  * [`ctxl records list [URI]`](#ctxl-records-list-uri)
49
49
  * [`ctxl records query [URI]`](#ctxl-records-query-uri)
50
50
  * [`ctxl records replace [URI]`](#ctxl-records-replace-uri)
51
+ * [`ctxl types <COMMAND>`](#ctxl-types-command)
52
+ * [`ctxl types add`](#ctxl-types-add)
53
+ * [`ctxl types create`](#ctxl-types-create)
54
+ * [`ctxl types delete [URI]`](#ctxl-types-delete-uri)
55
+ * [`ctxl types get [URI]`](#ctxl-types-get-uri)
56
+ * [`ctxl types import`](#ctxl-types-import)
57
+ * [`ctxl types list`](#ctxl-types-list)
58
+ * [`ctxl types replace [URI]`](#ctxl-types-replace-uri)
51
59
 
52
60
  ## `ctxl autocomplete [SHELL]`
53
61
 
@@ -82,19 +90,19 @@ _See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomp
82
90
 
83
91
  ## `ctxl config <COMMAND>`
84
92
 
85
- manage configs
93
+ Manage configs.
86
94
 
87
95
  ```
88
96
  USAGE
89
97
  $ ctxl config <COMMAND>
90
98
 
91
99
  DESCRIPTION
92
- manage configs
100
+ Manage configs.
93
101
  ```
94
102
 
95
103
  ## `ctxl config add CONFIG-ID`
96
104
 
97
- add a new config
105
+ Add a new config.
98
106
 
99
107
  ```
100
108
  USAGE
@@ -109,7 +117,7 @@ FLAGS
109
117
  -t, --tenant-id=<value> tenant id (if different from config id)
110
118
 
111
119
  DESCRIPTION
112
- add a new config
120
+ Add a new config.
113
121
 
114
122
  EXAMPLES
115
123
  $ ctxl config add some-config-id --tenant-id my-tenant
@@ -117,7 +125,7 @@ EXAMPLES
117
125
 
118
126
  ## `ctxl config current`
119
127
 
120
- get the current config
128
+ Get the current config.
121
129
 
122
130
  ```
123
131
  USAGE
@@ -127,7 +135,7 @@ GLOBAL FLAGS
127
135
  --json Format output as json.
128
136
 
129
137
  DESCRIPTION
130
- get the current config
138
+ Get the current config.
131
139
 
132
140
  EXAMPLES
133
141
  $ ctxl config current
@@ -135,7 +143,7 @@ EXAMPLES
135
143
 
136
144
  ## `ctxl config delete CONFIG-ID`
137
145
 
138
- delete a config
146
+ Delete a config.
139
147
 
140
148
  ```
141
149
  USAGE
@@ -145,7 +153,7 @@ ARGUMENTS
145
153
  CONFIG-ID id of config
146
154
 
147
155
  DESCRIPTION
148
- delete a config
156
+ Delete a config.
149
157
 
150
158
  EXAMPLES
151
159
  $ ctxl config delete some-config-id
@@ -153,7 +161,7 @@ EXAMPLES
153
161
 
154
162
  ## `ctxl config get [CONFIG-ID]`
155
163
 
156
- get a specific config
164
+ Get a specific config.
157
165
 
158
166
  ```
159
167
  USAGE
@@ -166,7 +174,7 @@ GLOBAL FLAGS
166
174
  --json Format output as json.
167
175
 
168
176
  DESCRIPTION
169
- get a specific config
177
+ Get a specific config.
170
178
 
171
179
  EXAMPLES
172
180
  $ ctxl config get
@@ -176,7 +184,7 @@ EXAMPLES
176
184
 
177
185
  ## `ctxl config list`
178
186
 
179
- list all available configs
187
+ List all available configs.
180
188
 
181
189
  ```
182
190
  USAGE
@@ -186,7 +194,7 @@ GLOBAL FLAGS
186
194
  --json Format output as json.
187
195
 
188
196
  DESCRIPTION
189
- list all available configs
197
+ List all available configs.
190
198
 
191
199
  EXAMPLES
192
200
  $ ctxl config list
@@ -194,14 +202,14 @@ EXAMPLES
194
202
 
195
203
  ## `ctxl config login`
196
204
 
197
- login using the current config
205
+ Login using the current config.
198
206
 
199
207
  ```
200
208
  USAGE
201
209
  $ ctxl config login
202
210
 
203
211
  DESCRIPTION
204
- login using the current config
212
+ Login using the current config.
205
213
 
206
214
  EXAMPLES
207
215
  $ ctxl config login
@@ -209,7 +217,7 @@ EXAMPLES
209
217
 
210
218
  ## `ctxl config use CONFIG-ID`
211
219
 
212
- use a config
220
+ Use a config.
213
221
 
214
222
  ```
215
223
  USAGE
@@ -219,7 +227,7 @@ ARGUMENTS
219
227
  CONFIG-ID id of config
220
228
 
221
229
  DESCRIPTION
222
- use a config
230
+ Use a config.
223
231
 
224
232
  EXAMPLES
225
233
  $ ctxl config use some-config-id
@@ -247,19 +255,19 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.3
247
255
 
248
256
  ## `ctxl records <COMMAND>`
249
257
 
250
- manage records
258
+ Manage records.
251
259
 
252
260
  ```
253
261
  USAGE
254
262
  $ ctxl records <COMMAND>
255
263
 
256
264
  DESCRIPTION
257
- manage records
265
+ Manage records.
258
266
  ```
259
267
 
260
268
  ## `ctxl records add [URI]`
261
269
 
262
- create record(s)
270
+ Create record(s).
263
271
 
264
272
  ```
265
273
  USAGE
@@ -276,7 +284,7 @@ GLOBAL FLAGS
276
284
  -C, --config-id=<value> Specify config id to use for call.
277
285
 
278
286
  DESCRIPTION
279
- create record(s)
287
+ Create record(s).
280
288
 
281
289
  ALIASES
282
290
  $ ctxl records create
@@ -290,7 +298,7 @@ EXAMPLES
290
298
 
291
299
  ## `ctxl records create [URI]`
292
300
 
293
- create record(s)
301
+ Create record(s).
294
302
 
295
303
  ```
296
304
  USAGE
@@ -307,7 +315,7 @@ GLOBAL FLAGS
307
315
  -C, --config-id=<value> Specify config id to use for call.
308
316
 
309
317
  DESCRIPTION
310
- create record(s)
318
+ Create record(s).
311
319
 
312
320
  ALIASES
313
321
  $ ctxl records create
@@ -321,7 +329,7 @@ EXAMPLES
321
329
 
322
330
  ## `ctxl records delete [URI]`
323
331
 
324
- delete record(s)
332
+ Delete record(s).
325
333
 
326
334
  ```
327
335
  USAGE
@@ -338,7 +346,7 @@ GLOBAL FLAGS
338
346
  -C, --config-id=<value> Specify config id to use for call.
339
347
 
340
348
  DESCRIPTION
341
- delete record(s)
349
+ Delete record(s).
342
350
 
343
351
  EXAMPLES
344
352
  $ ctxl records delete native-object:my-type/instance-1
@@ -354,7 +362,7 @@ EXAMPLES
354
362
 
355
363
  ## `ctxl records get [URI]`
356
364
 
357
- get a record
365
+ Get a record.
358
366
 
359
367
  ```
360
368
  USAGE
@@ -371,7 +379,7 @@ GLOBAL FLAGS
371
379
  -C, --config-id=<value> Specify config id to use for call.
372
380
 
373
381
  DESCRIPTION
374
- get a record
382
+ Get a record.
375
383
 
376
384
  EXAMPLES
377
385
  $ ctxl records get native-object:my-type/instance-1
@@ -387,7 +395,7 @@ EXAMPLES
387
395
 
388
396
  ## `ctxl records import [URI]`
389
397
 
390
- create record(s)
398
+ Create record(s).
391
399
 
392
400
  ```
393
401
  USAGE
@@ -404,7 +412,7 @@ GLOBAL FLAGS
404
412
  -C, --config-id=<value> Specify config id to use for call.
405
413
 
406
414
  DESCRIPTION
407
- create record(s)
415
+ Create record(s).
408
416
 
409
417
  ALIASES
410
418
  $ ctxl records create
@@ -418,7 +426,7 @@ EXAMPLES
418
426
 
419
427
  ## `ctxl records list [URI]`
420
428
 
421
- list records
429
+ List records.
422
430
 
423
431
  ```
424
432
  USAGE
@@ -445,7 +453,7 @@ GLOBAL FLAGS
445
453
  -C, --config-id=<value> Specify config id to use for call.
446
454
 
447
455
  DESCRIPTION
448
- list records
456
+ List records.
449
457
 
450
458
  EXAMPLES
451
459
  $ ctxl records list native-object:my-type
@@ -459,7 +467,7 @@ EXAMPLES
459
467
 
460
468
  ## `ctxl records query [URI]`
461
469
 
462
- query records
470
+ Query records.
463
471
 
464
472
  ```
465
473
  USAGE
@@ -483,7 +491,7 @@ GLOBAL FLAGS
483
491
  -C, --config-id=<value> Specify config id to use for call.
484
492
 
485
493
  DESCRIPTION
486
- query records
494
+ Query records.
487
495
 
488
496
  EXAMPLES
489
497
  $ ctxl records query native-object:my-type
@@ -497,7 +505,7 @@ EXAMPLES
497
505
 
498
506
  ## `ctxl records replace [URI]`
499
507
 
500
- replace a record
508
+ Replace a record.
501
509
 
502
510
  ```
503
511
  USAGE
@@ -515,7 +523,7 @@ GLOBAL FLAGS
515
523
  -C, --config-id=<value> Specify config id to use for call.
516
524
 
517
525
  DESCRIPTION
518
- replace a record
526
+ Replace a record.
519
527
 
520
528
  EXAMPLES
521
529
  $ ctxl records replace native-object:my-type/instance-1 --input-file record.json
@@ -524,4 +532,211 @@ EXAMPLES
524
532
 
525
533
  $ ctxl records replace --type my-type --id instance-1 --input-file record.json
526
534
  ```
535
+
536
+ ## `ctxl types <COMMAND>`
537
+
538
+ Manage types.
539
+
540
+ ```
541
+ USAGE
542
+ $ ctxl types <COMMAND>
543
+
544
+ DESCRIPTION
545
+ Manage types.
546
+ ```
547
+
548
+ ## `ctxl types add`
549
+
550
+ Create type(s).
551
+
552
+ ```
553
+ USAGE
554
+ $ ctxl types add [-C <value>] [-i <value>]
555
+
556
+ FLAGS
557
+ -i, --input-file=<value> [default: -] file to read. can read stdin if value is '-'
558
+
559
+ GLOBAL FLAGS
560
+ -C, --config-id=<value> Specify config id to use for call.
561
+
562
+ DESCRIPTION
563
+ Create type(s).
564
+
565
+ ALIASES
566
+ $ ctxl types create
567
+ $ ctxl types import
568
+
569
+ EXAMPLES
570
+ $ ctxl types add
571
+
572
+ $ ctxl types add --input-file types.json
573
+ ```
574
+
575
+ ## `ctxl types create`
576
+
577
+ Create type(s).
578
+
579
+ ```
580
+ USAGE
581
+ $ ctxl types create [-C <value>] [-i <value>]
582
+
583
+ FLAGS
584
+ -i, --input-file=<value> [default: -] file to read. can read stdin if value is '-'
585
+
586
+ GLOBAL FLAGS
587
+ -C, --config-id=<value> Specify config id to use for call.
588
+
589
+ DESCRIPTION
590
+ Create type(s).
591
+
592
+ ALIASES
593
+ $ ctxl types create
594
+ $ ctxl types import
595
+
596
+ EXAMPLES
597
+ $ ctxl types create
598
+
599
+ $ ctxl types create --input-file types.json
600
+ ```
601
+
602
+ ## `ctxl types delete [URI]`
603
+
604
+ Delete a type.
605
+
606
+ ```
607
+ USAGE
608
+ $ ctxl types delete [URI] [-C <value>] [-T <value>]
609
+
610
+ ARGUMENTS
611
+ [URI] uri of type
612
+
613
+ FLAGS
614
+ -T, --type=<value> type
615
+
616
+ GLOBAL FLAGS
617
+ -C, --config-id=<value> Specify config id to use for call.
618
+
619
+ DESCRIPTION
620
+ Delete a type.
621
+
622
+ EXAMPLES
623
+ $ ctxl types delete native-object:my-type
624
+
625
+ $ ctxl types delete --type my-type
626
+ ```
627
+
628
+ ## `ctxl types get [URI]`
629
+
630
+ Get a type.
631
+
632
+ ```
633
+ USAGE
634
+ $ ctxl types get [URI] [-C <value>] [-T <value>]
635
+
636
+ ARGUMENTS
637
+ [URI] uri of type
638
+
639
+ FLAGS
640
+ -T, --type=<value> type
641
+
642
+ GLOBAL FLAGS
643
+ -C, --config-id=<value> Specify config id to use for call.
644
+
645
+ DESCRIPTION
646
+ Get a type.
647
+
648
+ EXAMPLES
649
+ $ ctxl types get native-object:my-type
650
+
651
+ $ ctxl types get --type my-type
652
+ ```
653
+
654
+ ## `ctxl types import`
655
+
656
+ Create type(s).
657
+
658
+ ```
659
+ USAGE
660
+ $ ctxl types import [-C <value>] [-i <value>]
661
+
662
+ FLAGS
663
+ -i, --input-file=<value> [default: -] file to read. can read stdin if value is '-'
664
+
665
+ GLOBAL FLAGS
666
+ -C, --config-id=<value> Specify config id to use for call.
667
+
668
+ DESCRIPTION
669
+ Create type(s).
670
+
671
+ ALIASES
672
+ $ ctxl types create
673
+ $ ctxl types import
674
+
675
+ EXAMPLES
676
+ $ ctxl types import
677
+
678
+ $ ctxl types import --input-file types.json
679
+ ```
680
+
681
+ ## `ctxl types list`
682
+
683
+ List types.
684
+
685
+ ```
686
+ USAGE
687
+ $ ctxl types list [-C <value>] [-S <value>...] [-e] [-f <value>...] [--include-total] [-o <value>...]
688
+ [--page-size <value>] [--page-token <value>] [-p] [-s <value>...] [-t <value>...]
689
+
690
+ FLAGS
691
+ -S, --exact-search=<value>... search fields exactly
692
+ -e, --export export data as JSONL
693
+ -f, --from=<value>... search from
694
+ -o, --order-by=<value>... order fields
695
+ -p, --progress show progress during export
696
+ -s, --search=<value>... search fields
697
+ -t, --to=<value>... search to
698
+ --include-total include total count
699
+ --page-size=<value> number of types per page
700
+ --page-token=<value> page token to fetch
701
+
702
+ GLOBAL FLAGS
703
+ -C, --config-id=<value> Specify config id to use for call.
704
+
705
+ DESCRIPTION
706
+ List types.
707
+
708
+ EXAMPLES
709
+ $ ctxl types list
710
+
711
+ $ ctxl types list --order-by field1:desc
712
+
713
+ $ ctxl types list -s field1=value1 -s field2=value2 --include-total
714
+ ```
715
+
716
+ ## `ctxl types replace [URI]`
717
+
718
+ Replace a type.
719
+
720
+ ```
721
+ USAGE
722
+ $ ctxl types replace [URI] [-C <value>] [-i <value>] [-T <value>]
723
+
724
+ ARGUMENTS
725
+ [URI] uri of type
726
+
727
+ FLAGS
728
+ -T, --type=<value> type
729
+ -i, --input-file=<value> [default: -] file to read. can read stdin if value is '-'
730
+
731
+ GLOBAL FLAGS
732
+ -C, --config-id=<value> Specify config id to use for call.
733
+
734
+ DESCRIPTION
735
+ Replace a type.
736
+
737
+ EXAMPLES
738
+ $ ctxl types replace native-object:my-type --input-file record.json
739
+
740
+ $ ctxl types replace --type my-type --input-file record.json
741
+ ```
527
742
  <!-- commandsstop -->
package/dist/base.js CHANGED
@@ -114,7 +114,9 @@ export class BaseConfigCommand extends Command {
114
114
  }
115
115
  this.logToStderr(chalkStderr.red(chalkStderr.bold(" Error: ") + message));
116
116
  this.logToStderr();
117
- await this.showHelp();
117
+ if (!(err instanceof HttpError)) {
118
+ await this.showHelp();
119
+ }
118
120
  }
119
121
  this.exit(exitCode);
120
122
  }
@@ -7,7 +7,7 @@ export default class ConfigAdd extends BaseConfigCommand {
7
7
  static args = {
8
8
  "config-id": Args.string({ description: "id of config", required: true }),
9
9
  };
10
- static description = "add a new config";
10
+ static description = "Add a new config.";
11
11
  static examples = [
12
12
  "<%= config.bin %> <%= command.id %> some-config-id --tenant-id my-tenant",
13
13
  ];
@@ -1,7 +1,7 @@
1
1
  import { BaseConfigCommand } from "../../base.js";
2
2
  export default class ConfigCurrent extends BaseConfigCommand {
3
3
  static args = {};
4
- static description = "get the current config";
4
+ static description = "Get the current config.";
5
5
  static enableJsonFlag = true;
6
6
  static examples = [
7
7
  "<%= config.bin %> <%= command.id %>",
@@ -5,7 +5,7 @@ export default class ConfigDelete extends BaseConfigCommand {
5
5
  static args = {
6
6
  "config-id": Args.string({ description: "id of config", required: true }),
7
7
  };
8
- static description = "delete a config";
8
+ static description = "Delete a config.";
9
9
  static examples = [
10
10
  "<%= config.bin %> <%= command.id %> some-config-id",
11
11
  ];
@@ -6,7 +6,7 @@ export default class ConfigGet extends BaseConfigCommand {
6
6
  static args = {
7
7
  "config-id": Args.string({ description: "id of config" }),
8
8
  };
9
- static description = "get a specific config";
9
+ static description = "Get a specific config.";
10
10
  static enableJsonFlag = true;
11
11
  static examples = [
12
12
  "<%= config.bin %> <%= command.id %>",
@@ -1,7 +1,7 @@
1
1
  import { BaseConfigCommand } from "../../base.js";
2
2
  export default class Config extends BaseConfigCommand {
3
3
  static args = {};
4
- static description = "manage configs";
4
+ static description = "Manage configs.";
5
5
  static examples = [];
6
6
  static flags = {};
7
7
  static usage = [
@@ -3,7 +3,7 @@ import chalk from "chalk";
3
3
  import { BaseConfigCommand } from "../../base.js";
4
4
  export default class ConfigList extends BaseConfigCommand {
5
5
  static args = {};
6
- static description = "list all available configs";
6
+ static description = "List all available configs.";
7
7
  static enableJsonFlag = true;
8
8
  static examples = [
9
9
  "<%= config.bin %> <%= command.id %>",
@@ -2,7 +2,7 @@ import { BaseConfigCommand } from "../../base.js";
2
2
  import { codeExchange, getUserProfile } from "../../utils/auth.js";
3
3
  export default class ConfigLogin extends BaseConfigCommand {
4
4
  static args = {};
5
- static description = "login using the current config";
5
+ static description = "Login using the current config.";
6
6
  static examples = [
7
7
  "<%= config.bin %> <%= command.id %>",
8
8
  ];
@@ -5,7 +5,7 @@ export default class ConfigUse extends BaseConfigCommand {
5
5
  static args = {
6
6
  "config-id": Args.string({ description: "id of config", required: true }),
7
7
  };
8
- static description = "use a config";
8
+ static description = "Use a config.";
9
9
  static examples = [
10
10
  "<%= config.bin %> <%= command.id %> some-config-id",
11
11
  ];
@@ -11,7 +11,7 @@ export default class RecordsAdd extends BaseCommand {
11
11
  static args = {
12
12
  "uri": Args.string({ description: "uri of type" }),
13
13
  };
14
- static description = "create record(s)";
14
+ static description = "Create record(s).";
15
15
  static examples = [
16
16
  "<%= config.bin %> <%= command.id %> native-object:my-type",
17
17
  "<%= config.bin %> <%= command.id %> --type my-type --input-file records.json",
@@ -6,7 +6,7 @@ export default class RecordsDelete extends BaseCommand {
6
6
  static args = {
7
7
  "uri": Args.string({ description: "uri of record" }),
8
8
  };
9
- static description = "delete record(s)";
9
+ static description = "Delete record(s).";
10
10
  static examples = [
11
11
  "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1",
12
12
  "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1",
@@ -6,7 +6,7 @@ export default class RecordsGet extends BaseCommand {
6
6
  static args = {
7
7
  "uri": Args.string({ description: "uri of record" }),
8
8
  };
9
- static description = "get a record";
9
+ static description = "Get a record.";
10
10
  static examples = [
11
11
  "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1",
12
12
  "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1",
@@ -1,7 +1,7 @@
1
1
  import { BaseConfigCommand } from "../../base.js";
2
2
  export default class Records extends BaseConfigCommand {
3
3
  static args = {};
4
- static description = "manage records";
4
+ static description = "Manage records.";
5
5
  static examples = [];
6
6
  static flags = {};
7
7
  static usage = [
@@ -12,7 +12,7 @@ export default class RecordsList extends BaseCommand {
12
12
  static args = {
13
13
  "uri": Args.string({ description: "uri of type" }),
14
14
  };
15
- static description = "list records";
15
+ static description = "List records.";
16
16
  static examples = [
17
17
  "<%= config.bin %> <%= command.id %> native-object:my-type",
18
18
  "<%= config.bin %> <%= command.id %> --type my-type",
@@ -10,7 +10,7 @@ export default class RecordsQuery extends BaseCommand {
10
10
  static args = {
11
11
  "uri": Args.string({ description: "uri of type" }),
12
12
  };
13
- static description = "query records";
13
+ static description = "Query records.";
14
14
  static examples = [
15
15
  "<%= config.bin %> <%= command.id %> native-object:my-type",
16
16
  "<%= config.bin %> <%= command.id %> --type my-type --query-file query.json",
@@ -9,7 +9,7 @@ export default class RecordsReplace extends BaseCommand {
9
9
  static args = {
10
10
  "uri": Args.string({ description: "uri of record" }),
11
11
  };
12
- static description = "replace a record";
12
+ static description = "Replace a record.";
13
13
  static examples = [
14
14
  "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1 --input-file record.json",
15
15
  "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1 --input-file record.json",
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from "../../base.js";
2
+ export default class TypesAdd extends BaseCommand<typeof TypesAdd> {
3
+ static aliases: string[];
4
+ static args: {};
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ "input-file": import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }