cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 57 Imported by: ? 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 cmd implements the allbctl command-line interface: the root command and every subcommand under it.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the released version of allbctl, or "dev" for local builds.
	Version = "dev"
	// Commit is the git commit allbctl was built from.
	Commit = "unknown"
)

Build metadata, overridden at link time with -ldflags "-X ...".

View Source
var BootstrapCmd = &cobra.Command{
	Use: "bootstrap",
	Aliases: []string{
		"bs",
	},
	Short: "Manage workstation bootstrap configuration",
	Long: `Manage workstation bootstrap configuration including directories, tools, SSH keys, and dotfiles.

Available subcommands:
  status - Check current bootstrap status
  install - Apply bootstrap configuration to setup this machine
  reset - Reset bootstrap configuration`,
	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		return cmd.Help()
	},
}

BootstrapCmd represents the bootstrap command and its subcommands.

View Source
var CloudNativeAWSCmd = &cobra.Command{
	Use:   "aws",
	Short: "Display detailed AWS resource information",
	Long: `Display detailed AWS resource information including:
- CLI version
- Configured profiles
- Resource counts by type and region (only regions with resources are shown)
- Uses AWS Resource Groups Tagging API to discover all resources

Examples:
  allbctl status cloud-native aws                           # All profiles, all regions with resources
  allbctl status cloud-native aws --region us-east-1        # All profiles, specific region
  allbctl status cloud-native aws --profile production      # Specific profile, all regions
  allbctl status cloud-native aws --profile prod --region us-east-1  # Specific profile and region`,
	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		if err := validateAWSRegion(regionFlag); err != nil {
			return err
		}

		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.cloud-native.aws")
		defer span.End()
		query := awsQuery{Profile: profileFlag, Region: regionFlag}
		if jsonRequested() {
			data, err := gatherAWSData(ctx, query)
			if err != nil {
				return err
			}
			return emitJSON(cmd, outputschema.KindStatusCloudNativeAWS, &data)
		}
		return printAWSDetails(ctx, query)
	},
}

CloudNativeAWSCmd represents the AWS-specific command

View Source
var CloudNativeAzureCmd = &cobra.Command{
	Use:   "azure",
	Short: "Display the local Azure CLI configuration",
	Long: `Display what the Azure CLI (az) on this machine is set up to use:
- CLI version
- Configuration directory
- Default subscription, and how many there are
- Subscription ID, tenant ID and signed-in account (masked), cloud and state
` + localDetailNote,
	Args: noArgs,
	RunE: localDetailView(renderAzureDetail),
}

CloudNativeAzureCmd represents the Azure-specific command

View Source
var CloudNativeCmd = &cobra.Command{
	Use:     "cloud-native",
	Aliases: []string{"cloud_native", "cn"},
	Short:   "Display cloud CLI information and resources",
	Long: `Display cloud CLI versions and resource information for AWS, GCP, Azure, and Kubernetes.

This command shows:
- CLI version for each detected cloud provider
- Number of configured profiles/users
- Resource counts by region (when detailed subcommands are used)

Examples:
  allbctl status cloud-native          # Show summary for all detected cloud CLIs
  allbctl status cn                    # Short alias
  allbctl status cloud-native aws      # Show detailed AWS resource info
  allbctl status cn aws --region us-east-1  # AWS resources in specific region`,
	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.cloud-native")
		defer span.End()
		if jsonRequested() {
			data := gatherCloudNativeData(ctx)
			return emitJSON(cmd, outputschema.KindStatusCloudNative, &data)
		}
		summary := cloudNativeSummary(ctx)
		if summary == "" {

			summary = cloudCLIsNotInstalledNotice() + "\n"
		}
		fmt.Print(summary)
		return nil
	},
}

CloudNativeCmd represents the cloud-native command

View Source
var CloudNativeGCPCmd = &cobra.Command{
	Use:   "gcp",
	Short: "Display the local gcloud configuration",
	Long: `Display what the gcloud CLI on this machine is set up to use:
- CLI version
- Configuration directory
- Active configuration, and how many there are
- Active account and project (masked), default region and zone
` + localDetailNote,
	Args: noArgs,
	RunE: localDetailView(renderGCPDetail),
}

CloudNativeGCPCmd represents the GCP-specific command

