Add key list alias for keys command

Change-type: minor
This commit is contained in:
myarmolinsky 2024-09-24 13:56:06 -04:00
parent 3615f8e525
commit 6b5c6e072b
11 changed files with 40 additions and 32 deletions

View File

@ -59,7 +59,6 @@ const commandHeadings: { [key: string]: string } = {
envs: 'Environment Variables',
help: 'Help and Version',
key: 'SSH Keys',
keys: 'SSH Keys',
orgs: 'Organizations',
os: 'OS',
util: 'Utilities',

View File

@ -8,7 +8,7 @@ _balena() {
local context state line curcontext="$curcontext"
# Valid top-level completions
main_commands=( api-key app block build config deploy device devices env envs fleet internal join key keys leave local login logout logs notes orgs os preload push release scan settings ssh support tag tags tunnel util version whoami )
main_commands=( api-key app block build config deploy device devices env envs fleet internal join key leave local login logout logs notes orgs os preload push release scan settings ssh support tag tags tunnel util version whoami )
# Sub-completions
api_key_cmds=( generate list revoke )
app_cmds=( create )
@ -19,7 +19,7 @@ _balena() {
env_cmds=( add rename rm )
fleet_cmds=( create list pin purge rename restart rm track-latest )
internal_cmds=( osinit )
key_cmds=( add rm )
key_cmds=( add list rm )
local_cmds=( configure flash )
os_cmds=( build-config configure download initialize versions )
release_cmds=( finalize invalidate list validate )

View File

@ -7,7 +7,7 @@ _balena_complete()
local cur prev
# Valid top-level completions
main_commands="api-key app block build config deploy device devices env envs fleet internal join key keys leave local login logout logs notes orgs os preload push release scan settings ssh support tag tags tunnel util version whoami"
main_commands="api-key app block build config deploy device devices env envs fleet internal join key leave local login logout logs notes orgs os preload push release scan settings ssh support tag tags tunnel util version whoami"
# Sub-completions
api_key_cmds="generate list revoke"
app_cmds="create"
@ -18,7 +18,7 @@ _balena_complete()
env_cmds="add rename rm"
fleet_cmds="create list pin purge rename restart rm track-latest"
internal_cmds="osinit"
key_cmds="add rm"
key_cmds="add list rm"
local_cmds="configure flash"
os_cmds="build-config configure download initialize versions"
release_cmds="finalize invalidate list validate"

View File

@ -296,8 +296,8 @@ are encouraged to regularly update the balena CLI to the latest version.
- [key add](#key-add)
- [key](#key)
- [key list](#key-list)
- [key rm](#key-rm)
- [keys](#keys)
- Support
@ -3723,6 +3723,25 @@ balenaCloud ID for the SSH key
### Options
## key list
### Aliases
- `keys`
To use one of the aliases, replace `key list` with the alias.
### Description
List all SSH keys registered in balenaCloud for the logged in user.
Examples:
$ balena key list
### Options
## key rm
### Description
@ -3748,18 +3767,6 @@ balenaCloud ID for the SSH key
answer "yes" to all questions (non interactive use)
## keys
### Description
List all SSH keys registered in balenaCloud for the logged in user.
Examples:
$ balena keys
### Options
# Support
## support

View File

@ -19,13 +19,15 @@ import { Command } from '@oclif/core';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
export default class KeysCmd extends Command {
export default class KeyListCmd extends Command {
public static aliases = ['keys'];
public static description = stripIndent`
List the SSH keys in balenaCloud.
List all SSH keys registered in balenaCloud for the logged in user.
`;
public static examples = ['$ balena keys'];
public static examples = ['$ balena key list'];
public static flags = {
help: cf.help,
@ -34,7 +36,7 @@ export default class KeysCmd extends Command {
public static authenticated = true;
public async run() {
await this.parse(KeysCmd);
await this.parse(KeyListCmd);
const keys = await getBalenaSdk().models.key.getAll();

View File

@ -72,8 +72,8 @@ ADDITIONAL COMMANDS
envs list the environment or config variables of an application, device or service
key <id> display an SSH key
key add <name> [path] add an SSH key to balenaCloud
key list list the SSH keys in balenaCloud
key rm <id> remove an SSH key from balenaCloud
keys list the SSH keys in balenaCloud
local configure <target> (Re)configure a balenaOS drive or image
local flash <image> flash an image to a drive
logout logout from balena

View File

@ -180,10 +180,10 @@
%2: build/commands/key/index.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/key/rm.js
%2: build/commands/key/list.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/keys/index.js
%2: build/commands/key/rm.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/leave/index.js

View File

@ -180,10 +180,10 @@
%2: build/commands/key/index.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/key/rm.js
%2: build/commands/key/list.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/keys/index.js
%2: build/commands/key/rm.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/leave/index.js

View File

@ -180,10 +180,10 @@
%2: build/commands/key/index.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/key/rm.js
%2: build/commands/key/list.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/keys/index.js
%2: build/commands/key/rm.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/leave/index.js

View File

@ -180,10 +180,10 @@
%2: build/commands/key/index.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/key/rm.js
%2: build/commands/key/list.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/keys/index.js
%2: build/commands/key/rm.js
> Warning Entry 'main' not found in %1
%1: node_modules/@oclif/core/package.json
%2: build/commands/leave/index.js

View File

@ -180,10 +180,10 @@
%2: build\commands\key\index.js
> Warning Entry 'main' not found in %1
%1: node_modules\@oclif\core\package.json
%2: build\commands\key\rm.js
%2: build\commands\key\list.js
> Warning Entry 'main' not found in %1
%1: node_modules\@oclif\core\package.json
%2: build\commands\keys\index.js
%2: build\commands\key\rm.js
> Warning Entry 'main' not found in %1
%1: node_modules\@oclif\core\package.json
%2: build\commands\leave\index.js