cli

package
v0.9.4-dev.9 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: GPL-3.0 Imports: 25 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

Index

Constants

View Source
const (
	ExitOK                = 0
	ExitUsage             = 2
	ExitDaemonUnavailable = 3
	ExitInvalidState      = 4
	ExitPermission        = 5
	ExitConflict          = 6
	ExitUpstream          = 7
	ExitNetwork           = 8
	ExitData              = 9
	ExitInternal          = 10
)

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, args []string, stdout, stderr io.Writer, dependencies Dependencies) int

Types

type Dependencies

type Dependencies struct {
	// DiagnosticReporter borrows a caller-owned outlet; CLI never opens log files.
	DiagnosticReporter      diagnostics.Reporter
	ChannelQuery            func(context.Context) (string, error)
	ChannelSet              func(context.Context, string) error
	StatusClient            StatusClient
	RuntimeClient           RuntimeClient
	SubscriptionClient      SubscriptionClient
	PanelClient             PanelClient
	SystemProxyClient       SystemProxyClient
	TunClient               TunClient
	ServiceController       ServiceController
	Uninstaller             Uninstaller
	CloseForPurgeUninstall  func() error
	ServiceApply            func(context.Context, app.InstallRequest, update.ReplacementConsent) (app.InstallResult, error)
	ServiceAction           func(context.Context, string) error
	InstallationInspect     func(context.Context) (app.InstallationStatus, error)
	InstallationPlan        func(context.Context, app.InstallationPlanRequest) (app.InstallationPlan, error)
	InstallationExecute     func(context.Context, app.InstallationExecuteRequest) (app.InstallationOutcome, error)
	SelfUpdater             SelfUpdater
	SelfUpdateChannel       func(context.Context) (string, error)
	OpenBrowser             func(url string) error
	RunDaemon               func(context.Context) error
	RunSystemServiceDaemon  func(context.Context) error
	RunLaunchdServiceDaemon func(context.Context) error
	RunInstallValidation    func(context.Context, string) error
	RunTUI                  func(context.Context) error
	Interactive             bool
	NewOperationID          func() string
	SetupError              error
	// PrepareLocalRoot runs once before selected commands. Nil skips data-root IO.
	PrepareLocalRoot func() error
}

type SelfUpdater

type SelfUpdater interface {
	Prepare(ctx context.Context, binaryPath, currentVersion, channel string) (update.PreparedUpdate, error)
	ApplyPrepared(context.Context, update.PreparedUpdate) (update.Result, error)
}

SelfUpdater updates the running mihari binary.

type ServiceController

type ServiceController interface {
	Install() error
	Uninstall() error
	Reinstall() error
	Start() error
	Stop() error
	Restart() error
	Status() (service.StatusKind, error)
}

ServiceController is the OS service surface used by CLI commands.

type StatusClient

type StatusClient interface {
	Status(context.Context) (protocol.Status, error)
}

type SystemProxyClient

SystemProxyClient is the typed control surface used by sysproxy CLI commands.

type TunClient

TunClient is the typed control surface used by tun CLI commands.

type Uninstaller added in v0.9.3

type Uninstaller interface {
	Preview(context.Context) ([]app.UninstallTarget, error)
	Run(context.Context, func(string)) error
	RunForce(context.Context, func(string)) error
}

Uninstaller is the local application use case for a confirmed full uninstall.

Jump to

Keyboard shortcuts

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