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

cli

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package cli implements the global `vukem` command: project scaffolding, generators, the dev server and delegation of app commands to the project's own binary (cmd/app). It works on files and never imports user code.

Index

Constants

This section is empty.

Variables

View Source
var ErrUsage = errors.New("usage error")

ErrUsage marks invalid invocations; Run exits with code 2.

Functions

func Run

func Run(ctx context.Context, args []string, env Env) int

Run executes the command line and returns the process exit code: 0 success, 1 failure, 2 usage error.

Types

type Env

type Env struct {
	// Dir is the project directory (the working directory).
	Dir    string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	// Interactive reports that Stdin is a terminal, so commands may prompt.
	Interactive bool
	// Getenv reads the process environment.
	Getenv func(string) (string, bool)
	// Now is the clock used for migration timestamps.
	Now func() time.Time
	// Version overrides the build-info version (tests).
	Version string
}

Env is everything the CLI touches outside its arguments, so tests can run it in a temp directory with captured output.

Directories

Path Synopsis
starter
app/jobs
Package jobs holds the queued jobs.
Package jobs holds the queued jobs.

Jump to

Keyboard shortcuts

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