# KeyAction | opentoken
Documentation for opentoken

### Hierarchy

- CommandLineAction
  - KeyAction

## Index

### Constructors

- constructor

### Properties

- _generate
- _privkey
- _pubkey
- actionName
- documentation
- summary

### Accessors

- parameters
- remainder

### Methods

- defineChoiceParameter
- defineCommandLineRemainder
- defineFlagParameter
- defineIntegerParameter
- defineStringListParameter
- defineStringParameter
- getChoiceParameter
- getFlagParameter
- getIntegerParameter
- getStringListParameter
- getStringParameter
- onDefineParameters
- onExecute
- renderHelpText

## Constructors

### constructor

- new KeyAction(): KeyAction

- Overrides CommandLineAction.__constructor

  - Defined in src/cli/KeyAction.ts:27

  #### Returns KeyAction

## Properties

### Private _generate

_generate: CommandLineFlagParameter

- Defined in src/cli/KeyAction.ts:25

### Private _privkey

_privkey: CommandLineStringParameter

- Defined in src/cli/KeyAction.ts:27

### Private _pubkey

_pubkey: CommandLineStringParameter

- Defined in src/cli/KeyAction.ts:26

### Readonly actionName

actionName: string

Inherited from KeyAction.actionName

- Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:25

{@inheritDoc ICommandLineActionOptions.actionName}

### Readonly documentation

documentation: string

Inherited from KeyAction.documentation

- Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:29

{@inheritDoc ICommandLineActionOptions.documentation}

### Readonly summary

summary: string

Inherited from KeyAction.summary

- Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:27

{@inheritDoc ICommandLineActionOptions.summary}

## Accessors

### parameters

- get parameters(): ReadonlyArray<CommandLineParameter>

- Inherited from KeyAction.parameters

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:229

  Returns a collection of the parameters that were defined for this object.

  #### Returns ReadonlyArray<CommandLineParameter>

### remainder

- get remainder(): CommandLineRemainder | undefined

- Inherited from KeyAction.remainder

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:234

  If {@link CommandLineParameterProvider.defineCommandLineRemainder} was called, this object captures any remaining command line arguments after the recognized portion.

  #### Returns CommandLineRemainder | undefined

## Methods

### defineChoiceParameter

- defineChoiceParameter(definition: ICommandLineChoiceDefinition): CommandLineChoiceParameter

- Inherited from KeyAction.defineChoiceParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:245

  Defines a command-line parameter whose value must be a string from a fixed set of allowable choices (similar to an enum).

  remarks

    Example of a choice parameter:

        example-tool --log-level warn

  #### Parameters

  - ##### definition: ICommandLineChoiceDefinition

  #### Returns CommandLineChoiceParameter

### defineCommandLineRemainder

- defineCommandLineRemainder(definition: ICommandLineRemainderDefinition): CommandLineRemainder

- Inherited from KeyAction.defineCommandLineRemainder

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:327

  Defines a rule that captures any remaining command line arguments after the recognized portion.

  remarks

    This feature is useful for commands that pass their arguments along to an external tool, relying on that tool to perform validation. (It could also be used to parse parameters without any validation or documentation, but that is not recommended.)

    Example of capturing the remainder after an optional flag parameter.

        example-tool --my-flag this is the remainder

    In the "--help" documentation, the remainder rule will be represented as "...".

  #### Parameters

  - ##### definition: ICommandLineRemainderDefinition

  #### Returns CommandLineRemainder

### defineFlagParameter

- defineFlagParameter(definition: ICommandLineFlagDefinition): CommandLineFlagParameter

- Inherited from KeyAction.defineFlagParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:262

  Defines a command-line switch whose boolean value is true if the switch is provided, and false otherwise.

  remarks

    Example usage of a flag parameter:

        example-tool --debug

  #### Parameters

  - ##### definition: ICommandLineFlagDefinition

  #### Returns CommandLineFlagParameter

### defineIntegerParameter

