cli

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 47 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 cli implements the orch command surface (PRD §22). Commands without an implementation yet fail closed with an explicit error.

Index

Constants

View Source
const (
	ExitOK    = 0
	ExitError = 1
	ExitUsage = 2
)

Exit codes returned by Run.

Variables

View Source
var Version = "dev"

Version is the release version of this binary, stamped by the release workflow via

-ldflags "-X github.com/kninetimmy/orch/internal/cli.Version=v1.2.3"

Builds without the stamp (go build, go install, go test) report "dev". status and doctor print it before any repository checks, so an uninitialized or broken repository can still identify the binary on PATH.

Functions

func Run

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

Run dispatches args (without the program name) and returns a process exit code.

Types

type DoctorCheck added in v0.16.0

type DoctorCheck struct {
	Name   string `json:"name"`
	Status string `json:"status"` // success, failure or advisory
	Detail string `json:"detail,omitempty"`
}

type DoctorReport added in v0.16.0

type DoctorReport struct {
	SchemaVersion int           `json:"schema_version"`
	Version       string        `json:"version"`
	SelectedHost  string        `json:"selected_host,omitempty"`
	Healthy       bool          `json:"healthy"`
	Checks        []DoctorCheck `json:"checks"`
}

DoctorReport is shared by human CLI output, CLI JSON and MCP. An unhealthy report is a successful inspection, not an input or transport error.

type Env

type Env struct {
	// RepoRoot is the directory containing .orchestrator/.
	RepoRoot string
	Stdout   io.Writer
	Stderr   io.Writer
	// Stdin is the process input; nil is treated as empty. `orch run`
	// verbs read their JSON document from it.
	Stdin io.Reader
	// LookPath resolves an executable name; defaults to exec.LookPath.
	LookPath func(string) (string, error)
	// Runner executes external commands; defaults to execx.Local
	// resolving through LookPath.
	Runner execx.Runner
}

Env carries the invocation context so commands stay testable.

Jump to

Keyboard shortcuts

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