View Source
var CloudNativeK8sCmd = &cobra.Command{
	Use:     "kubernetes",
	Aliases: []string{"k8s"},
	Short:   "Display the local kubectl configuration",
	Long: `Display what kubectl on this machine is set up to use:
- kubectl and bundled kustomize versions
- Where the kubeconfig is read from
- Current context with its cluster and namespace (generated names that embed
  an account or project ID are masked)
- Number of contexts and clusters
` + localDetailNote,
	Args: noArgs,
	RunE: localDetailView(renderKubernetesDetail),
}

CloudNativeK8sCmd represents the Kubernetes-specific command

View Source
var ContainersCmd = &cobra.Command{
	Use:   "containers",
	Short: "Display container and virtualization information",
	Long:  `Display information about containers (Docker, Podman) and virtualization status.`,
	Args:  noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.containers")
		defer span.End()
		if jsonRequested() {
			report := gatherContainersReport(ctx)
			recordContainersTelemetry(ctx, report)
			data := containersData(report)
			return emitJSON(cmd, outputschema.KindStatusContainers, &data)
		}
		PrintContainersInfo(ctx)
		return nil
	},
}

ContainersCmd prints container runtime and virtualization status.

View Source
var DbCmd = &cobra.Command{
	Use:   "db [database]",
	Short: "Display detected databases and their information",
	Long: `Display detected database management systems (DBMS) and their information.

Shows database clients, versions, running status, and database files.

Examples:
  allbctl status db                  # Show all detected databases
  allbctl status db sqlite3          # Show only SQLite3 info
  allbctl status db postgres         # Show only PostgreSQL info
  allbctl status db --detail         # Show detailed info for all databases
  allbctl status db sqlite3 --detail # Show detailed SQLite3 info with .db files`,
	Args: atMostOneArg,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.db")
		defer span.End()

		if jsonRequested() {
			only := ""
			if len(args) > 0 {
				only = args[0]
			}
			data, err := gatherDatabasesData(ctx, only, dbDetailFlag)
			if err != nil {
				return err
			}
			return emitJSON(cmd, outputschema.KindStatusDatabases, &data)
		}

		if len(args) > 0 {
			dbName := args[0]
			span.SetAttributes(attribute.String("db.filter", dbName))
			if err := showDatabaseInfo(ctx, dbName, dbDetailFlag); err != nil {
				return err
			}
			telemetry.Logger.InfoContext(ctx, "status.db",
				"database", dbName,
				"detail", dbDetailFlag,
			)
			return nil
		}

		detected := detectAllDatabases(ctx)
		fmt.Print(formatAllDatabases(detected, dbDetailFlag))

		detectedNames := databaseNames(detected)
		telemetry.Logger.InfoContext(ctx, "status.db",
			"detected_count", len(detectedNames),
			"databases", detectedNames,
			"detail", dbDetailFlag,
		)
		span.SetAttributes(
			attribute.Int("db.detected_count", len(detectedNames)),
			attribute.StringSlice("db.databases", detectedNames),
		)
		return nil
	},
}

DbCmd represents the db command

View Source
var GitConfigCmd = &cobra.Command{
	Use:   "git",
	Short: "Display git global configuration",
	Long:  `Display git global configuration including user name, email, and editor.`,
	Args:  noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.git")
		defer span.End()
		if jsonRequested() {
			data := gatherGitData(ctx)
			return emitJSON(cmd, outputschema.KindStatusGit, &data)
		}
		PrintGitConfigInfo(ctx)
		return nil
	},
}

GitConfigCmd prints the identity and editor from the global git config.

View Source
var ListPackagesCmd = &cobra.Command{
	Use:   "list-packages [package-manager]",
	Short: "Show package count summary from all detected package managers",
	Long: `Show package count summary from all detected package managers.

By default, shows one line per package manager with the number of packages it
has installed: the counts of the 'Packages:' section in 'allbctl status',
without the "(N want updates)" hints. Checking for updates asks every package
manager (some of them over the network), so this command leaves it out; use
'allbctl status' or '--output json' (the updatesAvailable field) to see them.

For system package managers (apt, yum, brew, chocolatey, etc.), only explicitly
installed packages are counted, not their dependencies.

For programming runtime package managers (npm, pip, gem, etc.), only globally
installed packages are counted.

If a package manager is not detected on the system, it will not be displayed.

Use --detail flag to see the full list of all installed packages.

You can also specify a specific package manager to list only its packages:
  allbctl status list-packages apt
  allbctl status list-packages npm
  allbctl status list-packages flatpak`,
	Args: atMostOneArg,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx, span := otel.Tracer(tracerName).Start(commandContext(cmd), "status.list-packages")
		defer span.End()
		if jsonRequested() {
			only := ""
			if len(args) > 0 {
				only = args[0]
			}
			data, err := gatherPackagesData(ctx, only, detailFlag)
			if err != nil {
				return err
			}
			return emitJSON(cmd, outputschema.KindStatusPackages, &data)
		}
		return listInstalledPackages(ctx, args)
	},
}

