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

cli

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 32 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/controllers
Package controllers holds the HTTP handlers.
Package controllers holds the HTTP handlers.
app/jobs
Package jobs holds the queued jobs.
Package jobs holds the queued jobs.
app/models
Package models holds the database models.
Package models holds the database models.
app/requests
Package requests holds validated request inputs.
Package requests holds validated request inputs.
database/factories
Package factories builds models with fake data for tests and seeders.
Package factories builds models with fake data for tests and seeders.
routes
Package routes declares the HTTP routes.
Package routes declares the HTTP routes.

Jump to

Keyboard shortcuts

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