app

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Overview

Package app provides the entry point for the toolhive command-line application.

Index

Constants

View Source
const (
	// FormatJSON is the JSON output format
	FormatJSON = "json"
	// FormatText is the text output format
	FormatText = "text"
)

Output format constants

Variables

View Source
var OtelCmd = &cobra.Command{
	Use:   "otel",
	Short: "Manage OpenTelemetry configuration",
	Long:  "Configure OpenTelemetry settings for observability and monitoring of MCP servers.",
}

OtelCmd is the parent command for OpenTelemetry configuration

Functions

func AddOIDCFlags

func AddOIDCFlags(cmd *cobra.Command)

AddOIDCFlags adds OIDC validation flags to the provided command.

func GetStringFlagOrEmpty

func GetStringFlagOrEmpty(cmd *cobra.Command, flagName string) string

GetStringFlagOrEmpty tries to get the string value of the given flag. If the flag doesn't exist or there's an error, it returns an empty string.

func IsCompletionCommand

func IsCompletionCommand(args []string) bool

IsCompletionCommand checks if the command being run is the completion command

func IsOIDCEnabled

func IsOIDCEnabled(cmd *cobra.Command) bool

IsOIDCEnabled returns true if OIDC validation is enabled for the given command. OIDC validation is considered enabled if either the OIDC issuer or the JWKS URL flag is provided.

func NewRootCmd

func NewRootCmd(enableUpdates bool) *cobra.Command

NewRootCmd creates a new root command for the ToolHive CLI.

func SetSecretsProvider

func SetSecretsProvider(provider secrets.ProviderType) error

SetSecretsProvider sets the secrets provider type in the configuration. It validates the input, tests the provider functionality, and updates the configuration. Choices are `encrypted`, `1password`, and `none`.

func ValidateAndNormaliseHostFlag added in v0.0.34

func ValidateAndNormaliseHostFlag(host string) (string, error)

ValidateAndNormaliseHostFlag validates and normalizes the host flag resolving it to an IP address if hostname is provided

Types

type AuthInfo added in v0.0.40

type AuthInfo struct {
	Realm string
	Type  string
}

AuthInfo contains authentication information extracted from WWW-Authenticate header

Directories

Path Synopsis
Package inspector contains definitions for the inspector command.
Package inspector contains definitions for the inspector command.
Package ui provides terminal UI helpers for the ToolHive CLI.
Package ui provides terminal UI helpers for the ToolHive CLI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL