cmd

package
v0.2.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye. Task stackeye-5859.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye. Task #8066

Package cmd implements the CLI commands for StackEye. Task #8067

Package cmd implements the CLI commands for StackEye. Task #8065

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye. Task #8068

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye. Task #8069

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

This package contains the root command and all subcommands for the StackEye CLI tool. Commands are organized hierarchically using Cobra.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Package cmd implements the CLI commands for StackEye.

Index

Constants

View Source
const (
	// DefaultPage is the default page number (1-indexed).
	DefaultPage = 1
	// DefaultLimit is the default number of results per page.
	DefaultLimit = 20
	// MaxLimit is the maximum allowed results per page.
	MaxLimit = 100
	// MinLimit is the minimum allowed results per page.
	MinLimit = 1
)

PaginationDefaults contains default values for pagination flags.

Variables

View Source
var ContextNameCompletion = ContextCompletion

ContextNameCompletion is an alias for ContextCompletion for clarity in command definitions. Use this when the command expects a context name argument.

View Source
var ProbeIDCompletion = ProbeCompletion

ProbeIDCompletion is an alias for ProbeCompletion for clarity in command definitions. Use this when the command expects a probe ID argument.

Functions

func AddPaginationFlags

func AddPaginationFlags(cmd *cobra.Command, flags *PaginationFlags)

AddPaginationFlags registers --page and --limit flags on a cobra command. The flags are bound to the provided PaginationFlags struct.

Example:

flags := DefaultPaginationFlags()
AddPaginationFlags(cmd, flags)

func ContextCompletion

func ContextCompletion() func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

ContextCompletion returns a cobra.ValidArgsFunction that provides context name completions. It reads available contexts from the local config file and filters by the user's input prefix. This function makes no network calls, ensuring fast completion times.

Example usage:

cmd := &cobra.Command{
    Use:               "use <name>",
    ValidArgsFunction: ContextCompletion(),
}

func Execute

func Execute() error

Execute runs the root command and returns any error. This is called by main.main() and handles command execution. Deprecated: Use ExecuteWithExitCode() for proper exit code handling.

func ExecuteWithContext

func ExecuteWithContext(ctx context.Context) int

ExecuteWithContext runs the root command with the given context and returns an appropriate exit code. The context is passed to Cobra so that all subcommands can observe cancellation (e.g. from SIGINT/SIGTERM).

func ExecuteWithExitCode deprecated

func ExecuteWithExitCode() int

ExecuteWithExitCode runs the root command and returns an appropriate exit code. This maps errors to exit codes for proper CLI behavior:

  • 0: Success
  • 1: General error
  • 2: Command misuse (invalid arguments)
  • 3: Authentication required
  • 4: Permission denied
  • 5: Resource not found
  • 6: Rate limited
  • 7: Server error
  • 8: Network error
  • 9: Timeout
  • 10: Plan limit exceeded

Deprecated: Use ExecuteWithContext for signal-aware execution.

func FormatPaginationInfo

func FormatPaginationInfo(page, limit, total int) string

FormatPaginationInfo formats pagination metadata for display. Returns a human-readable string showing current position in results.

Examples:

  • "Page 1 of 5 (100 total items)"
  • "Page 3 of 3 (45 total items)"
  • "1 item" (when total is 1)
  • "45 items" (when showing all on one page)

func GetConfig

func GetConfig() *config.Config

GetConfig returns the loaded configuration. Returns nil if called before Execute() or if config loading failed. Subcommands should call this in their Run/RunE functions.

func GetConfigOrFail

func GetConfigOrFail() *config.Config

GetConfigOrFail returns the loaded configuration or exits with an error. This is a convenience function for commands that require a valid config.

func GetDryRun

func GetDryRun() bool

GetDryRun returns true if commands should show what would be done without executing. Commands that modify state should check this and print their intended actions instead.

func GetNoInput

func GetNoInput() bool

GetNoInput returns true if interactive prompts should be disabled. Commands should check this before prompting for user input.

func GetTimeout

func GetTimeout() int

GetTimeout returns the effective HTTP request timeout in seconds. Returns the --timeout flag value, STACKEYE_TIMEOUT env var, config preference, or 0 if none is set (SDK uses its own default of 30s).

func GetVerbosity

func GetVerbosity() int

GetVerbosity returns the kubectl-style verbosity level (0-10). Level meanings:

  • 0: Errors only (default)
  • 1: Warnings + errors
  • 2: Info messages
  • 3: Extended info (config/context details)
  • 4: Debug messages (internal flow)
  • 5: HTTP requests (method, URL, duration)
  • 6: HTTP responses (+ status code, body size)
  • 7: Request headers (redacted)
  • 8: Response headers
  • 9: Full bodies (truncated at 10KB)
  • 10: Trace (curl equivalent, timing breakdown)

func HasNextPage

func HasNextPage(page, limit, total int) bool

HasNextPage returns true if there are more pages after the current page.

func HasPreviousPage

func HasPreviousPage(page int) bool

HasPreviousPage returns true if there are pages before the current page.

func InitHelp

func InitHelp(cmd *cobra.Command, cfg *HelpConfig)

InitHelp initializes the custom help system for the CLI. This should be called after creating the root command.

Example:

rootCmd := NewRootCmd()
InitHelp(rootCmd, &HelpConfig{
    ColorManager: output.NewColorManager(output.ColorAuto),
})

func NewAPIKeyCmd

func NewAPIKeyCmd() *cobra.Command

NewAPIKeyCmd creates and returns the api-key parent command. This command provides management of API keys for programmatic access.

func NewAPIKeyCreateCmd

func NewAPIKeyCreateCmd() *cobra.Command

NewAPIKeyCreateCmd creates and returns the api-key create subcommand.

func NewAPIKeyDeleteCmd

func NewAPIKeyDeleteCmd() *cobra.Command

NewAPIKeyDeleteCmd creates and returns the api-key delete subcommand.

func NewAPIKeyListCmd

func NewAPIKeyListCmd() *cobra.Command

NewAPIKeyListCmd creates and returns the api-key list subcommand.

func NewAdminCmd

func NewAdminCmd() *cobra.Command

NewAdminCmd creates and returns the admin parent command. This command provides access to platform administration features. Admin commands require platform administrator privileges.

func NewAdminM2MKeyCmd

func NewAdminM2MKeyCmd() *cobra.Command

NewAdminM2MKeyCmd creates and returns the admin m2m-key parent command. This command provides access to machine-to-machine key management features.

func NewAdminM2MKeyCreateCmd

func NewAdminM2MKeyCreateCmd() *cobra.Command

NewAdminM2MKeyCreateCmd creates and returns the m2m-key create command.

func NewAdminM2MKeyDeactivateCmd

func NewAdminM2MKeyDeactivateCmd() *cobra.Command

NewAdminM2MKeyDeactivateCmd creates and returns the m2m-key deactivate command.

func NewAdminM2MKeyGetCmd

func NewAdminM2MKeyGetCmd() *cobra.Command

NewAdminM2MKeyGetCmd creates and returns the m2m-key get command.

func NewAdminM2MKeyListCmd

func NewAdminM2MKeyListCmd() *cobra.Command

NewAdminM2MKeyListCmd creates and returns the m2m-key list command.

func NewAdminM2MKeyRotateCmd

func NewAdminM2MKeyRotateCmd() *cobra.Command

NewAdminM2MKeyRotateCmd creates and returns the m2m-key rotate command.

func NewAdminWorkerKeyCmd

func NewAdminWorkerKeyCmd() *cobra.Command

NewAdminWorkerKeyCmd creates and returns the admin worker-key parent command. This command provides access to worker key management features.

func NewAdminWorkerKeyCreateCmd

func NewAdminWorkerKeyCreateCmd() *cobra.Command

NewAdminWorkerKeyCreateCmd creates and returns the worker-key create command.

func NewAdminWorkerKeyDeleteCmd

func NewAdminWorkerKeyDeleteCmd() *cobra.Command

NewAdminWorkerKeyDeleteCmd creates and returns the worker-key delete command.

func NewAdminWorkerKeyHealthCmd

func NewAdminWorkerKeyHealthCmd() *cobra.Command

NewAdminWorkerKeyHealthCmd creates and returns the worker-key health command.

func NewAgentCmd

func NewAgentCmd() *cobra.Command

NewAgentCmd creates and returns the agent parent command. This command provides access to self-hosted agent lifecycle operations.

Task #10547: Add CLI agent register/list/status commands (F-841)

func NewAgentGetCmd

func NewAgentGetCmd() *cobra.Command

NewAgentGetCmd creates and returns the agent get command.

func NewAgentListCmd

func NewAgentListCmd() *cobra.Command

NewAgentListCmd creates and returns the agent list command.

func NewAgentRegisterCmd

func NewAgentRegisterCmd() *cobra.Command

NewAgentRegisterCmd creates and returns the agent register command.

func NewAlertAckCmd

func NewAlertAckCmd() *cobra.Command

NewAlertAckCmd creates and returns the alert ack subcommand.

func NewAlertCmd

func NewAlertCmd() *cobra.Command

NewAlertCmd creates and returns the alert parent command. This command provides management of monitoring alerts.

func NewAlertGetCmd

func NewAlertGetCmd() *cobra.Command

NewAlertGetCmd creates and returns the alert get subcommand.

func NewAlertHistoryCmd

func NewAlertHistoryCmd() *cobra.Command

NewAlertHistoryCmd creates and returns the alert history subcommand.

func NewAlertListCmd

func NewAlertListCmd() *cobra.Command

NewAlertListCmd creates and returns the alert list subcommand.

func NewAlertResolveCmd

func NewAlertResolveCmd() *cobra.Command

NewAlertResolveCmd creates and returns the alert resolve subcommand.

func NewAlertStatsCmd

func NewAlertStatsCmd() *cobra.Command

NewAlertStatsCmd creates and returns the alert stats subcommand.

func NewBillingCmd

func NewBillingCmd() *cobra.Command

NewBillingCmd creates and returns the billing parent command. This command provides access to billing and subscription information.

func NewBillingInfoCmd

func NewBillingInfoCmd() *cobra.Command

NewBillingInfoCmd creates and returns the billing info command.

func NewBillingInvoicesCmd

func NewBillingInvoicesCmd() *cobra.Command

NewBillingInvoicesCmd creates and returns the billing invoices command.

func NewBillingPortalCmd

func NewBillingPortalCmd() *cobra.Command

NewBillingPortalCmd creates and returns the billing portal command.

func NewBillingStatusCmd

func NewBillingStatusCmd() *cobra.Command

NewBillingStatusCmd creates and returns the billing status command.

