cmd

package
v0.10.15 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package cmd is the `atmee` command line.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is set at build time (-ldflags "-X .../cmd.Version=..."); without that, it is the module version `go install ...@vX.Y.Z` records.

Functions

func Execute

func Execute(args []string, out, errOut io.Writer, in io.Reader) int

Execute runs the CLI and returns the process exit code.

func ExecuteAs

func ExecuteAs(v Variant, args []string, out, errOut io.Writer, in io.Reader) int

ExecuteAs runs the CLI as a variant and returns the process exit code.

func NewRoot

func NewRoot(out, errOut io.Writer, in io.Reader) *cobra.Command

NewRoot builds the command tree.

Types

type CommandFunc

type CommandFunc func(*app) *cobra.Command

CommandFunc builds one command of a build.

type Variant

type Variant struct {
	Name       string // the command's name, in help, usage and hints
	BaseURL    string
	BaseURLEnv string // overrides BaseURL
	HomeFolder string // under the home directory
	HomeEnv    string // overrides HomeFolder
	APIKeyEnv  string
	// Extra are commands only this build has, added beside the shared ones.
	Extra []CommandFunc
}

Variant is one build of this CLI: what it is called, the API it uses by default and where its login lives, so that two builds can share a machine. Each has its own environment variables and reads no other build's, so a shell set up for one can't send its server or key to the other.

Jump to

Keyboard shortcuts

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