balena-cli 23.1.4 → 23.2.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/CHANGELOG.md +5 -1
- package/build/help.d.ts +2 -4
- package/build/help.js +6 -21
- package/build/help.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +198 -198
- package/package.json +2 -2
- package/src/help.ts +8 -38
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file
|
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
-
## 23.
|
|
7
|
+
## 23.2.0 - 2025-11-20
|
|
8
|
+
|
|
9
|
+
* Include sub-commands in --help [Thodoris Greasidis]
|
|
10
|
+
|
|
11
|
+
## 23.1.4 - 2025-11-20
|
|
8
12
|
|
|
9
13
|
* Remove the oclif/core patches in favor oclif overrides & customization [Thodoris Greasidis]
|
|
10
14
|
|
package/build/help.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { Command
|
|
1
|
+
import type { Command } from '@oclif/core';
|
|
2
2
|
import { Help } from '@oclif/core';
|
|
3
3
|
import type { ResolvableReturnType } from 'balena-sdk/typings/utils';
|
|
4
4
|
export default class BalenaHelp extends Help {
|
|
5
|
-
private
|
|
6
|
-
protected get sortedCommands(): Command.Loadable[];
|
|
7
|
-
protected get sortedTopics(): Interfaces.Topic[];
|
|
5
|
+
private formatCommandsTitle;
|
|
8
6
|
showCommandHelp(command: Command.Loadable): Promise<void>;
|
|
9
7
|
showHelp(argv: string[]): Promise<void>;
|
|
10
8
|
getCustomRootHelp(showAllCommands: boolean): string;
|
package/build/help.js
CHANGED
|
@@ -20,7 +20,7 @@ function getHelpSubject(args) {
|
|
|
20
20
|
class BalenaHelp extends core_1.Help {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
-
this.
|
|
23
|
+
this.formatCommandsTitle = null;
|
|
24
24
|
this.manuallySortedPrimaryCommands = [
|
|
25
25
|
'login',
|
|
26
26
|
'push',
|
|
@@ -33,28 +33,9 @@ class BalenaHelp extends core_1.Help {
|
|
|
33
33
|
'leave',
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
|
-
get sortedCommands() {
|
|
37
|
-
const commands = super.sortedCommands;
|
|
38
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
39
|
-
return commands;
|
|
40
|
-
}
|
|
41
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
42
|
-
return commands.filter((c) => c.id.split(':').length <= depth);
|
|
43
|
-
}
|
|
44
|
-
get sortedTopics() {
|
|
45
|
-
const topics = super.sortedTopics;
|
|
46
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
47
|
-
return topics;
|
|
48
|
-
}
|
|
49
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
50
|
-
return topics.filter((t) => t.name.split(':').length <= depth);
|
|
51
|
-
}
|
|
52
36
|
async showCommandHelp(command) {
|
|
53
|
-
|
|
54
|
-
const depth = name.split(':').length;
|
|
55
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = depth;
|
|
37
|
+
this.formatCommandsTitle = 'SUB COMMANDS';
|
|
56
38
|
await super.showCommandHelp(command);
|
|
57
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = null;
|
|
58
39
|
}
|
|
59
40
|
async showHelp(argv) {
|
|
60
41
|
const ux = (0, lazy_1.getCliUx)();
|
|
@@ -172,6 +153,10 @@ See: https://git.io/JRHUW#deprecation-policy`,
|
|
|
172
153
|
indentation: 2,
|
|
173
154
|
multiline: false,
|
|
174
155
|
});
|
|
156
|
+
if (this.formatCommandsTitle) {
|
|
157
|
+
this.log(this.formatCommandsTitle);
|
|
158
|
+
this.formatCommandsTitle = null;
|
|
159
|
+
}
|
|
175
160
|
return indent(body, 2);
|
|
176
161
|
}
|
|
177
162
|
formatDescription(desc = '') {
|
package/build/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;AAiBA,sCAAmC;AACnC,wCAAwC;AAExC,uCAAwC;AAKxC,SAAS,cAAc,CAAC,IAAc;IACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACR,CAAC;QACD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YACxC,SAAS;QACV,CAAC;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO;QACR,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;AACF,CAAC;AAGD,MAAqB,UAAW,SAAQ,WAAI;IAA5C;;QACS,
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;AAiBA,sCAAmC;AACnC,wCAAwC;AAExC,uCAAwC;AAKxC,SAAS,cAAc,CAAC,IAAc;IACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACR,CAAC;QACD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YACxC,SAAS;QACV,CAAC;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO;QACR,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;AACF,CAAC;AAGD,MAAqB,UAAW,SAAQ,WAAI;IAA5C;;QACS,wBAAmB,GAAkB,IAAI,CAAC;QAuMzC,kCAA6B,GAAG;YACxC,OAAO;YACP,MAAM;YACN,OAAO;YACP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,CACD,CAAC;QAEF,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;IAES,iBAAiB,CAAC,IAAI,GAAG,EAAE;QACpC,MAAM,EAAE,GAAG,IAAA,eAAQ,GAAE,CAAC;QACtB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3B,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC1D,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,CAAC;QACD,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;CAaD;AAnND,6BAmNC"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balena-cli",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.2.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "balena-cli",
|
|
9
|
-
"version": "23.
|
|
9
|
+
"version": "23.2.0",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"dependencies": {
|
package/oclif.manifest.json
CHANGED
|
@@ -362,6 +362,56 @@
|
|
|
362
362
|
"index.js"
|
|
363
363
|
]
|
|
364
364
|
},
|
|
365
|
+
"block:create": {
|
|
366
|
+
"aliases": [],
|
|
367
|
+
"args": {
|
|
368
|
+
"name": {
|
|
369
|
+
"description": "block name",
|
|
370
|
+
"name": "name",
|
|
371
|
+
"required": true
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"description": "Create an block.\n\nCreate a new balena block.\n\nYou can specify the organization the block should belong to using\nthe `--organization` option. The organization's handle, not its name,\nshould be provided. Organization handles can be listed with the\n`balena organization list` command.\n\nThe block's default device type is specified with the `--type` option.\nThe `balena device-type list` command can be used to list the available\ndevice types.\n\nInteractive dropdowns will be shown for selection if no device type or\norganization is specified and there are multiple options to choose from.\nIf there is a single option to choose from, it will be chosen automatically.\nThis interactive behavior can be disabled by explicitly specifying a device\ntype and organization.",
|
|
375
|
+
"examples": [
|
|
376
|
+
"$ balena block create MyBlock",
|
|
377
|
+
"$ balena block create MyBlock --organization mmyorg",
|
|
378
|
+
"$ balena block create MyBlock -o myorg --type raspberry-pi"
|
|
379
|
+
],
|
|
380
|
+
"flags": {
|
|
381
|
+
"organization": {
|
|
382
|
+
"char": "o",
|
|
383
|
+
"description": "handle of the organization the block should belong to",
|
|
384
|
+
"name": "organization",
|
|
385
|
+
"hasDynamicHelp": false,
|
|
386
|
+
"multiple": false,
|
|
387
|
+
"type": "option"
|
|
388
|
+
},
|
|
389
|
+
"type": {
|
|
390
|
+
"char": "t",
|
|
391
|
+
"description": "block device type (Check available types with `balena device-type list`)",
|
|
392
|
+
"name": "type",
|
|
393
|
+
"hasDynamicHelp": false,
|
|
394
|
+
"multiple": false,
|
|
395
|
+
"type": "option"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"hasDynamicHelp": false,
|
|
399
|
+
"hiddenAliases": [],
|
|
400
|
+
"id": "block:create",
|
|
401
|
+
"pluginAlias": "balena-cli",
|
|
402
|
+
"pluginName": "balena-cli",
|
|
403
|
+
"pluginType": "core",
|
|
404
|
+
"strict": true,
|
|
405
|
+
"enableJsonFlag": false,
|
|
406
|
+
"authenticated": true,
|
|
407
|
+
"isESM": false,
|
|
408
|
+
"relativePath": [
|
|
409
|
+
"build",
|
|
410
|
+
"commands",
|
|
411
|
+
"block",
|
|
412
|
+
"create.js"
|
|
413
|
+
]
|
|
414
|
+
},
|
|
365
415
|
"config:generate": {
|
|
366
416
|
"aliases": [],
|
|
367
417
|
"args": {},
|
|
@@ -706,56 +756,6 @@
|
|
|
706
756
|
"write.js"
|
|
707
757
|
]
|
|
708
758
|
},
|
|
709
|
-
"block:create": {
|
|
710
|
-
"aliases": [],
|
|
711
|
-
"args": {
|
|
712
|
-
"name": {
|
|
713
|
-
"description": "block name",
|
|
714
|
-
"name": "name",
|
|
715
|
-
"required": true
|
|
716
|
-
}
|
|
717
|
-
},
|
|
718
|
-
"description": "Create an block.\n\nCreate a new balena block.\n\nYou can specify the organization the block should belong to using\nthe `--organization` option. The organization's handle, not its name,\nshould be provided. Organization handles can be listed with the\n`balena organization list` command.\n\nThe block's default device type is specified with the `--type` option.\nThe `balena device-type list` command can be used to list the available\ndevice types.\n\nInteractive dropdowns will be shown for selection if no device type or\norganization is specified and there are multiple options to choose from.\nIf there is a single option to choose from, it will be chosen automatically.\nThis interactive behavior can be disabled by explicitly specifying a device\ntype and organization.",
|
|
719
|
-
"examples": [
|
|
720
|
-
"$ balena block create MyBlock",
|
|
721
|
-
"$ balena block create MyBlock --organization mmyorg",
|
|
722
|
-
"$ balena block create MyBlock -o myorg --type raspberry-pi"
|
|
723
|
-
],
|
|
724
|
-
"flags": {
|
|
725
|
-
"organization": {
|
|
726
|
-
"char": "o",
|
|
727
|
-
"description": "handle of the organization the block should belong to",
|
|
728
|
-
"name": "organization",
|
|
729
|
-
"hasDynamicHelp": false,
|
|
730
|
-
"multiple": false,
|
|
731
|
-
"type": "option"
|
|
732
|
-
},
|
|
733
|
-
"type": {
|
|
734
|
-
"char": "t",
|
|
735
|
-
"description": "block device type (Check available types with `balena device-type list`)",
|
|
736
|
-
"name": "type",
|
|
737
|
-
"hasDynamicHelp": false,
|
|
738
|
-
"multiple": false,
|
|
739
|
-
"type": "option"
|
|
740
|
-
}
|
|
741
|
-
},
|
|
742
|
-
"hasDynamicHelp": false,
|
|
743
|
-
"hiddenAliases": [],
|
|
744
|
-
"id": "block:create",
|
|
745
|
-
"pluginAlias": "balena-cli",
|
|
746
|
-
"pluginName": "balena-cli",
|
|
747
|
-
"pluginType": "core",
|
|
748
|
-
"strict": true,
|
|
749
|
-
"enableJsonFlag": false,
|
|
750
|
-
"authenticated": true,
|
|
751
|
-
"isESM": false,
|
|
752
|
-
"relativePath": [
|
|
753
|
-
"build",
|
|
754
|
-
"commands",
|
|
755
|
-
"block",
|
|
756
|
-
"create.js"
|
|
757
|
-
]
|
|
758
|
-
},
|
|
759
759
|
"deploy": {
|
|
760
760
|
"aliases": [],
|
|
761
761
|
"args": {
|
|
@@ -979,45 +979,6 @@
|
|
|
979
979
|
"index.js"
|
|
980
980
|
]
|
|
981
981
|
},
|
|
982
|
-
"device-type:list": {
|
|
983
|
-
"aliases": [],
|
|
984
|
-
"args": {},
|
|
985
|
-
"description": "List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').\n\nList the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').\n\nBy default, only actively supported device types are listed.\nThe --all option can be used to list all device types, including those that are\nno longer supported by balena.",
|
|
986
|
-
"examples": [
|
|
987
|
-
"$ balena device-type list",
|
|
988
|
-
"$ balena device-type list --all"
|
|
989
|
-
],
|
|
990
|
-
"flags": {
|
|
991
|
-
"json": {
|
|
992
|
-
"description": "Format output as json.",
|
|
993
|
-
"helpGroup": "GLOBAL",
|
|
994
|
-
"name": "json",
|
|
995
|
-
"allowNo": false,
|
|
996
|
-
"type": "boolean"
|
|
997
|
-
},
|
|
998
|
-
"all": {
|
|
999
|
-
"description": "include device types no longer supported by balena",
|
|
1000
|
-
"name": "all",
|
|
1001
|
-
"allowNo": false,
|
|
1002
|
-
"type": "boolean"
|
|
1003
|
-
}
|
|
1004
|
-
},
|
|
1005
|
-
"hasDynamicHelp": false,
|
|
1006
|
-
"hiddenAliases": [],
|
|
1007
|
-
"id": "device-type:list",
|
|
1008
|
-
"pluginAlias": "balena-cli",
|
|
1009
|
-
"pluginName": "balena-cli",
|
|
1010
|
-
"pluginType": "core",
|
|
1011
|
-
"strict": true,
|
|
1012
|
-
"enableJsonFlag": true,
|
|
1013
|
-
"isESM": false,
|
|
1014
|
-
"relativePath": [
|
|
1015
|
-
"build",
|
|
1016
|
-
"commands",
|
|
1017
|
-
"device-type",
|
|
1018
|
-
"list.js"
|
|
1019
|
-
]
|
|
1020
|
-
},
|
|
1021
982
|
"device:deactivate": {
|
|
1022
983
|
"aliases": [],
|
|
1023
984
|
"args": {
|
|
@@ -2238,6 +2199,45 @@
|
|
|
2238
2199
|
"tunnel.js"
|
|
2239
2200
|
]
|
|
2240
2201
|
},
|
|
2202
|
+
"device-type:list": {
|
|
2203
|
+
"aliases": [],
|
|
2204
|
+
"args": {},
|
|
2205
|
+
"description": "List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').\n\nList the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').\n\nBy default, only actively supported device types are listed.\nThe --all option can be used to list all device types, including those that are\nno longer supported by balena.",
|
|
2206
|
+
"examples": [
|
|
2207
|
+
"$ balena device-type list",
|
|
2208
|
+
"$ balena device-type list --all"
|
|
2209
|
+
],
|
|
2210
|
+
"flags": {
|
|
2211
|
+
"json": {
|
|
2212
|
+
"description": "Format output as json.",
|
|
2213
|
+
"helpGroup": "GLOBAL",
|
|
2214
|
+
"name": "json",
|
|
2215
|
+
"allowNo": false,
|
|
2216
|
+
"type": "boolean"
|
|
2217
|
+
},
|
|
2218
|
+
"all": {
|
|
2219
|
+
"description": "include device types no longer supported by balena",
|
|
2220
|
+
"name": "all",
|
|
2221
|
+
"allowNo": false,
|
|
2222
|
+
"type": "boolean"
|
|
2223
|
+
}
|
|
2224
|
+
},
|
|
2225
|
+
"hasDynamicHelp": false,
|
|
2226
|
+
"hiddenAliases": [],
|
|
2227
|
+
"id": "device-type:list",
|
|
2228
|
+
"pluginAlias": "balena-cli",
|
|
2229
|
+
"pluginName": "balena-cli",
|
|
2230
|
+
"pluginType": "core",
|
|
2231
|
+
"strict": true,
|
|
2232
|
+
"enableJsonFlag": true,
|
|
2233
|
+
"isESM": false,
|
|
2234
|
+
"relativePath": [
|
|
2235
|
+
"build",
|
|
2236
|
+
"commands",
|
|
2237
|
+
"device-type",
|
|
2238
|
+
"list.js"
|
|
2239
|
+
]
|
|
2240
|
+
},
|
|
2241
2241
|
"env:list": {
|
|
2242
2242
|
"aliases": [],
|
|
2243
2243
|
"args": {},
|
|
@@ -4313,67 +4313,6 @@
|
|
|
4313
4313
|
"index.js"
|
|
4314
4314
|
]
|
|
4315
4315
|
},
|
|
4316
|
-
"support": {
|
|
4317
|
-
"aliases": [],
|
|
4318
|
-
"args": {
|
|
4319
|
-
"action": {
|
|
4320
|
-
"description": "enable|disable support access",
|
|
4321
|
-
"name": "action",
|
|
4322
|
-
"options": [
|
|
4323
|
-
"enable",
|
|
4324
|
-
"disable"
|
|
4325
|
-
]
|
|
4326
|
-
}
|
|
4327
|
-
},
|
|
4328
|
-
"description": "Grant or revoke support access for devices or fleets.\n\nGrant or revoke balena support agent access to devices or fleets\non balenaCloud. (This command does not apply to openBalena.)\nAccess will be automatically revoked once the specified duration has elapsed.\n\nDuration defaults to 24h, but can be specified using --duration flag in days\nor hours, e.g. '12h', '2d'.\n\nBoth --device and --fleet flags accept multiple values, specified as\na comma-separated list (with no spaces).\n\nFleets may be specified by fleet name or slug. Fleet slugs are\nthe recommended option, as they are unique and unambiguous. Slugs can be\nlisted with the `balena fleet list` command. Note that slugs may change if the\nfleet is renamed. Fleet names are not unique and may result in \"Fleet is\nambiguous\" errors at any time (even if it \"used to work in the past\"), for\nexample if the name clashes with a newly created public fleet, or with fleets\nfrom other balena accounts that you may be invited to join under any role.\nFor this reason, fleet names are especially discouraged in scripts (e.g. CI\nenvironments).",
|
|
4329
|
-
"examples": [
|
|
4330
|
-
"balena support enable --device ab346f,cd457a --duration 3d",
|
|
4331
|
-
"balena support enable --fleet myFleet --duration 12h",
|
|
4332
|
-
"balena support disable -f myorg/myfleet"
|
|
4333
|
-
],
|
|
4334
|
-
"flags": {
|
|
4335
|
-
"device": {
|
|
4336
|
-
"char": "d",
|
|
4337
|
-
"description": "comma-separated list (no spaces) of device UUIDs",
|
|
4338
|
-
"name": "device",
|
|
4339
|
-
"hasDynamicHelp": false,
|
|
4340
|
-
"multiple": false,
|
|
4341
|
-
"type": "option"
|
|
4342
|
-
},
|
|
4343
|
-
"fleet": {
|
|
4344
|
-
"char": "f",
|
|
4345
|
-
"description": "comma-separated list (no spaces) of fleet names or slugs (preferred)",
|
|
4346
|
-
"name": "fleet",
|
|
4347
|
-
"hasDynamicHelp": false,
|
|
4348
|
-
"multiple": false,
|
|
4349
|
-
"type": "option"
|
|
4350
|
-
},
|
|
4351
|
-
"duration": {
|
|
4352
|
-
"char": "t",
|
|
4353
|
-
"description": "length of time to enable support for, in (h)ours or (d)ays, e.g. 12h, 2d",
|
|
4354
|
-
"name": "duration",
|
|
4355
|
-
"hasDynamicHelp": false,
|
|
4356
|
-
"multiple": false,
|
|
4357
|
-
"type": "option"
|
|
4358
|
-
}
|
|
4359
|
-
},
|
|
4360
|
-
"hasDynamicHelp": false,
|
|
4361
|
-
"hiddenAliases": [],
|
|
4362
|
-
"id": "support",
|
|
4363
|
-
"pluginAlias": "balena-cli",
|
|
4364
|
-
"pluginName": "balena-cli",
|
|
4365
|
-
"pluginType": "core",
|
|
4366
|
-
"strict": true,
|
|
4367
|
-
"enableJsonFlag": false,
|
|
4368
|
-
"authenticated": true,
|
|
4369
|
-
"isESM": false,
|
|
4370
|
-
"relativePath": [
|
|
4371
|
-
"build",
|
|
4372
|
-
"commands",
|
|
4373
|
-
"support",
|
|
4374
|
-
"index.js"
|
|
4375
|
-
]
|
|
4376
|
-
},
|
|
4377
4316
|
"ssh-key:add": {
|
|
4378
4317
|
"aliases": [],
|
|
4379
4318
|
"args": {
|
|
@@ -4509,6 +4448,114 @@
|
|
|
4509
4448
|
"rm.js"
|
|
4510
4449
|
]
|
|
4511
4450
|
},
|
|
4451
|
+
"support": {
|
|
4452
|
+
"aliases": [],
|
|
4453
|
+
"args": {
|
|
4454
|
+
"action": {
|
|
4455
|
+
"description": "enable|disable support access",
|
|
4456
|
+
"name": "action",
|
|
4457
|
+
"options": [
|
|
4458
|
+
"enable",
|
|
4459
|
+
"disable"
|
|
4460
|
+
]
|
|
4461
|
+
}
|
|
4462
|
+
},
|
|
4463
|
+
"description": "Grant or revoke support access for devices or fleets.\n\nGrant or revoke balena support agent access to devices or fleets\non balenaCloud. (This command does not apply to openBalena.)\nAccess will be automatically revoked once the specified duration has elapsed.\n\nDuration defaults to 24h, but can be specified using --duration flag in days\nor hours, e.g. '12h', '2d'.\n\nBoth --device and --fleet flags accept multiple values, specified as\na comma-separated list (with no spaces).\n\nFleets may be specified by fleet name or slug. Fleet slugs are\nthe recommended option, as they are unique and unambiguous. Slugs can be\nlisted with the `balena fleet list` command. Note that slugs may change if the\nfleet is renamed. Fleet names are not unique and may result in \"Fleet is\nambiguous\" errors at any time (even if it \"used to work in the past\"), for\nexample if the name clashes with a newly created public fleet, or with fleets\nfrom other balena accounts that you may be invited to join under any role.\nFor this reason, fleet names are especially discouraged in scripts (e.g. CI\nenvironments).",
|
|
4464
|
+
"examples": [
|
|
4465
|
+
"balena support enable --device ab346f,cd457a --duration 3d",
|
|
4466
|
+
"balena support enable --fleet myFleet --duration 12h",
|
|
4467
|
+
"balena support disable -f myorg/myfleet"
|
|
4468
|
+
],
|
|
4469
|
+
"flags": {
|
|
4470
|
+
"device": {
|
|
4471
|
+
"char": "d",
|
|
4472
|
+
"description": "comma-separated list (no spaces) of device UUIDs",
|
|
4473
|
+
"name": "device",
|
|
4474
|
+
"hasDynamicHelp": false,
|
|
4475
|
+
"multiple": false,
|
|
4476
|
+
"type": "option"
|
|
4477
|
+
},
|
|
4478
|
+
"fleet": {
|
|
4479
|
+
"char": "f",
|
|
4480
|
+
"description": "comma-separated list (no spaces) of fleet names or slugs (preferred)",
|
|
4481
|
+
"name": "fleet",
|
|
4482
|
+
"hasDynamicHelp": false,
|
|
4483
|
+
"multiple": false,
|
|
4484
|
+
"type": "option"
|
|
4485
|
+
},
|
|
4486
|
+
"duration": {
|
|
4487
|
+
"char": "t",
|
|
4488
|
+
"description": "length of time to enable support for, in (h)ours or (d)ays, e.g. 12h, 2d",
|
|
4489
|
+
"name": "duration",
|
|
4490
|
+
"hasDynamicHelp": false,
|
|
4491
|
+
"multiple": false,
|
|
4492
|
+
"type": "option"
|
|
4493
|
+
}
|
|
4494
|
+
},
|
|
4495
|
+
"hasDynamicHelp": false,
|
|
4496
|
+
"hiddenAliases": [],
|
|
4497
|
+
"id": "support",
|
|
4498
|
+
"pluginAlias": "balena-cli",
|
|
4499
|
+
"pluginName": "balena-cli",
|
|
4500
|
+
"pluginType": "core",
|
|
4501
|
+
"strict": true,
|
|
4502
|
+
"enableJsonFlag": false,
|
|
4503
|
+
"authenticated": true,
|
|
4504
|
+
"isESM": false,
|
|
4505
|
+
"relativePath": [
|
|
4506
|
+
"build",
|
|
4507
|
+
"commands",
|
|
4508
|
+
"support",
|
|
4509
|
+
"index.js"
|
|
4510
|
+
]
|
|
4511
|
+
},
|
|
4512
|
+
"util:available-drives": {
|
|
4513
|
+
"aliases": [],
|
|
4514
|
+
"args": {},
|
|
4515
|
+
"description": "List available drives.\n\nList available drives which are usable for writing an OS image to.\nDoes not list system drives.",
|
|
4516
|
+
"flags": {},
|
|
4517
|
+
"hasDynamicHelp": false,
|
|
4518
|
+
"hiddenAliases": [],
|
|
4519
|
+
"id": "util:available-drives",
|
|
4520
|
+
"pluginAlias": "balena-cli",
|
|
4521
|
+
"pluginName": "balena-cli",
|
|
4522
|
+
"pluginType": "core",
|
|
4523
|
+
"strict": true,
|
|
4524
|
+
"enableJsonFlag": false,
|
|
4525
|
+
"offlineCompatible": true,
|
|
4526
|
+
"isESM": false,
|
|
4527
|
+
"relativePath": [
|
|
4528
|
+
"build",
|
|
4529
|
+
"commands",
|
|
4530
|
+
"util",
|
|
4531
|
+
"available-drives.js"
|
|
4532
|
+
]
|
|
4533
|
+
},
|
|
4534
|
+
"whoami": {
|
|
4535
|
+
"aliases": [],
|
|
4536
|
+
"args": {},
|
|
4537
|
+
"description": "Display account information for current user.\n\nGet the username and email address of the currently logged in user.",
|
|
4538
|
+
"examples": [
|
|
4539
|
+
"$ balena whoami"
|
|
4540
|
+
],
|
|
4541
|
+
"flags": {},
|
|
4542
|
+
"hasDynamicHelp": false,
|
|
4543
|
+
"hiddenAliases": [],
|
|
4544
|
+
"id": "whoami",
|
|
4545
|
+
"pluginAlias": "balena-cli",
|
|
4546
|
+
"pluginName": "balena-cli",
|
|
4547
|
+
"pluginType": "core",
|
|
4548
|
+
"strict": true,
|
|
4549
|
+
"enableJsonFlag": false,
|
|
4550
|
+
"authenticated": true,
|
|
4551
|
+
"isESM": false,
|
|
4552
|
+
"relativePath": [
|
|
4553
|
+
"build",
|
|
4554
|
+
"commands",
|
|
4555
|
+
"whoami",
|
|
4556
|
+
"index.js"
|
|
4557
|
+
]
|
|
4558
|
+
},
|
|
4512
4559
|
"tag:list": {
|
|
4513
4560
|
"aliases": [],
|
|
4514
4561
|
"args": {},
|
|
@@ -4728,54 +4775,7 @@
|
|
|
4728
4775
|
"tag",
|
|
4729
4776
|
"set.js"
|
|
4730
4777
|
]
|
|
4731
|
-
},
|
|
4732
|
-
"util:available-drives": {
|
|
4733
|
-
"aliases": [],
|
|
4734
|
-
"args": {},
|
|
4735
|
-
"description": "List available drives.\n\nList available drives which are usable for writing an OS image to.\nDoes not list system drives.",
|
|
4736
|
-
"flags": {},
|
|
4737
|
-
"hasDynamicHelp": false,
|
|
4738
|
-
"hiddenAliases": [],
|
|
4739
|
-
"id": "util:available-drives",
|
|
4740
|
-
"pluginAlias": "balena-cli",
|
|
4741
|
-
"pluginName": "balena-cli",
|
|
4742
|
-
"pluginType": "core",
|
|
4743
|
-
"strict": true,
|
|
4744
|
-
"enableJsonFlag": false,
|
|
4745
|
-
"offlineCompatible": true,
|
|
4746
|
-
"isESM": false,
|
|
4747
|
-
"relativePath": [
|
|
4748
|
-
"build",
|
|
4749
|
-
"commands",
|
|
4750
|
-
"util",
|
|
4751
|
-
"available-drives.js"
|
|
4752
|
-
]
|
|
4753
|
-
},
|
|
4754
|
-
"whoami": {
|
|
4755
|
-
"aliases": [],
|
|
4756
|
-
"args": {},
|
|
4757
|
-
"description": "Display account information for current user.\n\nGet the username and email address of the currently logged in user.",
|
|
4758
|
-
"examples": [
|
|
4759
|
-
"$ balena whoami"
|
|
4760
|
-
],
|
|
4761
|
-
"flags": {},
|
|
4762
|
-
"hasDynamicHelp": false,
|
|
4763
|
-
"hiddenAliases": [],
|
|
4764
|
-
"id": "whoami",
|
|
4765
|
-
"pluginAlias": "balena-cli",
|
|
4766
|
-
"pluginName": "balena-cli",
|
|
4767
|
-
"pluginType": "core",
|
|
4768
|
-
"strict": true,
|
|
4769
|
-
"enableJsonFlag": false,
|
|
4770
|
-
"authenticated": true,
|
|
4771
|
-
"isESM": false,
|
|
4772
|
-
"relativePath": [
|
|
4773
|
-
"build",
|
|
4774
|
-
"commands",
|
|
4775
|
-
"whoami",
|
|
4776
|
-
"index.js"
|
|
4777
|
-
]
|
|
4778
4778
|
}
|
|
4779
4779
|
},
|
|
4780
|
-
"version": "23.
|
|
4780
|
+
"version": "23.2.0"
|
|
4781
4781
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balena-cli",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.2.0",
|
|
4
4
|
"description": "The official balena Command Line Interface",
|
|
5
5
|
"main": "./build/app.js",
|
|
6
6
|
"homepage": "https://github.com/balena-io/balena-cli",
|
|
@@ -262,6 +262,6 @@
|
|
|
262
262
|
"balena-request": "14.0.6"
|
|
263
263
|
},
|
|
264
264
|
"versionist": {
|
|
265
|
-
"publishedAt": "2025-11-
|
|
265
|
+
"publishedAt": "2025-11-20T17:40:23.372Z"
|
|
266
266
|
}
|
|
267
267
|
}
|
package/src/help.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import type { Command
|
|
17
|
+
import type { Command } from '@oclif/core';
|
|
18
18
|
import { Help } from '@oclif/core';
|
|
19
19
|
import * as indent from 'indent-string';
|
|
20
20
|
import type { ResolvableReturnType } from 'balena-sdk/typings/utils';
|
|
@@ -38,47 +38,13 @@ function getHelpSubject(args: string[]): string | undefined {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// See: https://github.com/oclif/core/blob/
|
|
41
|
+
// See: https://github.com/oclif/core/blob/4.8.0/src/help/index.ts#L54
|
|
42
42
|
export default class BalenaHelp extends Help {
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
protected get sortedCommands(): Command.Loadable[] {
|
|
46
|
-
const commands = super.sortedCommands;
|
|
47
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
48
|
-
return commands;
|
|
49
|
-
}
|
|
50
|
-
// Assign it to a const so that TS knows that this can't change to null during the .filter
|
|
51
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
52
|
-
// This is excluding all commands with a depth higher than the SUPPRESS_SUBTOPICS_DEPTH
|
|
53
|
-
// so that when the base `showCommandHelp` is called and it accesses this.sortedCommands
|
|
54
|
-
// it will not find any sub-commands and hence will not print them.
|
|
55
|
-
// https://github.com/oclif/core/blob/v1.16.4/src/help/index.ts#L137-L138
|
|
56
|
-
// eg: when doing `balena device --help`, which has a depth of 1, this will omit commands
|
|
57
|
-
// like 'device:deactivate', 'device:init' etc since they have depth of 2.
|
|
58
|
-
return commands.filter((c) => c.id.split(':').length <= depth);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
protected get sortedTopics(): Interfaces.Topic[] {
|
|
62
|
-
const topics = super.sortedTopics;
|
|
63
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
64
|
-
return topics;
|
|
65
|
-
}
|
|
66
|
-
// Assign it to a const so that TS knows that this can't change to null during the .filter
|
|
67
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
68
|
-
// This is excluding all topics with a depth higher than the SUPPRESS_SUBTOPICS_DEPTH
|
|
69
|
-
// so that when the base `showCommandHelp` is called and it accesses this.sortedTopics
|
|
70
|
-
// it will not find any sub-topics and hence will not print them.
|
|
71
|
-
// https://github.com/oclif/core/blob/v1.16.4/src/help/index.ts#L137-L138
|
|
72
|
-
// We atm do not have any-sub-topic to give an example for
|
|
73
|
-
return topics.filter((t) => t.name.split(':').length <= depth);
|
|
74
|
-
}
|
|
43
|
+
private formatCommandsTitle: string | null = null;
|
|
75
44
|
|
|
76
45
|
public async showCommandHelp(command: Command.Loadable): Promise<void> {
|
|
77
|
-
|
|
78
|
-
const depth = name.split(':').length;
|
|
79
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = depth;
|
|
46
|
+
this.formatCommandsTitle = 'SUB COMMANDS';
|
|
80
47
|
await super.showCommandHelp(command);
|
|
81
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = null;
|
|
82
48
|
}
|
|
83
49
|
|
|
84
50
|
public async showHelp(argv: string[]) {
|
|
@@ -252,6 +218,10 @@ See: https://git.io/JRHUW#deprecation-policy`,
|
|
|
252
218
|
},
|
|
253
219
|
);
|
|
254
220
|
|
|
221
|
+
if (this.formatCommandsTitle) {
|
|
222
|
+
this.log(this.formatCommandsTitle);
|
|
223
|
+
this.formatCommandsTitle = null;
|
|
224
|
+
}
|
|
255
225
|
return indent(body, 2);
|
|
256
226
|
}
|
|
257
227
|
|