func NewBillingUsageCmd

func NewBillingUsageCmd() *cobra.Command

NewBillingUsageCmd creates and returns the billing usage command.

func NewChannelCmd

func NewChannelCmd() *cobra.Command

NewChannelCmd creates and returns the channel parent command. This command provides management of notification channels.

func NewChannelCreateCmd

func NewChannelCreateCmd() *cobra.Command

NewChannelCreateCmd creates and returns the channel create subcommand.

func NewChannelDeleteCmd

func NewChannelDeleteCmd() *cobra.Command

NewChannelDeleteCmd creates and returns the channel delete subcommand.

func NewChannelGetCmd

func NewChannelGetCmd() *cobra.Command

NewChannelGetCmd creates and returns the channel get subcommand.

func NewChannelListCmd

func NewChannelListCmd() *cobra.Command

NewChannelListCmd creates and returns the channel list subcommand.

func NewChannelTestCmd

func NewChannelTestCmd() *cobra.Command

NewChannelTestCmd creates and returns the channel test subcommand.

func NewChannelUpdateCmd

func NewChannelUpdateCmd() *cobra.Command

NewChannelUpdateCmd creates and returns the channel update subcommand.

func NewChannelWizardCmd

func NewChannelWizardCmd() *cobra.Command

NewChannelWizardCmd creates and returns the channel wizard subcommand.

func NewCompletionCmd

func NewCompletionCmd() *cobra.Command

NewCompletionCmd creates and returns the completion parent command. This command provides shell completion script generation.

Usage:

stackeye completion bash > ~/.bash_completion.d/stackeye

func NewConfigCmd

func NewConfigCmd() *cobra.Command

NewConfigCmd creates and returns the config parent command.

func NewContextCmd

func NewContextCmd() *cobra.Command

NewContextCmd creates and returns the context parent command.

func NewDashboardCmd

func NewDashboardCmd() *cobra.Command

NewDashboardCmd creates and returns the dashboard command.

func NewDeviceCmd

func NewDeviceCmd() *cobra.Command

NewDeviceCmd creates and returns the device parent command. This command provides management of device tag and region associations. Task stackeye-5859.

func NewDeviceRegionAssignCmd

func NewDeviceRegionAssignCmd() *cobra.Command

NewDeviceRegionAssignCmd creates and returns the device region assign subcommand. Task stackeye-5859.

func NewDeviceRegionCmd

func NewDeviceRegionCmd() *cobra.Command

NewDeviceRegionCmd creates and returns the device region parent command. Task stackeye-5859.

func NewDeviceRegionListCmd

func NewDeviceRegionListCmd() *cobra.Command

NewDeviceRegionListCmd creates and returns the device region list subcommand. Task stackeye-5859.

func NewDeviceRegionUnassignCmd

func NewDeviceRegionUnassignCmd() *cobra.Command

NewDeviceRegionUnassignCmd creates and returns the device region unassign subcommand. Task stackeye-5859.

func NewDeviceTagCmd

func NewDeviceTagCmd() *cobra.Command

NewDeviceTagCmd creates and returns the device tag subcommand. Task stackeye-5859.

func NewDeviceTagListCmd

func NewDeviceTagListCmd() *cobra.Command

NewDeviceTagListCmd creates and returns the device tag list subcommand. Task stackeye-5859.

func NewDeviceUntagCmd

func NewDeviceUntagCmd() *cobra.Command

NewDeviceUntagCmd creates and returns the device untag subcommand. Task stackeye-5859.

func NewEnrollmentKeyCmd

func NewEnrollmentKeyCmd() *cobra.Command

NewEnrollmentKeyCmd creates and returns the enrollment-key parent command. This command provides management of Station enrollment keys — reusable bootstrap credentials that mint new Stations (design docs/station/design.md §5).

func NewEnrollmentKeyCreateCmd

func NewEnrollmentKeyCreateCmd() *cobra.Command

NewEnrollmentKeyCreateCmd creates and returns the enrollment-key create subcommand.

func NewEnrollmentKeyListCmd

func NewEnrollmentKeyListCmd() *cobra.Command

NewEnrollmentKeyListCmd creates and returns the enrollment-key list subcommand.

func NewEnrollmentKeyRevokeCmd

func NewEnrollmentKeyRevokeCmd() *cobra.Command

NewEnrollmentKeyRevokeCmd creates and returns the enrollment-key revoke subcommand.

func NewEnrollmentKeyRotateCmd

func NewEnrollmentKeyRotateCmd() *cobra.Command

NewEnrollmentKeyRotateCmd creates and returns the enrollment-key rotate subcommand.

func NewEnvCmd

func NewEnvCmd() *cobra.Command

NewEnvCmd creates and returns the env command.

func NewIncidentCmd

func NewIncidentCmd() *cobra.Command

NewIncidentCmd creates and returns the incident parent command. This command provides management of status page incidents.

func NewIncidentCreateCmd

func NewIncidentCreateCmd() *cobra.Command

NewIncidentCreateCmd creates and returns the incident create subcommand.

func NewIncidentDeleteCmd

func NewIncidentDeleteCmd() *cobra.Command

NewIncidentDeleteCmd creates and returns the incident delete subcommand.

func NewIncidentGetCmd

func NewIncidentGetCmd() *cobra.Command

NewIncidentGetCmd creates and returns the incident get subcommand.