ListPackagesCmd represents the list-packages command

View Source
var NetworkCmd = &cobra.Command{
	Use:   "network",
	Short: "Display network interface information",
	Long: `Display network interface information including IP addresses, router, connection type, VPN status, DNS, and connectivity.

This is the same output shown in the 'Network:' section of 'allbctl status'.`,
	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.network")
		defer span.End()
		if jsonRequested() {
			data := gatherNetworkData(ctx)
			return emitJSON(cmd, outputschema.KindStatusNetwork, &data)
		}
		PrintNetworkInfo(ctx)
		return nil
	},
}

NetworkCmd prints the network section of `allbctl status` on its own.

View Source
var PortsCmd = &cobra.Command{
	Use:   "ports",
	Short: "Display listening ports",
	Long:  `Display count of listening TCP/UDP ports and details about what's listening.`,
	Args:  noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.ports")
		defer span.End()
		if jsonRequested() {
			data := portsData(gatherListeningPorts(ctx))
			return emitJSON(cmd, outputschema.KindStatusPorts, &data)
		}
		PrintPortsInfo(ctx)
		return nil
	},
}

PortsCmd prints the listening TCP/UDP ports and what owns them.

View Source
var ProjectsCmd = &cobra.Command{
	Use:   "projects",
	Short: "Display git repositories in ~/src",
	Long: `Display the git repositories found in the ~/src directory.

By default it lists every repository, most recently touched first, under the
'Projects:' totals line that 'allbctl status' also prints ('allbctl status'
itself only lists the five most recently touched). Use --limit to list fewer.
Dirty repos are marked with an asterisk (*).

Examples:
  allbctl status projects                        # List every repo
  allbctl status projects --limit 5              # The five most recently touched, as in 'allbctl status'
  allbctl status projects --all                  # List every repo with detailed totals
  allbctl status projects --dirty                # Show only dirty repos
  allbctl status projects --clean                # Show only clean repos
  allbctl status projects --dirty -v             # Show dirty repos with their changed files
  allbctl status projects --all --languages      # Show all repos with language breakdown
  allbctl status projects -v --languages=false   # Verbose without language breakdown
  allbctl status projects --dirty --limit 5      # Show at most five dirty repos

--all, --dirty and --clean select which repos are listed and cannot be combined.`,
	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		if err := validateProjectsFlags(allFlag, dirtyFlag, cleanFlag, limitFlag); err != nil {
			return err
		}

		ctx, span := otel.Tracer(tracerName).Start(commandContext(cmd), "status.projects")
		defer span.End()

		langExplicit := cmd.Flags().Changed("languages")
		showLanguages = languagesFlag && (verboseFlag || langExplicit)

		switch {
		case jsonRequested():
			data := gatherProjectsData(ctx, projectsQuery{Mode: projectsDisplayMode(), Limit: limitFlag})
			if err := emitJSON(cmd, outputschema.KindStatusProjects, &data); err != nil {
				return err
			}
		case allFlag || dirtyFlag || cleanFlag || verboseFlag || (langExplicit && languagesFlag):
			printProjectsSummary(ctx)
		default:

			overview := gatherProjects(ctx)
			block := formatProjectsInline(overview, limitFlag)
			if block == "" {

				block = overview.Problem + "\n"
			}
			fmt.Print(block)
		}

		telemetry.Logger.InfoContext(ctx, "status.projects",
			"all", allFlag,
			"dirty", dirtyFlag,
			"clean", cleanFlag,
			"verbose", verboseFlag,
			"limit", limitFlag,
		)
		return nil
	},
}

ProjectsCmd represents the projects command

View Source
var RuntimesCmd = &cobra.Command{
	Use:   "runtimes",
	Short: "Display detected runtimes and their versions",
	Long: `Display detected programming language runtimes and their versions.

This is the same output shown in the 'Runtimes:' section of 'allbctl status'.`,
	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx, span := otel.Tracer(tracerName).Start(commandContext(cmd), "status.runtimes")
		defer span.End()
		if jsonRequested() {
			data := gatherRuntimesData(ctx)
			return emitJSON(cmd, outputschema.KindStatusRuntimes, &data)
		}
		PrintRuntimes(ctx)
		return nil
	},
}