- defineIntegerParameter(definition: ICommandLineIntegerDefinition): CommandLineIntegerParameter

- Inherited from KeyAction.defineIntegerParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:278

  Defines a command-line parameter whose argument is an integer.

  remarks

    Example usage of an integer parameter:

        example-tool --max-attempts 5

  #### Parameters

  - ##### definition: ICommandLineIntegerDefinition

  #### Returns CommandLineIntegerParameter

### defineStringListParameter

- defineStringListParameter(definition: ICommandLineStringListDefinition): CommandLineStringListParameter

- Inherited from KeyAction.defineStringListParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:311

  Defines a command-line parameter whose argument is a single text string. The parameter can be specified multiple times to build a list.

  remarks

    Example usage of a string list parameter:

        example-tool --add file1.txt --add file2.txt --add file3.txt

  #### Parameters

  - ##### definition: ICommandLineStringListDefinition

  #### Returns CommandLineStringListParameter

### defineStringParameter

- defineStringParameter(definition: ICommandLineStringDefinition): CommandLineStringParameter

- Inherited from KeyAction.defineStringParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:294

  Defines a command-line parameter whose argument is a single text string.

  remarks

    Example usage of a string parameter:

        example-tool --message "Hello, world!"

  #### Parameters

  - ##### definition: ICommandLineStringDefinition

  #### Returns CommandLineStringParameter

### getChoiceParameter

- getChoiceParameter(parameterLongName: string): CommandLineChoiceParameter

- Inherited from KeyAction.getChoiceParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:251

  Returns the CommandLineChoiceParameter with the specified long name.

  remarks

    This method throws an exception if the parameter is not defined.

  #### Parameters

  - ##### parameterLongName: string

  #### Returns CommandLineChoiceParameter

### getFlagParameter

- getFlagParameter(parameterLongName: string): CommandLineFlagParameter

- Inherited from KeyAction.getFlagParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:268

  Returns the CommandLineFlagParameter with the specified long name.

  remarks

    This method throws an exception if the parameter is not defined.

  #### Parameters

  - ##### parameterLongName: string

  #### Returns CommandLineFlagParameter

### getIntegerParameter

- getIntegerParameter(parameterLongName: string): CommandLineIntegerParameter

- Inherited from KeyAction.getIntegerParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:284

  Returns the CommandLineIntegerParameter with the specified long name.

  remarks

    This method throws an exception if the parameter is not defined.

  #### Parameters

  - ##### parameterLongName: string

  #### Returns CommandLineIntegerParameter

### getStringListParameter

- getStringListParameter(parameterLongName: string): CommandLineStringListParameter

- Inherited from KeyAction.getStringListParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:333

  Returns the CommandLineStringListParameter with the specified long name.

  remarks

    This method throws an exception if the parameter is not defined.

  #### Parameters

  - ##### parameterLongName: string

  #### Returns CommandLineStringListParameter

### getStringParameter

- getStringParameter(parameterLongName: string): CommandLineStringParameter

- Inherited from KeyAction.getStringParameter

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:300

  Returns the CommandLineStringParameter with the specified long name.

  remarks

    This method throws an exception if the parameter is not defined.

  #### Parameters

  - ##### parameterLongName: string

  #### Returns CommandLineStringParameter

### Protected onDefineParameters

- onDefineParameters(): void

- Overrides CommandLineAction.onDefineParameters

  - Defined in src/cli/KeyAction.ts:44

  #### Returns void

### Protected onExecute

- onExecute(): Promise<void>

- Overrides CommandLineAction.onExecute

  - Defined in src/cli/KeyAction.ts:38

  #### Returns Promise<void>

### renderHelpText

- renderHelpText(): string

- Inherited from KeyAction.renderHelpText

  - Defined in node_modules/@rushstack/ts-command-line/dist/ts-command-line.d.ts:337

  Generates the command-line help text.

  #### Returns string

Generated using TypeDoc