Cli

Functions

Functions

registerAuthCommands

Register auth commands on a commander program

Signature:

registerAuthCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

registerServerProfileCommands

Register server management commands on a commander program

Signature:

registerServerProfileCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

createLogger

Create a default logging service instance

Signature:

createLogger(config?: Partial<LoggingConfig> | undefined): LoggingService

Parameters:

ParameterTypeRequiredDescription
configPartial<LoggingConfig> | undefinedNo

Returns:

LoggingService -

getConfigDir

Get the FlowState config directory path

Signature:

getConfigDir(): string

Returns:

string -

getConfigPath

Get the CLI config file path

Signature:

getConfigPath(): string

Returns:

string -

getTemplate

Signature:

getTemplate(type: string): ProjectTypeTemplate

Parameters:

ParameterTypeRequiredDescription
typestringYes

Returns:

ProjectTypeTemplate -

createHttpRxDBClient

Create an HTTP RxDB client from init options Defaults: localhost:7080, epic-flow-dev domain, dev-token auth

Signature:

createHttpRxDBClient(options: { rxdbUrl?: string; rxdbToken?: string; rxdbDomain?: string; }): HttpRxDBClient

Parameters:

ParameterTypeRequiredDescription
options{ rxdbUrl?: string; rxdbToken?: string; rxdbDomain?: string; }Yes

Returns:

HttpRxDBClient -

validateJson

Validate JSON string and return detailed error info

Signature:

validateJson(jsonString: string): JsonValidationResult

Parameters:

ParameterTypeRequiredDescription
jsonStringstringYes

Returns:

JsonValidationResult -

formatJsonError

Format validation error for CLI output

Signature:

formatJsonError(error: JsonValidationError): string

Parameters:

ParameterTypeRequiredDescription
errorJsonValidationErrorYes

Returns:

string -

parseJsonWithValidation

Parse JSON with detailed error reporting

Signature:

parseJsonWithValidation(jsonString: string, context?: string | undefined): any

Parameters:

ParameterTypeRequiredDescription
jsonStringstringYes
contextstring | undefinedNo

Returns:

any -

registerConfigCommands

Register all config commands

Signature:

registerConfigCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

loadFlowStateConfig

Load FlowState configuration from file

Signature:

loadFlowStateConfig(): Promise<FlowStateConfig>

Returns:

Promise<FlowStateConfig> -

saveFlowStateConfig

Save FlowState configuration to file

Signature:

saveFlowStateConfig(config: FlowStateConfig): Promise<void>

Parameters:

ParameterTypeRequiredDescription
configFlowStateConfigYes

Returns:

Promise<void> -

loadObsConfig

Load observability configuration from environment or FlowState config

Signature:

loadObsConfig(): Promise<ObsConfig>

Returns:

Promise<ObsConfig> -

getObsClient

Get configured ObsClient instance

Signature:

getObsClient(): Promise<ObsClient>

Returns:

Promise<ObsClient> -

getDefaultProjectId

Get default project ID from configuration

Signature:

getDefaultProjectId(): Promise<string | undefined>

Returns:

Promise<string \| undefined> -

setObsConfig

Set observability configuration value

Signature:

setObsConfig(key: string, value: string): Promise<void>

Parameters:

ParameterTypeRequiredDescription
keystringYes
valuestringYes

Returns:

Promise<void> -

registerErrorCommands

Register all error commands

Signature:

registerErrorCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

listErrors

List errors with filters

Signature:

listErrors(options: ListErrorsOptions): Promise<void>

Parameters:

ParameterTypeRequiredDescription
optionsListErrorsOptionsYes

Returns:

Promise<void> -

parseTimestamp

Shared helper functions for observability commands

Signature:

parseTimestamp(value: string): number

Parameters:

ParameterTypeRequiredDescription
valuestringYes

Returns:

number -

formatTimestamp

Format timestamp for display

Signature:

formatTimestamp(timestamp: number): string

Parameters:

ParameterTypeRequiredDescription
timestampnumberYes

Returns:

string -

truncate

Truncate string to maximum length with ellipsis

Signature:

truncate(str: string, maxLength: number): string

Parameters:

ParameterTypeRequiredDescription
strstringYes
maxLengthnumberYes

Returns:

string -

resolveProjectId

Resolve project ID from option or default configuration

Signature:

resolveProjectId(getDefaultProjectId: () => Promise<string | null>, optionProjectId?: string | undefined): Promise<string>

Parameters:

ParameterTypeRequiredDescription
getDefaultProjectId() => Promise<string | null>Yes
optionProjectIdstring | undefinedNo

Returns:

Promise<string> -

registerLogCommands

Register all log commands

Signature:

registerLogCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

registerSessionCommands

Register all session commands

Signature:

registerSessionCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

registerTailCommand

Register tail command

Signature:

registerTailCommand(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes

tailEvents

Tail events in real-time

Signature:

tailEvents(options: TailOptions): Promise<void>

Parameters:

ParameterTypeRequiredDescription
optionsTailOptionsYes

Returns:

Promise<void> -

createTokenCommand

Register the 'token create' command

Creates a new service token with specified permissions and TTL. Supports output to stdout or 1Password for secure storage.

Signature:

createTokenCommand(parent: Command): void

Parameters:

ParameterTypeRequiredDescription
parentCommandYes- Parent commander command to attach this subcommand to

registerTokenCommands

Register token commands on a commander program

Adds the 'token' command group with subcommands for managing service tokens. Service tokens enable server-to-server authentication.

Signature:

registerTokenCommands(program: Command): void

Parameters:

ParameterTypeRequiredDescription
programCommandYes- Commander program instance to register commands on

listTokenCommand

Register the 'token list' command

Lists all service tokens in a formatted table view. Requires OAuth authentication to access token data from RxDB server.

Signature:

listTokenCommand(parent: Command): void

Parameters:

ParameterTypeRequiredDescription
parentCommandYes- Parent commander command to attach this subcommand to

revokeTokenCommand

Register the 'token revoke' command

Revokes a service token by adding it to the revocation list on RxDB server. Includes confirmation prompt for safety unless --force flag is provided.

Signature:

revokeTokenCommand(parent: Command): void

Parameters:

ParameterTypeRequiredDescription
parentCommandYes- Parent commander command to attach this subcommand to
Previous
Classes