RuntimesCmd represents the `status runtimes` command.

View Source
var SecurityCmd = &cobra.Command{
	Use:   "security",
	Short: "Display security and authentication status",
	Long:  `Display information about SSH keys, GPG keys, and kernel keyring.`,
	Args:  noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.security")
		defer span.End()
		if jsonRequested() {
			data := gatherSecurityData(ctx)
			return emitJSON(cmd, outputschema.KindStatusSecurity, &data)
		}
		PrintSecurityInfo(ctx)
		return nil
	},
}

SecurityCmd prints the SSH, GPG and kernel-keyring key inventory.

View Source
var StatusCmd = &cobra.Command{
	Use:   "status",
	Short: "Display system information (like neofetch)",

	Args: noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.printSystemInfo",
			trace.WithAttributes(attribute.String("command", "status")),
		)
		defer span.End()
		return runStatus(ctx, cmd, hostStatusReporters)
	},
}

StatusCmd represents status command

View Source
var SystemctlCmd = &cobra.Command{
	Use:   "systemctl",
	Short: "Display systemd service status",
	Long:  `Display count of running system and user services, and any failed services.`,
	Args:  noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		ctx := commandContext(cmd)
		ctx, span := otel.Tracer("github.com/aallbrig/allbctl").Start(ctx, "status.systemctl")
		defer span.End()
		if jsonRequested() {
			data := gatherSystemctlData(ctx)
			return emitJSON(cmd, outputschema.KindStatusSystemctl, &data)
		}
		PrintSystemctlInfo(ctx)
		return nil
	},
}

SystemctlCmd prints running and failed systemd service counts.

View Source
var UpdateCmd = &cobra.Command{
	Use:   subcommandUpdate,
	Short: "Update and upgrade all detected package managers",
	Long: `Update and upgrade packages from all detected package managers on the system.

Runs update/upgrade commands for each detected package manager sequentially.
Some managers require sudo and will prompt for your password.

Supported managers: apt, flatpak, snap, dnf, yum, pacman, brew, choco, winget, npm, pipx, gem

Intentionally skipped:
  pip   - Risky to auto-upgrade all pip packages (can break system Python)
  cargo - No global upgrade mechanism
  go    - No global upgrade mechanism

Use --dry-run to preview what commands would be executed.
Use --managers to limit which package managers are updated.

A package manager that fails does not stop the others: every selected manager
is attempted, a summary of which succeeded, failed and were skipped is
printed, and the exit code is 1 when any of them failed.

--managers accepts only the supported managers listed above; any other name
is a usage error (exit code 2). A supported manager that is not installed on
this system is skipped, which is not a failure. --dry-run executes nothing
and so never fails because an update would.

Ctrl-C interrupts the package manager that is running, skips the ones still
queued and exits with code 130.

Examples:
  allbctl update                    # Update everything detected
  allbctl update --dry-run          # Preview what would happen
  allbctl update --managers apt,npm # Only update apt and npm`,
	Aliases: []string{"up", subcommandUpgrade},
	Args:    noArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		requested := normalizeManagerNames(updateManagers)
		if cmd.Flags().Changed("managers") && len(requested) == 0 {
			return usageErrorf("--managers needs at least one package manager name")
		}
		if err := validateRequestedManagers(getUpdatableManagers(), requested); err != nil {
			return err
		}

		ctx, stop := signal.NotifyContext(commandContext(cmd), os.Interrupt)
		defer stop()
		return newUpdateRun(updateDryRun, requested).run(ctx)
	},
}

UpdateCmd represents the update command

Functions

func Execute

func Execute()

Execute runs the root command and exits with the documented exit code: 0 on success, 1 on failure, 2 on a usage error, 130 when interrupted.

func PrintContainersInfo added in v0.0.26

func PrintContainersInfo(ctx context.Context)

PrintContainersInfo prints Docker and Podman usage and whether the host is virtualized.

func PrintGitConfigInfo added in v0.0.26

func PrintGitConfigInfo(ctx context.Context)

PrintGitConfigInfo prints the global git identity and editor, or a one-line notice when git is not installed.

func PrintNetworkInfo added in v0.0.25

