Cli
Functions
Functions
registerAuthCommands
Register auth commands on a commander program
Signature:
registerAuthCommands(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
registerServerProfileCommands
Register server management commands on a commander program
Signature:
registerServerProfileCommands(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
createLogger
Create a default logging service instance
Signature:
createLogger(config?: Partial<LoggingConfig> | undefined): LoggingService
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | Partial<LoggingConfig> | undefined | No |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
jsonString | string | Yes |
Returns:
JsonValidationResult -
formatJsonError
Format validation error for CLI output
Signature:
formatJsonError(error: JsonValidationError): string
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
error | JsonValidationError | Yes |
Returns:
string -
parseJsonWithValidation
Parse JSON with detailed error reporting
Signature:
parseJsonWithValidation(jsonString: string, context?: string | undefined): any
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
jsonString | string | Yes | |
context | string | undefined | No |
Returns:
any -
registerConfigCommands
Register all config commands
Signature:
registerConfigCommands(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
config | FlowStateConfig | Yes |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | |
value | string | Yes |
Returns:
Promise<void> -
registerErrorCommands
Register all error commands
Signature:
registerErrorCommands(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
listErrors
List errors with filters
Signature:
listErrors(options: ListErrorsOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ListErrorsOptions | Yes |
Returns:
Promise<void> -
parseTimestamp
Shared helper functions for observability commands
Signature:
parseTimestamp(value: string): number
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
value | string | Yes |
Returns:
number -
formatTimestamp
Format timestamp for display
Signature:
formatTimestamp(timestamp: number): string
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
timestamp | number | Yes |
Returns:
string -
truncate
Truncate string to maximum length with ellipsis
Signature:
truncate(str: string, maxLength: number): string
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
str | string | Yes | |
maxLength | number | Yes |
Returns:
string -
resolveProjectId
Resolve project ID from option or default configuration
Signature:
resolveProjectId(getDefaultProjectId: () => Promise<string | null>, optionProjectId?: string | undefined): Promise<string>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
getDefaultProjectId | () => Promise<string | null> | Yes | |
optionProjectId | string | undefined | No |
Returns:
Promise<string> -
registerLogCommands
Register all log commands
Signature:
registerLogCommands(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
registerSessionCommands
Register all session commands
Signature:
registerSessionCommands(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
registerTailCommand
Register tail command
Signature:
registerTailCommand(program: Command): void
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes |
tailEvents
Tail events in real-time
Signature:
tailEvents(options: TailOptions): Promise<void>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
options | TailOptions | Yes |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
parent | Command | Yes | - 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
program | Command | Yes | - 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
parent | Command | Yes | - 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
parent | Command | Yes | - Parent commander command to attach this subcommand to |