func NewIncidentListCmd

func NewIncidentListCmd() *cobra.Command

NewIncidentListCmd creates and returns the incident list subcommand.

func NewIncidentResolveCmd

func NewIncidentResolveCmd() *cobra.Command

NewIncidentResolveCmd creates and returns the incident resolve subcommand.

func NewIncidentUpdateCmd

func NewIncidentUpdateCmd() *cobra.Command

NewIncidentUpdateCmd creates and returns the incident update subcommand.

func NewLabelCmd

func NewLabelCmd() *cobra.Command

NewLabelCmd creates and returns the label parent command. This command provides management of organization label keys. Task #8064

func NewLabelCreateCmd

func NewLabelCreateCmd() *cobra.Command

NewLabelCreateCmd creates and returns the label create subcommand.

func NewLabelDeleteCmd

func NewLabelDeleteCmd() *cobra.Command

NewLabelDeleteCmd creates and returns the label delete subcommand.

func NewLabelListCmd

func NewLabelListCmd() *cobra.Command

NewLabelListCmd creates and returns the label list subcommand.

func NewLoginCmd

func NewLoginCmd() *cobra.Command

NewLoginCmd creates and returns the login command.

func NewLogoutCmd

func NewLogoutCmd() *cobra.Command

NewLogoutCmd creates and returns the logout command.

func NewMaintenanceCalendarCmd

func NewMaintenanceCalendarCmd() *cobra.Command

NewMaintenanceCalendarCmd creates and returns the maintenance calendar subcommand.

func NewMaintenanceCmd

func NewMaintenanceCmd() *cobra.Command

NewMaintenanceCmd creates and returns the maintenance parent command. This command provides management of scheduled maintenance windows.

func NewMaintenanceCreateCmd

func NewMaintenanceCreateCmd() *cobra.Command

NewMaintenanceCreateCmd creates and returns the maintenance create subcommand.

func NewMaintenanceDeleteCmd

func NewMaintenanceDeleteCmd() *cobra.Command

NewMaintenanceDeleteCmd creates and returns the maintenance delete subcommand.

func NewMaintenanceListCmd

func NewMaintenanceListCmd() *cobra.Command

NewMaintenanceListCmd creates and returns the maintenance list subcommand.

func NewMuteCmd

func NewMuteCmd() *cobra.Command

NewMuteCmd creates and returns the mute parent command. This command provides management of alert mute periods.

func NewMuteCreateCmd

func NewMuteCreateCmd() *cobra.Command

NewMuteCreateCmd creates and returns the mute create subcommand.

func NewMuteDeleteCmd

func NewMuteDeleteCmd() *cobra.Command

NewMuteDeleteCmd creates and returns the mute delete subcommand.

func NewMuteExpireCmd

func NewMuteExpireCmd() *cobra.Command

NewMuteExpireCmd creates and returns the mute expire subcommand.

func NewMuteGetCmd

func NewMuteGetCmd() *cobra.Command

NewMuteGetCmd creates and returns the mute get subcommand.

func NewMuteListCmd

func NewMuteListCmd() *cobra.Command

NewMuteListCmd creates and returns the mute list subcommand.

func NewOrgCmd

func NewOrgCmd() *cobra.Command

NewOrgCmd creates and returns the org parent command. This command provides management of organizations.

func NewOrgGetCmd

func NewOrgGetCmd() *cobra.Command

NewOrgGetCmd creates and returns the org get subcommand.

func NewOrgListCmd

func NewOrgListCmd() *cobra.Command

NewOrgListCmd creates and returns the org list subcommand.

func NewOrgSwitchCmd

func NewOrgSwitchCmd() *cobra.Command

NewOrgSwitchCmd creates and returns the org switch subcommand.

func NewPrivateRegionCmd

func NewPrivateRegionCmd() *cobra.Command

NewPrivateRegionCmd creates and returns the private-region parent command. This command provides access to private monitoring region lifecycle operations.

Task: #10495 — Add CLI private-region lifecycle commands and tests (F-838)

func NewPrivateRegionCreateCmd

func NewPrivateRegionCreateCmd() *cobra.Command

NewPrivateRegionCreateCmd creates and returns the private-region create command.

func NewPrivateRegionGetCmd

func NewPrivateRegionGetCmd() *cobra.Command

NewPrivateRegionGetCmd creates and returns the private-region get command.

func NewPrivateRegionListCmd

func NewPrivateRegionListCmd() *cobra.Command

NewPrivateRegionListCmd creates and returns the private-region list command.

func NewPrivateRegionRevokeCmd

func NewPrivateRegionRevokeCmd() *cobra.Command

NewPrivateRegionRevokeCmd creates and returns the private-region revoke command.

func NewPrivateRegionRotateCmd

func NewPrivateRegionRotateCmd() *cobra.Command

NewPrivateRegionRotateCmd creates and returns the private-region rotate command.

func NewProbeCmd

func NewProbeCmd() *cobra.Command

NewProbeCmd creates and returns the probe parent command. This command provides management of monitoring probes.

func NewProbeCreateCmd

func NewProbeCreateCmd() *cobra.Command

NewProbeCreateCmd creates and returns the probe create subcommand.

func NewProbeDeleteCmd

func NewProbeDeleteCmd() *cobra.Command

NewProbeDeleteCmd creates and returns the probe delete subcommand.

func NewProbeDepsAddCmd