func PrintNetworkInfo(ctx context.Context)

PrintNetworkInfo outputs comprehensive network information

func PrintPortsInfo added in v0.0.26

func PrintPortsInfo(ctx context.Context)

PrintPortsInfo prints the listening-port counts followed by one line per listener.

func PrintRuntimes added in v0.0.21

func PrintRuntimes(ctx context.Context)

PrintRuntimes outputs the runtimes in inline format (same as status command)

func PrintSecurityInfo added in v0.0.26

func PrintSecurityInfo(ctx context.Context)

PrintSecurityInfo prints the keys loaded in the SSH agent, the GPG public keys and, on Linux, the user keyring summary.

func PrintSystemctlInfo added in v0.0.26

func PrintSystemctlInfo(ctx context.Context)

PrintSystemctlInfo prints the systemd service counts, or a one-line explanation when systemd is not available on this host.

Types

type AIAgent added in v0.0.14

type AIAgent struct {
	Name    string
	Version string
}

AIAgent represents an AI coding assistant

type AWSResourceCount added in v0.0.28

type AWSResourceCount struct {
	ResourceType string
	Count        int64
}

AWSResourceCount holds resource count information

type BrowserInfo added in v0.0.18

type BrowserInfo struct {
	Name    string
	Version string
}

BrowserInfo holds browser information

type CICheck added in v0.0.35

type CICheck struct {
	Name       string `json:"name"`
	Conclusion string `json:"conclusion"`
}

CICheck represents a single GitHub check run with its name and conclusion.

type CPUDetails added in v0.0.18

type CPUDetails struct {
	ModelName      string
	Architecture   string
	Cores          int
	ThreadsPerCore int
	CoresPerSocket int
	Sockets        int
	PhysicalCores  int
	LogicalCores   int
	BaseClock      string
	PCores         int
	ECores         int
	HasPECores     bool
}

CPUDetails holds detailed CPU information

type CloudCLIInfo added in v0.0.28

type CloudCLIInfo struct {
	Name             string
	Version          string
	KustomizeVersion string // For kubectl
	ProfileCount     int
	// Profiles are account names, emails or cluster contexts. They can
	// identify an account, so only their count is ever displayed.
	Profiles  []string
	Connected bool
	// Configured is false for a CLI that is installed but was never set
	// up, and was therefore not run.
	Configured bool
}

CloudCLIInfo holds information about a cloud CLI

type ContainerInfo added in v0.0.26

type ContainerInfo struct {
	Runtime     string
	Running     int
	Images      int
	ImagesList  []string
	Virtualized bool
	VirtType    string
}

ContainerInfo describes one container runtime, or (for the virtualization check) whether the host itself is a guest.

type DatabaseInfo added in v0.0.22

type DatabaseInfo struct {
	Name          string
	ClientBinary  string
	ServerBinary  string
	ClientVersion string
	ServerVersion string
	IsRunning     bool
	DatabaseFiles []string
	// EnvVars holds raw values; redact them before display.
	EnvVars       map[string]string
	OtherBinaries []string
}

DatabaseInfo describes one database system found on the host.

type DirtyReason added in v0.0.32

type DirtyReason uint

DirtyReason is a bitmask describing why a repo is considered dirty

const (
	DirtyUncommittedChanges DirtyReason = 1 << iota // has staged, unstaged, or untracked changes
	DirtyUnpushedCommits                            // has commits not yet pushed to upstream
	DirtyNoUpstream                                 // current branch has no remote tracking branch
	DirtyCIFailed                                   // remote CI has a failed check on this branch
	DirtyCIPending                                  // remote CI has an in-progress check on this branch
)

The reasons a repository can be dirty; a repo may have several at once.

func (DirtyReason) Labels added in v0.0.32

func (r DirtyReason) Labels() []string

Labels returns a human-readable label for every reason set in r.

func (DirtyReason) String added in v0.0.32

func (r DirtyReason) String() string

type DiskInfo added in v0.0.27

type DiskInfo struct {
	Device      string
	Mountpoint  string
	Filesystem  string
	Total       uint64
	Used        uint64
	Free        uint64
	UsedPercent float64
}

DiskInfo holds detailed disk information

type GPUInfo added in v0.0.18

type GPUInfo struct {
	Name          string
	Vendor        string
	Memory        string
	Driver        string
	ComputeCap    string
	ClockGraphics string
	ClockMemory   string
}

