cli

package
v2.17.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const ExitUnrecoverable = 78

ExitUnrecoverable is the exit status for a startup failure that starting again cannot fix.

The service units set RestartPreventExitStatus to it. Without that, a supervisor retries every few seconds forever: each attempt reopens the databases, fails in the same place, and writes the same error, so the one line explaining the problem is buried under repetitions of itself and the device looks like it is doing something about it. Stopping at a failed unit with the reason still visible is the more useful answer.

78 is EX_CONFIG from sysexits.h, which is close enough to what this is: the state on disk is not something this build can work with.

Variables

This section is empty.

Functions

func ExitCodeFor

func ExitCodeFor(err error) int

ExitCodeFor maps a startup error to the process exit status to leave behind.

Only conditions a person has to resolve qualify. Anything transient — a missing network, a busy file, a database that can be recovered — stays 1 so the supervisor keeps trying, because those do come good on their own.

func HandleInstall added in v2.8.0

func HandleInstall(component string) error

HandleInstall handles the -install flag for all Linux platforms.

func HandleUninstall added in v2.8.0

func HandleUninstall(component string) error

HandleUninstall handles the -uninstall flag for all Linux platforms.

func RunApp added in v2.8.0

func RunApp(pl platforms.Platform, cfg *config.Instance, daemonMode bool) (returnErr error)

RunApp runs the main application in either daemon or TUI mode. It handles signal handling, service lifecycle, and graceful shutdown.

func Setup

func Setup(
	pl platforms.Platform,
	defaultConfig config.Values,
	writers []io.Writer,
) *config.Instance

Setup initializes the user config and logging. Returns a user config object.

func StartAndOpenBrowser added in v2.8.0

func StartAndOpenBrowser(cfg *config.Instance) error

StartAndOpenBrowser starts the service via systemd and opens the web UI in the browser.

Types

type DefaultInstaller added in v2.8.0

type DefaultInstaller struct{}

DefaultInstaller implements Installer using the real installer package.

func (DefaultInstaller) InstallApplication added in v2.8.0

func (DefaultInstaller) InstallApplication() error

func (DefaultInstaller) InstallDesktop added in v2.8.0

func (DefaultInstaller) InstallDesktop() error

func (DefaultInstaller) InstallHardware added in v2.8.0

func (DefaultInstaller) InstallHardware() error

func (DefaultInstaller) InstallService added in v2.8.0

func (DefaultInstaller) InstallService() error

func (DefaultInstaller) UninstallApplication added in v2.8.0

func (DefaultInstaller) UninstallApplication() error

func (DefaultInstaller) UninstallDesktop added in v2.8.0

func (DefaultInstaller) UninstallDesktop() error

func (DefaultInstaller) UninstallHardware added in v2.8.0

func (DefaultInstaller) UninstallHardware() error

func (DefaultInstaller) UninstallService added in v2.8.0

func (DefaultInstaller) UninstallService() error

type Flags

type Flags struct {
	Write                *string
	Read                 *bool
	Run                  *string
	Launch               *string
	API                  *string
	Version              *bool
	ShowLoader           *string
	ShowPicker           *string
	Reload               *bool
	Pair                 *bool
	Update               *bool
	Backup               *bool
	Backups              *bool
	Restore              *string
	Profiles             *bool
	ProfileResetPIN      *string
	ProfileResetSwitchID *string
}

func SetupFlags

func SetupFlags() *Flags

SetupFlags defines all common CLI flags between platforms.

func (*Flags) Post

func (f *Flags) Post(cfg *config.Instance, _ platforms.Platform)

Post actions all remaining common flags that require the environment to be set up. Logging is allowed.

func (*Flags) Pre

func (f *Flags) Pre(pl platforms.Platform)

Pre runs flag parsing and actions any immediate flags that don't require environment setup. Add any custom flags before running this.

type Installer added in v2.8.0

type Installer interface {
	InstallApplication() error
	InstallDesktop() error
	InstallService() error
	InstallHardware() error
	UninstallApplication() error
	UninstallDesktop() error
	UninstallService() error
	UninstallHardware() error
}

Installer defines the interface for install/uninstall operations. This allows mocking in tests to avoid side effects.

Jump to

Keyboard shortcuts

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