func NewProbeDepsAddCmd() *cobra.Command

NewProbeDepsAddCmd creates and returns the probe deps add subcommand.

func NewProbeDepsClearCmd

func NewProbeDepsClearCmd() *cobra.Command

NewProbeDepsClearCmd creates and returns the probe deps clear subcommand. Task #8026: Implements bulk removal of probe dependencies.

func NewProbeDepsCmd

func NewProbeDepsCmd() *cobra.Command

NewProbeDepsCmd creates and returns the probe deps parent command. This command provides management of probe dependencies for hierarchical alerting.

func NewProbeDepsListCmd

func NewProbeDepsListCmd() *cobra.Command

NewProbeDepsListCmd creates and returns the probe deps list subcommand.

func NewProbeDepsRemoveCmd

func NewProbeDepsRemoveCmd() *cobra.Command

NewProbeDepsRemoveCmd creates and returns the probe deps remove subcommand. Task #8025: Implements removal of probe dependencies.

func NewProbeDepsTreeCmd

func NewProbeDepsTreeCmd() *cobra.Command

NewProbeDepsTreeCmd creates and returns the probe deps tree subcommand. Task #8027: Implements ASCII tree visualization of probe dependencies.

func NewProbeDepsWizardCmd

func NewProbeDepsWizardCmd() *cobra.Command

NewProbeDepsWizardCmd creates and returns the probe deps wizard subcommand. Task #8028: Implements guided dependency setup wizard.

func NewProbeExportCmd

func NewProbeExportCmd() *cobra.Command

NewProbeExportCmd creates and returns the probe export subcommand.

func NewProbeGetCmd

func NewProbeGetCmd() *cobra.Command

NewProbeGetCmd creates and returns the probe get subcommand.

func NewProbeHistoryCmd

func NewProbeHistoryCmd() *cobra.Command

NewProbeHistoryCmd creates and returns the probe history subcommand.

func NewProbeImportCmd

func NewProbeImportCmd() *cobra.Command

NewProbeImportCmd creates and returns the probe import subcommand.

func NewProbeLabelCmd

func NewProbeLabelCmd() *cobra.Command

NewProbeLabelCmd creates and returns the probe label subcommand. Task #8068

func NewProbeLinkChannelCmd

func NewProbeLinkChannelCmd() *cobra.Command

NewProbeLinkChannelCmd creates and returns the probe link-channel subcommand.

func NewProbeListCmd

func NewProbeListCmd() *cobra.Command

NewProbeListCmd creates and returns the probe list subcommand.

func NewProbeLogsCmd

func NewProbeLogsCmd() *cobra.Command

NewProbeLogsCmd creates and returns the probe logs subcommand.

func NewProbePauseCmd

func NewProbePauseCmd() *cobra.Command

NewProbePauseCmd creates and returns the probe pause subcommand.

func NewProbeResumeCmd

func NewProbeResumeCmd() *cobra.Command

NewProbeResumeCmd creates and returns the probe resume subcommand.

func NewProbeStatsCmd

func NewProbeStatsCmd() *cobra.Command

NewProbeStatsCmd creates and returns the probe stats subcommand.

func NewProbeTestCmd

func NewProbeTestCmd() *cobra.Command

NewProbeTestCmd creates and returns the probe test subcommand.

func NewProbeUnlabelCmd

func NewProbeUnlabelCmd() *cobra.Command

NewProbeUnlabelCmd creates and returns the probe unlabel subcommand. Task #8069

func NewProbeUnlinkChannelCmd

func NewProbeUnlinkChannelCmd() *cobra.Command

NewProbeUnlinkChannelCmd creates and returns the probe unlink-channel subcommand.

func NewProbeUpdateCmd

func NewProbeUpdateCmd() *cobra.Command

NewProbeUpdateCmd creates and returns the probe update subcommand.

func NewProbeWatchCmd

func NewProbeWatchCmd() *cobra.Command

NewProbeWatchCmd creates and returns the probe watch subcommand.

func NewProbeWizardCmd

func NewProbeWizardCmd() *cobra.Command

NewProbeWizardCmd creates and returns the probe wizard command.

func NewRegionCmd

func NewRegionCmd() *cobra.Command

NewRegionCmd creates and returns the region parent command. This command provides information about monitoring regions.

func NewRegionListCmd

func NewRegionListCmd() *cobra.Command

NewRegionListCmd creates and returns the region list subcommand.

func NewRegionStatusCmd

func NewRegionStatusCmd() *cobra.Command

NewRegionStatusCmd creates and returns the region status subcommand.

func NewSetupCmd

func NewSetupCmd() *cobra.Command

NewSetupCmd creates and returns the setup command.

func NewStatusPageAddProbeCmd

func NewStatusPageAddProbeCmd() *cobra.Command

NewStatusPageAddProbeCmd creates and returns the status-page add-probe subcommand.

func NewStatusPageCmd

func NewStatusPageCmd() *cobra.Command

NewStatusPageCmd creates and returns the status-page parent command. This command provides management of public status pages.

func NewStatusPageCreateCmd

func NewStatusPageCreateCmd() *cobra.Command

NewStatusPageCreateCmd creates and returns the status-page create subcommand.

func NewStatusPageDeleteCmd

func NewStatusPageDeleteCmd() *cobra.Command

NewStatusPageDeleteCmd creates and returns the status-page delete subcommand.

func NewStatusPageDomainVerifyCmd