GPUInfo holds detailed GPU information

type GitConfigInfo added in v0.0.26

type GitConfigInfo struct {
	UserName   string
	UserEmail  string
	CoreEditor string
}

GitConfigInfo holds the global git settings `status git` reports. A field is empty when the setting is not configured.

type InterfaceInfo added in v0.0.25

type InterfaceInfo struct {
	Name       string
	IP         string
	Status     string
	IsVPN      bool
	IsLoopback bool
	Gateway    string
}

InterfaceInfo holds interface details

type NetworkDetails added in v0.0.25

type NetworkDetails struct {
	Interfaces     []InterfaceInfo
	VPNActive      bool
	VPNInterface   *InterfaceInfo
	PrimaryIface   *InterfaceInfo
	DefaultGateway string
	DNSServers     []string
	VPNDNSServers  []string
	PublicIP       string
	InternetOK     bool
	WiFiDetails    *WiFiInfo
}

NetworkDetails holds comprehensive network information

type PackageResult added in v0.0.27

type PackageResult struct {
	Manager     string
	Count       int
	UpdateCount int
}

PackageResult holds package count results for a single package manager

type PortInfo added in v0.0.26

type PortInfo struct {
	TCPPorts int
	UDPPorts int
	// Ports holds one display line per listener, e.g.
	// "tcp:22 (sshd, pid 801)".
	Ports []string
	// Listeners holds the same listeners field by field, for the JSON output.
	Listeners []portListener
	// contains filtered or unexported fields
}

PortInfo is the set of listening sockets found on the host.

type RepoInfo added in v0.0.15

type RepoInfo struct {
	Path             string
	ModTime          time.Time
	Dirty            bool
	DirtyReasons     DirtyReason
	RemoteRepo       string                        // e.g., "aallbrig/allbctl" or "godotengine/godot"
	StatusOutput     string                        // populated when -v/--verbose is set; full `git status --untracked-files=all` output
	UncommittedFiles int                           // staged + unstaged file count (excludes untracked)
	UntrackedFiles   int                           // untracked file count
	UnpushedCommits  int                           // number of commits ahead of upstream
	CIStatus         string                        // "success", "failure", "pending", or "" (no CI detected)
	CIChecks         []CICheck                     // populated when -v/--verbose is set
	Languages        []languages.LanguageBreakdown // populated when -v/--verbose is set
}

RepoInfo contains information about a git repository

type RuntimeCheck added in v0.0.13

type RuntimeCheck struct {
	Command  []string
	Category string
}

RuntimeCheck is the command that prints a runtime's version, and the category the runtime is displayed under.

type RuntimeInfo added in v0.0.13

type RuntimeInfo struct {
	Name     string
	Version  string
	Category string
}

RuntimeInfo is a runtime that was found on this machine.

type SecurityInfo added in v0.0.26

type SecurityInfo struct {
	// SSHKeys has one "bits fingerprint comment" line per agent identity.
	SSHKeys []string
	// GPGKeys has one "algo/keyid - uid" line per public key.
	GPGKeys []string
	// KeyringInfo summarizes the Linux user keyring; empty when it has no keys.
	KeyringInfo string

	// The same keys, field by field, for the JSON output.
	SSHAgentKeys  []sshAgentKey
	GPGPublicKeys []gpgPublicKey
	KeyringKeys   int

	// Why a tool gave no answer (it timed out or failed); empty when it
	// answered. Shown in place of "no keys", which would be a guess.
	SSHNotice     string
	GPGNotice     string
	KeyringNotice string

	// How asking each tool went: one of the output.Probe… values.
	SSHStatus     string
	GPGStatus     string
	KeyringStatus string
}

SecurityInfo lists the public identifiers of the keys available to the user. It never holds private key material.

type SystemctlInfo added in v0.0.26

type SystemctlInfo struct {
	SystemRunning int
	SystemFailed  int
	UserRunning   int
	UserFailed    int
}

SystemctlInfo holds service counts for the system manager and for the current user's manager.

type UpdateInfo added in v0.0.25

type UpdateInfo struct {
	Current   string
	Available string
	IsLTS     bool
}

UpdateInfo holds information about available updates

type WiFiInfo added in v0.0.25

type WiFiInfo struct {
	SSID      string
	Frequency string
	Standard  string
	Signal    string
	Quality   string
	Speed     string
}

WiFiInfo holds WiFi-specific details

Jump to

Keyboard shortcuts

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