app

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app implements the proteos CLI command tree: argument dispatch, the shared client/credential plumbing, and output helpers. main is a thin wrapper around Run so the whole CLI is testable in-process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(env Env, args []string) int

Run dispatches args (os.Args[1:]) and returns the process exit code.

Types

type Env

type Env struct {
	Stdin   io.Reader // defaults to nothing read; main wires this to os.Stdin
	Stdout  io.Writer
	Stderr  io.Writer
	Version string // semantic version, e.g. "v1.2.3" or "dev"
	Commit  string // git short sha the binary was built from
	Date    string // build timestamp (RFC 3339, UTC)

	// JSON is true when --json appeared anywhere in the invocation. It is
	// detected once in Run (before any per-command flag parsing) so every error
	// path — including ones before a command's own --json flag is parsed, like a
	// missing endpoint/token — can emit the machine-readable envelope instead of
	// prose. Commands that also use --json for success output read their own
	// parsed flag; this field only governs error formatting.
	JSON bool
	// contains filtered or unexported fields
}

Env carries the process I/O and build metadata into the command tree, so tests can capture output and drive commands without touching os.Stdout/Args.

Jump to

Keyboard shortcuts

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