cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Overview

Package cli implements the xpc cobra command tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(args []string, stdout, stderr io.Writer) int

Execute runs the CLI and returns a process exit code per the docs/ARCHITECTURE.md exit-code table.

func New

func New() *cobra.Command

New returns the root cobra command with all subcommands registered.

func ShimArgs

func ShimArgs(argv []string) []string

ShimArgs inspects argv[0] and, if it matches a registered shim, returns argv with the corresponding subcommand prepended. Otherwise it returns argv[1:] unchanged. Pass os.Args.

Types

type AuthError

type AuthError struct {
	// contains filtered or unexported fields
}

AuthError is a sentinel for HMAC / fingerprint / cert failures; mapExitCode returns 4.

func (*AuthError) Unwrap

func (e *AuthError) Unwrap() error

type ConnectionError

type ConnectionError struct {
	// contains filtered or unexported fields
}

ConnectionError is a sentinel for transport-level failures; mapExitCode returns 3.

func (*ConnectionError) Unwrap

func (e *ConnectionError) Unwrap() error

type Globals

type Globals struct {
	ProfileName string
	HostFlag    string
	PortFlag    int
	OutputMode  string // text | json | table
	Verbose     bool
	Timeout     time.Duration
	DryRun      bool
	DebugARCP   bool
	// contains filtered or unexported fields
}

Globals are populated from cobra flags at the root level and consumed by every subcommand.

func (*Globals) ResolveProfile

func (g *Globals) ResolveProfile() (*profile.Profile, error)

ResolveProfile lazy-loads the profile this invocation should use, applying the --profile flag, $XPC_PROFILE env var, and active-state fallback.

type Process

type Process struct {
	Name      string `json:"name"`
	PID       int    `json:"pid"`
	SessionID string `json:"session_id,omitempty"`
	MemoryKB  int    `json:"memory_kb,omitempty"`
	Status    string `json:"status,omitempty"`
	Username  string `json:"username,omitempty"`
	Title     string `json:"window_title,omitempty"`
}

Process is the minimal per-row shape returned by `tasklist /v /fo csv`.

type RegEntry

type RegEntry struct {
	Key  string `json:"key"`
	Name string `json:"name"`
	Type string `json:"type"`
	Data string `json:"data"`
}

RegEntry is a single registry value pulled from `reg query` output.

type RemoteError

type RemoteError struct {
	ExitCode int
	// contains filtered or unexported fields
}

RemoteError is a sentinel for failures reported by the remote agent; mapExitCode returns ExitCode (or 5 if zero).

func (*RemoteError) Unwrap

func (e *RemoteError) Unwrap() error

type UsageError

type UsageError struct {
	// contains filtered or unexported fields
}

UsageError is a sentinel for invalid CLI usage; mapExitCode returns 2.

func (*UsageError) Unwrap

func (e *UsageError) Unwrap() error

Jump to

Keyboard shortcuts

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