package commands

import "github.com/docker/cli/internal/commands"

Index

Functions

func Commands

func Commands() []func(command.Cli) *cobra.Command

Commands returns the internal queue holding registered commands added via Register and RegisterLegacy.

func Register

func Register(f func(command.Cli) *cobra.Command)

Register pushes the passed in command into an internal queue which can be retrieved using the Commands function. It is designed to be called in an init function and is not safe for concurrent use.

func RegisterLegacy

func RegisterLegacy(f func(command.Cli) *cobra.Command)

RegisterLegacy functions similarly to Register, but it checks the "DOCKER_HIDE_LEGACY_COMMANDS" environment variable and if it has been set and is non-empty, the command will be hidden. It is designed to be called in an init function and is not safe for concurrent use.

Source Files

commands.go

Version
v29.4.2+incompatible (latest)
Published
Apr 20, 2026
Platform
linux/amd64
Imports
3 packages
Last checked
7 hours ago

Tools for package owners.