{"modulePath":"github.1485827954.workers.dev/docker/cli","version":"v29.10.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package manager\n\n## Functions\n\n```go\nfunc AddPluginCommandStubs(dockerCLI config.Provider, rootCmd *cobra.Command) (err error)\n```\nAddPluginCommandStubs adds a stub cobra.Commands for each valid and invalid plugin. The command stubs will have several annotations added, see \\`CommandAnnotationPlugin\\*\\`.\n\n```go\nfunc IsPluginCommand(cmd *cobra.Command) bool\n```\nIsPluginCommand checks if the given cmd is a plugin-stub.\n\n```go\nfunc PluginRunCommand(dockerCli config.Provider, name string, rootcmd *cobra.Command) (*exec.Cmd, error)\n```\nPluginRunCommand returns an [os/exec.Cmd](/os/exec#Cmd) which when [os/exec.Cmd.Run](/os/exec#Cmd.Run) will execute the named plugin. The rootcmd argument is referenced to determine the set of builtin commands in order to detect conflicts. The error returned satisfies the [errdefs.IsNotFound](/github.com/containerd/errdefs#IsNotFound) predicate if no plugin was found or if the first candidate plugin was invalid somehow.\n\n```go\nfunc RunCLICommandHooks(ctx context.Context, dockerCLI config.Provider, rootCmd, subCommand *cobra.Command, cmdErrorMessage string)\n```\nRunCLICommandHooks is the entrypoint into the hooks execution flow after a main CLI command was executed. It calls the hook subcommand for all present CLI plugins that declare support for hooks in their metadata and parses/prints their responses.\n\n```go\nfunc RunPluginHooks(ctx context.Context, dockerCLI config.Provider, rootCmd, subCommand *cobra.Command, args []string, cmdErrorMessage string)\n```\nRunPluginHooks is the entrypoint for the hooks execution flow after a plugin command was just executed by the CLI.\n\n## Types\n\n```go\ntype HookPluginData = hooks.Request\n```\nHookPluginData is the type representing the information that plugins declaring support for hooks get passed when being invoked following a CLI command execution.\n\nDeprecated: use [hooks.Request](/github.com/docker/cli/cli-plugins/hooks#Request) instead.\n\n```go\ntype Plugin struct {\n\tmetadata.Metadata\n\n\tName string `json:\",omitempty\"`\n\tPath string `json:\",omitempty\"`\n\n\t// Err is non-nil if the plugin failed one of the candidate tests.\n\tErr error `json:\",omitempty\"`\n\n\t// ShadowedPaths contains the paths of any other plugins which this plugin takes precedence over.\n\tShadowedPaths []string `json:\",omitempty\"`\n}\n```\nPlugin represents a potential plugin with all it's metadata.\n\n```go\nfunc GetPlugin(name string, dockerCLI config.Provider, rootcmd *cobra.Command) (*Plugin, error)\n```\nGetPlugin returns a plugin on the system by its name\n\n```go\nfunc ListPlugins(dockerCli config.Provider, rootcmd *cobra.Command) ([]Plugin, error)\n```\nListPlugins produces a list of the plugins available on the system\n\n```go\nfunc (p *Plugin) MarshalJSON() ([]byte, error)\n```\nMarshalJSON implements [json.Marshaler](/encoding/json#Marshaler) to handle marshaling the [Plugin.Err](#Plugin.Err) field (Go doesn't marshal errors by default).\n\n```go\nfunc (p *Plugin) RunHook(ctx context.Context, hookData hooks.Request) ([]byte, error)\n```\nRunHook executes the plugin's hooks command and returns its unprocessed output.\n\n","path":"github.1485827954.workers.dev/docker/cli/cli-plugins/manager","name":"manager","synopsis":"","isRedistributable":true}
