Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package cli is the wctr command: subcommands in the familiar container CLI grammar (pull, run, ps, logs, rm, rmi, inspect, images) speaking the engine's API, which is compatible with the Docker Engine API.

It is a package so that the command runs anywhere a client can reach a daemon: cmd/wctr over a unix socket, the browser playground in-process through an in-memory transport. It imports no runtime and nothing native, so it also builds for GOOS=wasip1 and GOOS=js.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(code int) error

Exit is a status RunE wants the process to end with (`wctr run` returns the container's).

func Report

func Report(w io.Writer, err error) int

Report prints err the way the command does and returns the exit status.

func RootCmd

func RootCmd(o Options) *cobra.Command

RootCmd builds the command tree.

Types

type Options

type Options struct {
	// Version is what --version and `wctr version` print (default "dev").
	Version string
	// DefaultHost is the -H default (default api.DefaultHost()).
	DefaultHost string
	// Client connects to a host; nil means api.NewClient.
	Client func(host string) (*api.Client, error)
	// LookupEnv resolves `-e KEY` (default os.LookupEnv).
	LookupEnv func(string) (string, bool)
}

Options configure a command tree.

Jump to

Keyboard shortcuts

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