func NewStatusPageDomainVerifyCmd() *cobra.Command

NewStatusPageDomainVerifyCmd creates and returns the status-page domain-verify subcommand.

func NewStatusPageGetCmd

func NewStatusPageGetCmd() *cobra.Command

NewStatusPageGetCmd creates and returns the status-page get subcommand.

func NewStatusPageGetStatusCmd

func NewStatusPageGetStatusCmd() *cobra.Command

NewStatusPageGetStatusCmd creates and returns the status-page get-status subcommand.

func NewStatusPageListCmd

func NewStatusPageListCmd() *cobra.Command

NewStatusPageListCmd creates and returns the status-page list subcommand.

func NewStatusPageRemoveProbeCmd

func NewStatusPageRemoveProbeCmd() *cobra.Command

NewStatusPageRemoveProbeCmd creates and returns the status-page remove-probe subcommand.

func NewStatusPageReorderProbesCmd

func NewStatusPageReorderProbesCmd() *cobra.Command

NewStatusPageReorderProbesCmd creates and returns the status-page reorder-probes subcommand.

func NewStatusPageUpdateCmd

func NewStatusPageUpdateCmd() *cobra.Command

NewStatusPageUpdateCmd creates and returns the status-page update subcommand.

func NewTeamCmd

func NewTeamCmd() *cobra.Command

NewTeamCmd creates and returns the team parent command. This command provides management of team members and invitations.

func NewTeamInvitationsCmd

func NewTeamInvitationsCmd() *cobra.Command

NewTeamInvitationsCmd creates and returns the team invitations subcommand.

func NewTeamInviteCmd

func NewTeamInviteCmd() *cobra.Command

NewTeamInviteCmd creates and returns the team invite subcommand.

func NewTeamListCmd

func NewTeamListCmd() *cobra.Command

NewTeamListCmd creates and returns the team list subcommand.

func NewTeamRemoveCmd

func NewTeamRemoveCmd() *cobra.Command

NewTeamRemoveCmd creates and returns the team remove subcommand.

func NewTeamRevokeInvitationCmd

func NewTeamRevokeInvitationCmd() *cobra.Command

NewTeamRevokeInvitationCmd creates and returns the team revoke-invitation subcommand.

func NewTeamUpdateRoleCmd

func NewTeamUpdateRoleCmd() *cobra.Command

NewTeamUpdateRoleCmd creates and returns the team update-role subcommand.

func NewTelemetryCmd

func NewTelemetryCmd() *cobra.Command

NewTelemetryCmd creates and returns the telemetry parent command. This command provides access to telemetry configuration.

func NewTelemetryDisableCmd

func NewTelemetryDisableCmd() *cobra.Command

NewTelemetryDisableCmd creates and returns the telemetry disable command.

func NewTelemetryEnableCmd

func NewTelemetryEnableCmd() *cobra.Command

NewTelemetryEnableCmd creates and returns the telemetry enable command.

func NewTelemetryStatusCmd

func NewTelemetryStatusCmd() *cobra.Command

NewTelemetryStatusCmd creates and returns the telemetry status command.

func NewUpgradeCmd

func NewUpgradeCmd() *cobra.Command

NewUpgradeCmd creates and returns the upgrade command.

func NewVersionCmd

func NewVersionCmd() *cobra.Command

NewVersionCmd creates and returns the version command.

func NewWhoamiCmd

func NewWhoamiCmd() *cobra.Command

NewWhoamiCmd creates and returns the whoami command.

func PageToOffset

func PageToOffset(page, limit int) int

PageToOffset converts a 1-indexed page number to a 0-indexed offset. This is useful when the API uses offset-based pagination.

Example:

offset := PageToOffset(2, 20) // Returns 20 (skip first page of 20 items)

func ProbeCompletion

func ProbeCompletion() func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

ProbeCompletion returns a cobra.ValidArgsFunction that provides probe name/ID completions. It fetches the probe list from the API and filters by the user's input prefix. On error (including offline), it returns an empty list to allow graceful degradation.

Example usage:

cmd := &cobra.Command{
    Use:               "get <id>",
    ValidArgsFunction: ProbeCompletion(),
}

func RenderHelp

func RenderHelp(cmd *cobra.Command) (string, error)

RenderHelp renders the help output for a command. This can be used to test help rendering.

func ResolveDeviceID

func ResolveDeviceID(ctx context.Context, c *client.Client, idOrName string) (uuid.UUID, error)

ResolveDeviceID resolves a device identifier to a UUID. If the input is a valid UUID, it returns it immediately without API calls. If the input is not a UUID, it looks up a device by exact (case-insensitive) name match and returns its UUID. Unlike ResolveProbeID, the devices API has no server-side search filter, so this fetches the organization's full device list and matches client-side — deliberately exact-match only (no substring fallback) to keep results predictable across large fleets. Task stackeye-5859.

func ResolveProbeID

func ResolveProbeID(ctx context.Context, c *client.Client, idOrName string) (uuid.UUID, error)

ResolveProbeID resolves a probe identifier to a UUID. If the input is a valid UUID, it returns it immediately without API calls. If the input is not a UUID, it searches for a probe by name and returns its UUID. Returns an error if the probe is not found or if multiple probes match the name.

func ResolveProbeIDs

func ResolveProbeIDs(ctx context.Context, c *client.Client, idOrNames []string) ([]uuid.UUID, error)

