Documentation
¶
Overview ¶
Package app provides the entry point for the toolhive command-line application.
Index ¶
- Constants
- func AddOIDCFlags(cmd *cobra.Command)
- func GetSecretsProviderType(_ *cobra.Command) (secrets.ProviderType, error)
- func GetStringFlagOrEmpty(cmd *cobra.Command, flagName string) string
- func IsCompletionCommand(args []string) bool
- func IsOIDCEnabled(cmd *cobra.Command) bool
- func NeedSecretsPassword(cmd *cobra.Command, secretOptions []string) bool
- func NewRootCmd() *cobra.Command
- func RunMCPServer(ctx context.Context, cmd *cobra.Command, config *runner.RunConfig, ...) error
- func SetSecretsProvider(provider secrets.ProviderType) error
- type ContainerOutput
Constants ¶
const ( // FormatJSON is the JSON output format FormatJSON = "json" // FormatText is the text output format FormatText = "text" )
Output format constants
const ( UVXScheme = "uvx://" NPXScheme = "npx://" GOScheme = "go://" )
Protocol schemes
Variables ¶
This section is empty.
Functions ¶
func AddOIDCFlags ¶
AddOIDCFlags adds OIDC validation flags to the provided command.
func GetSecretsProviderType ¶
func GetSecretsProviderType(_ *cobra.Command) (secrets.ProviderType, error)
GetSecretsProviderType returns the secrets provider type from the command flags
func GetStringFlagOrEmpty ¶
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 ¶
IsCompletionCommand checks if the command being run is the completion command
func IsOIDCEnabled ¶
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 NeedSecretsPassword ¶
NeedSecretsPassword returns true if the secrets provider requires a password.
func NewRootCmd ¶
NewRootCmd creates a new root command for the ToolHive CLI.
func RunMCPServer ¶
func RunMCPServer(ctx context.Context, cmd *cobra.Command, config *runner.RunConfig, foreground bool) error
RunMCPServer runs an MCP server with the specified config
func SetSecretsProvider ¶
func SetSecretsProvider(provider secrets.ProviderType) error
SetSecretsProvider sets the secrets provider type in the configuration. It validates the input and updates the configuration. Choices are `encrypted` and `1password`.
Types ¶
type ContainerOutput ¶
type ContainerOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
State string `json:"state"`
Transport string `json:"transport"`
ToolType string `json:"tool_type,omitempty"`
Port int `json:"port"`
URL string `json:"url"`
}
ContainerOutput represents container information for JSON output