cli

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 9 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 assembles everything a command needs to run.

It sits between the cobra front end and the domain layer, and it exists so that no command has to know how a token is found, how a team is resolved, or which renderer the user's terminal deserves. A command receives a ready Context and returns data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Exec   execctx.Context
	Config config.Resolved
	Out    *output.Writer

	// Fields is --fields, already split. Empty means every field.
	Fields []string

	// DryRun is --dry-run.
	DryRun bool
	// contains filtered or unexported fields
}

Context is the resolved environment for one invocation.

func Build

func Build(exec execctx.Context, ov config.Overrides, version string, out, errw io.Writer) (*Context, error)

Build resolves configuration and prepares the output writer.

It does not require a credential: whether one is needed is a per-command decision, and `schema`, `version` and `help` must work on a machine that has never logged in.

func (*Context) APIClient

func (c *Context) APIClient() (*api.Client, error)

APIClient returns a client for the Out Plane API, or an actionable error explaining how to authenticate.

The error is written carefully: an agent that receives it should be able to act without asking a human, and a human should not have to search the docs.

func (*Context) SignInError

func (c *Context) SignInError() error

SignInError is the credential-resolution failure for this invocation, phrased for a human and for an agent.

Exposed so that commands which read the credential without making a request, `whoami` and `status`, produce the same message as one that does. Two different explanations of the same condition would be worse than either.

func (*Context) Version

func (c *Context) Version() string

Version reports the CLI version, for the User-Agent and `outplane version`.

Jump to

Keyboard shortcuts

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