ResolveProbeIDs resolves multiple probe identifiers to UUIDs. Each identifier can be either a UUID or a probe name. Returns an error if any probe cannot be resolved.

func RootCmd

func RootCmd() *cobra.Command

RootCmd returns the root command for adding subcommands. This is used by subcommand packages to register themselves.

func SetNoColor

func SetNoColor(disabled bool)

SetNoColor updates the help system to disable colors. This is called when --no-color flag is set.

func TotalPages

func TotalPages(limit, total int) int

TotalPages calculates the total number of pages given limit and total count.

func ValidatePaginationFlags

func ValidatePaginationFlags(flags *PaginationFlags) error

ValidatePaginationFlags validates the page and limit values. Returns an error if values are outside acceptable ranges.

Validation rules:

  • Page must be >= 1
  • Limit must be between 1 and 100 (inclusive)

Types

type AlertAckBatchResponse

type AlertAckBatchResponse struct {
	Acknowledged []*client.Alert `json:"acknowledged"`
	Failed       []AlertAckError `json:"failed,omitempty"`
	Total        int             `json:"total"`
	SuccessCount int             `json:"success_count"`
	FailedCount  int             `json:"failed_count"`
}

AlertAckBatchResponse wraps multiple acknowledged alerts for batch output.

type AlertAckError

type AlertAckError struct {
	ID    string `json:"id"`
	Error string `json:"error"`
}

AlertAckError represents a failed acknowledgment attempt.

type AlertAckResponse

type AlertAckResponse struct {
	Alert   *client.Alert `json:"alert"`
	Message string        `json:"message,omitempty"`
}

AlertAckResponse wraps the acknowledged alert data for output.

type AlertGetResponse

type AlertGetResponse struct {
	Alert    *client.Alert               `json:"alert"`
	Timeline []client.AlertTimelineEvent `json:"timeline,omitempty"`
}

AlertGetResponse wraps the alert data with optional timeline for output.

type AlertResolveBatchResponse

type AlertResolveBatchResponse struct {
	Resolved     []*client.Alert     `json:"resolved"`
	Failed       []AlertResolveError `json:"failed,omitempty"`
	Total        int                 `json:"total"`
	SuccessCount int                 `json:"success_count"`
	FailedCount  int                 `json:"failed_count"`
}

AlertResolveBatchResponse wraps multiple resolved alerts for batch output.

type AlertResolveError

type AlertResolveError struct {
	ID    string `json:"id"`
	Error string `json:"error"`
}

AlertResolveError represents a failed resolution attempt.

type AlertResolveResponse

type AlertResolveResponse struct {
	Alert   *client.Alert `json:"alert"`
	Message string        `json:"message,omitempty"`
}

AlertResolveResponse wraps the resolved alert data for output.

type Authenticator

type Authenticator interface {
	Login(opts auth.Options) (*auth.Result, error)
}

Authenticator abstracts the browser-based login so tests can inject fakes.

type ChannelTestResult

type ChannelTestResult struct {
	ChannelID      uuid.UUID `json:"channel_id" yaml:"channel_id"`
	ChannelName    string    `json:"channel_name" yaml:"channel_name"`
	ChannelType    string    `json:"channel_type" yaml:"channel_type"`
	Success        bool      `json:"success" yaml:"success"`
	Message        string    `json:"message" yaml:"message"`
	Error          *string   `json:"error,omitempty" yaml:"error,omitempty"`
	ResponseTimeMs int       `json:"response_time_ms" yaml:"response_time_ms"`
}

ChannelTestResult wraps the test response with channel metadata for output formatting. This struct is exported to allow JSON/YAML serialization with proper field tags.

type CommandGroup

type CommandGroup struct {
	Name     string
	Commands []*cobra.Command
}

CommandGroup represents a logical grouping of commands for help output.

func GroupCommands

func GroupCommands(commands []*cobra.Command) []CommandGroup

GroupCommands organizes commands into logical groups for display.

type HelpConfig

type HelpConfig struct {
	// ColorManager provides colored output formatting.
	ColorManager *output.ColorManager
	// Writer is the output destination (defaults to os.Stdout).
	Writer io.Writer
}

HelpConfig holds configuration for the custom help system.

func GetHelpConfig

func GetHelpConfig() *HelpConfig

GetHelpConfig returns the current help configuration. Returns a default config if InitHelp hasn't been called.

type OrgDetail

type OrgDetail struct {
	// Basic organization info
	ID        string `json:"id"`
	Name      string `json:"name"`
	Slug      string `json:"slug"`
	Role      string `json:"role"`
	IsCurrent bool   `json:"is_current"`

	// Plan and billing info
	Plan          string  `json:"plan"`
	PlanStatus    string  `json:"plan_status"`
	TrialEndsAt   *string `json:"trial_ends_at,omitempty"`
	NextBillingAt *string `json:"next_billing_at,omitempty"`

	// Usage and limits
	MonitorCount    int `json:"monitor_count"`
	MonitorLimit    int `json:"monitor_limit"`
	TeamMemberCount int `json:"team_member_count"`
	TeamMemberLimit int `json:"team_member_limit"`
}

OrgDetail combines organization info with billing and usage details.

type PaginationFlags

type PaginationFlags struct {
	// Page is the 1-indexed page number to retrieve.
	Page int
	// Limit is the number of results per page (1-100).
	Limit int
}

PaginationFlags holds common pagination flag values. Use this struct to add consistent --page and --limit flags to list commands.

func DefaultPaginationFlags

func DefaultPaginationFlags() *PaginationFlags

DefaultPaginationFlags returns a PaginationFlags with sensible defaults. Page defaults to 1, Limit defaults to 20.

type ProbeHistoryEntry

type ProbeHistoryEntry struct {
	ID             uuid.UUID `json:"id" yaml:"id"`
	CheckedAt      time.Time `json:"checked_at" yaml:"checked_at"`
	Region         string    `json:"region" yaml:"region"`
	Status         string    `json:"status" yaml:"status"`
	ResponseTimeMs int       `json:"response_time_ms" yaml:"response_time_ms"`
	StatusCode     *int      `json:"status_code,omitempty" yaml:"status_code,omitempty"`
	ErrorMessage   *string   `json:"error_message,omitempty" yaml:"error_message,omitempty"`
	SSLExpiryDays  *int      `json:"ssl_expiry_days,omitempty" yaml:"ssl_expiry_days,omitempty"`
}

ProbeHistoryEntry represents a single check result in the history output.

type ProbeHistoryOutput

type ProbeHistoryOutput struct {
	ProbeID uuid.UUID           `json:"probe_id" yaml:"probe_id"`
	Results []ProbeHistoryEntry `json:"results" yaml:"results"`
	Total   int64               `json:"total" yaml:"total"`
	Page    int                 `json:"page" yaml:"page"`
	Limit   int                 `json:"limit" yaml:"limit"`
}

ProbeHistoryOutput wraps probe results for output formatting. This struct is exported to allow JSON/YAML serialization with proper field tags.

type ProbeLogEntry

type ProbeLogEntry struct {
	CheckedAt      time.Time `json:"checked_at" yaml:"checked_at"`
	Region         string    `json:"region" yaml:"region"`
	Status         string    `json:"status" yaml:"status"`
	ResponseTimeMs int       `json:"response_time_ms" yaml:"response_time_ms"`
	StatusCode     *int      `json:"status_code,omitempty" yaml:"status_code,omitempty"`
	ErrorMessage   *string   `json:"error_message,omitempty" yaml:"error_message,omitempty"`
}

ProbeLogEntry represents a single check result in the logs output.

type ProbeLogsOutput

type ProbeLogsOutput struct {
	ProbeID uuid.UUID       `json:"probe_id" yaml:"probe_id"`
	Results []ProbeLogEntry `json:"results" yaml:"results"`
	Total   int64           `json:"total" yaml:"total"`
}

ProbeLogsOutput wraps probe results for the logs command output.

type ProbeStatsOutput

type ProbeStatsOutput struct {
	ProbeID       uuid.UUID `json:"probe_id" yaml:"probe_id"`
	Period        string    `json:"period" yaml:"period"`
	UptimePercent float64   `json:"uptime_percent" yaml:"uptime_percent"`
	TotalChecks   int64     `json:"total_checks" yaml:"total_checks"`
	SuccessChecks int64     `json:"success_checks" yaml:"success_checks"`
	FailureChecks int64     `json:"failure_checks" yaml:"failure_checks"`
	AvgResponseMs float64   `json:"avg_response_time_ms" yaml:"avg_response_time_ms"`
	P95ResponseMs float64   `json:"p95_response_time_ms" yaml:"p95_response_time_ms"`
	P99ResponseMs float64   `json:"p99_response_time_ms" yaml:"p99_response_time_ms"`
	MinResponseMs int       `json:"min_response_time_ms" yaml:"min_response_time_ms"`
	MaxResponseMs int       `json:"max_response_time_ms" yaml:"max_response_time_ms"`
	From          time.Time `json:"from" yaml:"from"`
	To            time.Time `json:"to" yaml:"to"`
	TimeBuckets   int       `json:"time_buckets" yaml:"time_buckets"`
}

ProbeStatsOutput wraps probe statistics for output formatting. This struct is exported to allow JSON/YAML serialization with proper field tags.

type ProbeTestResult

type ProbeTestResult struct {
	ProbeID        uuid.UUID `json:"probe_id" yaml:"probe_id"`
	ProbeName      string    `json:"probe_name" yaml:"probe_name"`
	ProbeURL       string    `json:"probe_url" yaml:"probe_url"`
	Status         string    `json:"status" yaml:"status"`
	ResponseTimeMs int       `json:"response_time_ms" yaml:"response_time_ms"`
	StatusCode     *int      `json:"status_code,omitempty" yaml:"status_code,omitempty"`
	ErrorMessage   *string   `json:"error_message,omitempty" yaml:"error_message,omitempty"`
	SSLExpiryDays  *int      `json:"ssl_expiry_days,omitempty" yaml:"ssl_expiry_days,omitempty"`
	CheckedAt      time.Time `json:"checked_at" yaml:"checked_at"`
}

ProbeTestResult wraps the test response with probe metadata for output formatting. This struct is exported to allow JSON/YAML serialization with proper field tags.

type SwitchResult

type SwitchResult struct {
	OrganizationID   string `json:"organization_id"`
	OrganizationName string `json:"organization_name"`
	OrganizationSlug string `json:"organization_slug"`
	Role             string `json:"role"`
	Message          string `json:"message"`
}

SwitchResult represents the result of an organization switch.

Source Files

Jump to

Keyboard shortcuts

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