Documentation
¶
Index ¶
- Constants
- Variables
- func AddClusterInteractive(ctx *Context) error
- func AddonCreate(ctx *Context, opts struct{ ... }) error
- func AddonDestroy(ctx *Context, opts struct{ ... }) error
- func AddonList(ctx *Context, opts struct{ ... }) error
- func AddonListAvailable(ctx *Context, opts struct{ ... }) error
- func AddonVariants(ctx *Context, opts struct{ ... }) error
- func Admin(ctx *Context, opts struct{ ... }) error
- func AliasList(ctx *Context, opts struct{ ... }) error
- func App(ctx *Context, opts struct{ ... }) error
- func AppDelete(ctx *Context, opts struct{ ... }) error
- func AppHistory(ctx *Context, opts struct{ ... }) error
- func AppList(ctx *Context, opts struct{ ... }) error
- func AppRestart(ctx *Context, opts struct{ ... }) error
- func AppRun(ctx *Context, opts struct{ ... }) error
- func AppStatus(ctx *Context, opts struct{ ... }) error
- func AppVersions(ctx *Context, opts struct{ ... }) error
- func Apps(ctx *Context, opts struct{ ... }) error
- func AuthCIAdd(ctx *Context, opts struct{ ... }) error
- func AuthCIList(ctx *Context, opts struct{ ... }) error
- func AuthCIRemove(ctx *Context, opts struct{ ... }) error
- func AuthGenerate(ctx *Context, opts struct{ ... }) error
- func AuthProviderAddGitHub(ctx *Context, opts struct{ ... }) error
- func AuthProviderAddOIDC(ctx *Context, opts struct{ ... }) error
- func AuthProviderAddPassword(ctx *Context, opts struct{ ... }) error
- func AuthProviderList(ctx *Context, opts struct{ ... }) error
- func AuthProviderRemove(ctx *Context, opts struct{ ... }) error
- func AuthProviderShow(ctx *Context, opts struct{ ... }) error
- func CheckIfUpgradeNeeded(ctx context.Context, targetVersion string, force bool, ...) (bool, error)
- func CheckVersionStatus(ctx context.Context, targetVersion string, mgrOpts *release.ManagerOptions) (current, latest release.VersionInfo, err error)
- func Cluster(ctx *Context, opts struct{ ... }) error
- func ClusterAdd(ctx *Context, opts struct{ ... }) error
- func ClusterCurrent(ctx *Context, opts struct{ ... }) error
- func ClusterExportAddress(ctx *Context, opts struct{ ... }) error
- func ClusterList(ctx *Context, opts struct{ ... }) error
- func ClusterRemove(ctx *Context, opts struct{ ... }) error
- func ClusterSwitch(ctx *Context, opts struct{ ... }) error
- func Colors(ctx *Context, opts struct{}) error
- func ConfigInfo(ctx *Context, opts struct{ ... }) error
- func ConfigLoad(ctx *Context, opts struct{ ... }) error
- func ConfigRemove(ctx *Context, opts struct{ ... }) error
- func ConfigSetActive(ctx *Context, opts struct{ ... }) error
- func CtrNuke(c *Context, opts struct{ ... }) error
- func DebugAdvertise(ctx *Context, opts struct{ ... }) error
- func DebugBundle(ctx *Context, opts struct{ ... }) error
- func DebugConnection(ctx *Context, opts struct{ ... }) error
- func DebugCtr(ctx *Context, opts struct{ ... }) error
- func DebugDiskCreate(ctx *Context, opts struct{ ... }) error
- func DebugDiskDelete(ctx *Context, opts struct{ ... }) error
- func DebugDiskLease(ctx *Context, opts struct{ ... }) error
- func DebugDiskLeaseDelete(ctx *Context, opts struct{ ... }) error
- func DebugDiskLeaseList(ctx *Context, opts struct{ ... }) error
- func DebugDiskLeaseRelease(ctx *Context, opts struct{ ... }) error
- func DebugDiskLeaseStatus(ctx *Context, opts struct{ ... }) error
- func DebugDiskList(ctx *Context, opts struct{ ... }) error
- func DebugDiskMounts(ctx *Context, opts struct{}) error
- func DebugDiskStatus(ctx *Context, opts struct{ ... }) error
- func DebugNetDBGC(ctx *Context, opts struct{ ... }) error
- func DebugNetDBList(ctx *Context, opts struct{ ... }) error
- func DebugNetDBRelease(ctx *Context, opts struct{ ... }) error
- func DebugNetDBStatus(ctx *Context, opts struct{ ... }) error
- func DebugRBAC(ctx *Context, opts struct{ ... }) error
- func DebugRBACTest(ctx *Context, opts struct{ ... }) error
- func DebugReindex(ctx *Context, opts struct{ ... }) error
- func Deploy(ctx *Context, opts struct{ ... }) error
- func DeployCancel(ctx *Context, opts struct{ ... }) error
- func DialStdio(ctx *Context, opts struct{ ... }) error
- func DiskBackup(ctx *Context, opts struct{ ... }) (retErr error)
- func DiskListDeleted(ctx *Context, opts struct{ ... }) error
- func DiskMigrate(ctx *Context, opts struct{ ... }) (retErr error)
- func DiskRestore(ctx *Context, opts struct{ ... }) (retErr error)
- func DiskUndelete(ctx *Context, opts struct{ ... }) error
- func Doctor(ctx *Context, opts struct{ ... }) error
- func DoctorAuth(ctx *Context, opts struct{ ... }) error
- func DoctorConfig(ctx *Context, opts struct{ ... }) error
- func DoctorServer(ctx *Context, opts struct{ ... }) error
- func DownloadRelease(ctx *Context, opts struct{ ... }) error
- func EntityCheck(ctx *Context, opts struct{ ... }) error
- func EntityCreate(ctx *Context, opts struct{ ... }) error
- func EntityDelete(ctx *Context, opts struct{ ... }) error
- func EntityEnsure(ctx *Context, opts struct{ ... }) error
- func EntityGet(ctx *Context, opts struct{ ... }) error
- func EntityList(ctx *Context, opts struct{ ... }) error
- func EntityPatch(ctx *Context, opts struct{ ... }) error
- func EntityPut(ctx *Context, opts struct{ ... }) error
- func EntityReplace(ctx *Context, opts struct{ ... }) error
- func EnvDelete(ctx *Context, opts struct{ ... }) error
- func EnvGet(ctx *Context, opts struct{ ... }) error
- func EnvList(ctx *Context, opts struct{ ... }) error
- func EnvSet(ctx *Context, opts struct{ ... }) error
- func ExpandPath(path string) string
- func FindReleasePath() string
- func HandleVersionDrift(ctx context.Context, mgr *release.Manager, serviceName string) (bool, error)
- func Init(ctx *Context, opts struct{ ... }) error
- func Login(ctx *Context, opts struct{ ... }) error
- func LoginWithDefaults(ctx *Context) error
- func Logout(ctx *Context, opts struct{ ... }) error
- func LogsApp(ctx *Context, opts struct{ ... }) error
- func LogsBuild(ctx *Context, opts struct{ ... }) error
- func LogsSandbox(ctx *Context, opts struct{ ... }) error
- func LogsSystem(ctx *Context, opts struct{ ... }) error
- func MaskValue(value string, sensitive bool) string
- func MinuteLabeler(i int, v float64) string
- func PerformDownloadRelease(ctx *Context, opts DownloadReleaseOptions) error
- func PrintJSON(data any) error
- func PrintJSONTo(w io.Writer, data any) error
- func PrintRunningVersionDrift(serviceName string, onDisk release.VersionInfo) bool
- func PrintUpgradeSuccess(ctx context.Context, oldVersion release.VersionInfo, commandType string, ...)
- func PrintVersionComparison(current, latest release.VersionInfo)
- func Register(ctx *Context, opts RegisterOptions) error
- func RegisterAll(d *mflags.Dispatcher)
- func RegisterStandalone(ctx *Context, opts RegisterOptions) error
- func RegisterStatus(ctx *Context, opts struct{ ... }) error
- func RenderTopLevelHelp(d *mflags.Dispatcher)
- func Rollback(ctx *Context, opts struct{ ... }) error
- func Route(ctx *Context, opts struct{ ... }) error
- func RouteList(ctx *Context, opts struct{ ... }) error
- func RouteProtect(ctx *Context, opts struct{ ... }) error
- func RouteRemove(ctx *Context, opts struct{ ... }) error
- func RouteSet(ctx *Context, opts struct{ ... }) error
- func RouteSetDefault(ctx *Context, opts struct{ ... }) error
- func RouteShow(ctx *Context, opts struct{ ... }) error
- func RouteUnprotect(ctx *Context, opts struct{ ... }) error
- func RouteUnsetDefault(ctx *Context, opts struct{ ... }) error
- func RouteWaf(ctx *Context, opts struct{ ... }) error
- func RunnerInstall(ctx *Context, opts struct{ ... }) error
- func RunnerJoin(ctx *Context, opts struct{ ... }) error
- func RunnerList(ctx *Context, opts struct{ ... }) error
- func RunnerRemove(ctx *Context, opts struct{ ... }) error
- func RunnerServiceStatus(ctx *Context, opts struct{ ... }) error
- func RunnerStart(ctx *Context, opts struct{ ... }) error
- func RunnerStatus(ctx *Context, opts struct{ ... }) error
- func RunnerTokenCreate(ctx *Context, opts struct{ ... }) error
- func RunnerTokenList(ctx *Context, opts struct{ ... }) error
- func RunnerTokenRevoke(ctx *Context, opts struct{ ... }) error
- func RunnerUninstall(ctx *Context, opts struct{ ... }) error
- func RunnerUpgrade(ctx *Context, opts struct{ ... }) error
- func RunnerUpgradeRollback(ctx *Context, opts struct{ ... }) error
- func SandboxCreate(ctx *Context, opts struct{ ... }) error
- func SandboxDelete(ctx *Context, opts struct{ ... }) error
- func SandboxExec(ctx *Context, opts struct{ ... }) error
- func SandboxList(ctx *Context, opts struct{ ... }) error
- func SandboxMetrics(ctx *Context, opts struct{ ... }) error
- func SandboxPoolList(ctx *Context, opts struct{ ... }) error
- func SandboxPoolSetDesired(ctx *Context, opts struct{ ... }) error
- func SandboxStop(ctx *Context, opts struct{ ... }) error
- func Section(name, desc, help string, opts ...SectionOption) mflags.Command
- func SelectCluster(ctx *Context, title string, clusters []string, activeCluster string, ...) (string, error)
- func Server(ctx *Context, opts serverconfig.CLIFlags) error
- func ServerConfigGenerate(ctx *Context, opts struct{ ... }) error
- func ServerConfigValidate(ctx *Context, opts struct{ ... }) error
- func ServerInstall(ctx *Context, opts struct{ ... }) error
- func ServerInstallDocker(ctx *Context, opts struct{ ... }) error
- func ServerStatus(ctx *Context, opts struct{ ... }) error
- func ServerStatusDocker(ctx *Context, opts struct{ ... }) error
- func ServerUninstall(ctx *Context, opts struct{ ... }) error
- func ServerUninstallDocker(ctx *Context, opts struct{ ... }) error
- func ServerUpgrade(ctx *Context, opts struct{ ... }) error
- func ServerUpgradeRollback(ctx *Context, opts struct{ ... }) error
- func Set(ctx *Context, opts struct{ ... }) error
- func TestLoad(ctx *Context, opts struct{ ... }) error
- func Upgrade(ctx *Context, opts struct{ ... }) error
- func Version(ctx *Context, opts VersionOptions) error
- func Whoami(ctx *Context, opts struct{ ... }) error
- type AppCentric
- type BeginKeyRegistrationRequest
- type BeginKeyRegistrationResponse
- type ClusterResponse
- type Cmd
- func (w *Cmd) CommandGroup() string
- func (w *Cmd) Description() string
- func (w *Cmd) Examples() []mflags.Example
- func (w *Cmd) FlagSet() *mflags.FlagSet
- func (w *Cmd) Help() string
- func (w *Cmd) Invoke(args ...string) error
- func (w *Cmd) ReadOptions(path string) error
- func (w *Cmd) RequiredFeature() string
- func (w *Cmd) Run(fs *mflags.FlagSet, args []string) error
- func (w *Cmd) Synopsis() string
- func (w *Cmd) Usage() string
- type CommandOption
- type CommandOutput
- type CompleteKeyRegistrationRequest
- type ConfigCentric
- type Context
- func (c *Context) Begin(format string, args ...interface{})
- func (c *Context) Close() error
- func (c *Context) Completed(format string, args ...interface{})
- func (c *Context) DisplayTable(headers []string, rows [][]string)
- func (c *Context) DisplayTableTemplate(template string, items []any)
- func (c *Context) Info(format string, args ...interface{})
- func (c *Context) Level() slog.Level
- func (c *Context) Printf(format string, args ...interface{})
- func (c *Context) RPCClient(name string) (*rpc.NetworkClient, error)
- func (c *Context) SetExitCode(code int)
- func (c *Context) Verbose() bool
- func (c *Context) Warn(format string, args ...interface{})
- type DebugAuthResponse
- type DeviceFlowExchangeResponse
- type DeviceFlowInitResponse
- type DownloadReleaseOptions
- type EnvVarSpec
- type ErrExitCode
- type FormatOptions
- type GlobalFlags
- type KeyRegistrationResponse
- type LocalEnvDetection
- type LocalEnvVar
- type Model
- type OptsValidate
- type RegisterOptions
- type SectionOption
- type SelectionModel
- type ServerState
- func (s *ServerState) InitContainerd() error
- func (s *ServerState) InitLogsMaintainer()
- func (s *ServerState) InitMetricsReader(log *slog.Logger)
- func (s *ServerState) InitMetricsWriter(log *slog.Logger)
- func (s *ServerState) InitNetServ(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient)
- func (s *ServerState) InitSandboxMetrics(log *slog.Logger)
- func (s *ServerState) InitStatusMonitor(log *slog.Logger)
- type TickMsg
- type VersionOptions
Constants ¶
const ( GroupGettingStarted = "Getting started" GroupMonitoring = "Monitoring your app" GroupConfiguring = "Configuring your app" GroupClient = "Client operations" GroupServer = "Server operations" // GroupHidden commands are registered but filtered from help output. GroupHidden = "Hidden" )
Help group constants — used both as the CommandGroup value on registered commands and as the display label in help output.
Every top-level command should be tagged with one of these groups. The TestAllTopLevelCommandsHaveKnownGroup test catches drift.
const (
Stamp = "Jan _2 03:04:05PM"
)
Variables ¶
var ( // ErrNoAutoConfigNeeded indicates that auto-configuration is not needed or not possible ErrNoAutoConfigNeeded = errors.New("no auto-configuration needed") // ErrAutoConfigFailed indicates that auto-configuration was attempted but failed ErrAutoConfigFailed = errors.New("auto-configuration failed") )
var ErrAccessDenied = errors.New("access denied")
var ErrNoConfig = errors.New("no cluster config")
var HelpGroupOrder = []string{ GroupGettingStarted, GroupMonitoring, GroupConfiguring, GroupClient, GroupServer, }
HelpGroupOrder controls the order groups are rendered in top-level help. GroupHidden is intentionally absent — commands in that group are filtered.
var Meter = spinner.Spinner{ Frames: []string{ line("⠋"), line("⠙"), line("⠹"), line("⠸"), line("⠼"), line("⠴"), line("⠦"), line("⠧"), line("⠇"), line("⠏"), }, FPS: time.Second / 10, }
Meter is the custom spinner animation
Functions ¶
func AddClusterInteractive ¶ added in v0.0.3
AddClusterInteractive prompts the user to select and add a cluster interactively. It auto-selects the identity if only one is available. Returns nil if a cluster was successfully added.
func AddonCreate ¶ added in v0.4.0
func AddonCreate(ctx *Context, opts struct { AppCentric Spec string `position:"0" usage:"Addon spec (e.g., miren-postgresql:small)" required:"true"` Version string `` /* 134-byte string literal not displayed */ }) error
func AddonDestroy ¶ added in v0.4.0
func AddonDestroy(ctx *Context, opts struct { AppCentric Name string `position:"0" usage:"Addon name (e.g., miren-postgresql)" required:"true"` Force bool `short:"f" long:"force" description:"Skip confirmation prompt"` }) error
func AddonList ¶ added in v0.4.0
func AddonList(ctx *Context, opts struct { FormatOptions AppCentric }) error
func AddonListAvailable ¶ added in v0.4.0
func AddonListAvailable(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func AddonVariants ¶ added in v0.4.0
func AddonVariants(ctx *Context, opts struct { FormatOptions ConfigCentric Addon string `position:"0" usage:"Addon name (e.g., miren-postgresql)" required:"true"` }) error
func Admin ¶ added in v0.3.1
func Admin(ctx *Context, opts struct { AppCentric List bool `long:"list" short:"l" description:"List available admin methods"` FuncHelp bool `long:"func-help" description:"Show help for a specific admin method"` JSON bool `long:"json" short:"j" description:"Output as highlighted JSON (default for non-TTY)"` Pretty bool `long:"pretty" short:"p" description:"Render output in a human-friendly format (default for TTY)"` NoValidate bool `long:"no-validate" description:"Skip method/parameter validation"` ParamsFile string `long:"params-file" short:"f" description:"Read params as JSON from file (use - for stdin)"` Method string `position:"0" description:"Admin method to call"` Params []string `rest:"true" description:"Method parameters as key=value pairs"` Unknown []string `unknown:"true"` }) error
func AliasList ¶ added in v0.7.0
func AliasList(ctx *Context, opts struct { FormatOptions }) error
func App ¶
func App(ctx *Context, opts struct { AppCentric FormatOptions Watch bool `short:"w" long:"watch" description:"Watch the app stats"` Graph bool `short:"g" long:"graph" description:"Graph the app stats"` ConfigOnly bool `long:"config-only" description:"Only show the configuration"` }) error
func AppDelete ¶
func AppDelete(ctx *Context, opts struct { Force bool `short:"f" long:"force" description:"Force delete without confirmation"` AppName string `position:"0" usage:"Name of the app to delete"` ConfigCentric }) error
func AppHistory ¶
func AppHistory(ctx *Context, opts struct { AppCentric FormatOptions Limit int `short:"n" long:"limit" description:"Maximum number of deployments to show" default:"10"` All bool `long:"all" description:"Show all deployments (ignore limit)"` Status string `short:"s" long:"status" description:"Filter by status (active, failed, rolled_back)"` HideFailed bool `long:"hide-failed" description:"Hide failed deployments"` Detailed bool `long:"detailed" description:"Show all columns including git information"` }) error
func AppList ¶
func AppList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func AppRestart ¶ added in v0.7.0
func AppRestart(ctx *Context, opts struct { Service string `short:"s" long:"service" description:"Restart only a specific service"` AppCentric }) error
func AppRun ¶ added in v0.2.0
func AppRun(ctx *Context, opts struct { AppCentric Args []string `rest:"true"` }) error
func AppStatus ¶
func AppStatus(ctx *Context, opts struct { AppCentric FormatOptions }) error
func AppVersions ¶ added in v0.8.0
func AppVersions(ctx *Context, opts struct { AppCentric FormatOptions Ephemeral bool `long:"ephemeral" description:"Show only ephemeral versions"` Limit int `short:"n" long:"limit" description:"Max versions to show" default:"20"` }) error
func Apps ¶
func Apps(ctx *Context, opts struct { ConfigCentric }) error
func AuthCIAdd ¶ added in v0.5.0
func AuthCIAdd(ctx *Context, opts struct { GitHub string `long:"github" description:"GitHub owner/repo shorthand (sets issuer, subject, provider)"` Issuer string `long:"issuer" description:"OIDC issuer URL"` Subject string `long:"subject" description:"Glob pattern for the token subject"` AllowedEvents string `long:"allowed-events" description:"Comma-separated event names to allow (default: push,workflow_dispatch)"` AllowedRefs string `long:"allowed-refs" description:"Glob pattern for allowed git refs"` Description string `long:"description" description:"Human-readable description of this binding"` AppCentric }) error
func AuthCIList ¶ added in v0.5.0
func AuthCIList(ctx *Context, opts struct { AppCentric }) error
func AuthCIRemove ¶ added in v0.5.0
func AuthCIRemove(ctx *Context, opts struct { ID string `position:"0" usage:"ID of the CI authentication binding to remove"` ConfigCentric }) error
func AuthGenerate ¶
func AuthGenerate(ctx *Context, opts struct { DataPath string `short:"d" long:"data-path" description:"Data path" default:"/var/lib/miren"` ConfigPath string `short:"c" long:"config-path" description:"Path to the config file, - for stdout" default:"clientconfig.yaml"` Name string `short:"n" long:"name" description:"Name of the client certificate" default:"miren-user"` Target string `short:"t" long:"target" description:"Hostname to embed in the config" default:"localhost"` ClusterName string `short:"C" long:"cluster-name" description:"Name of the cluster" default:"local"` PublicIP bool `short:"p" long:"public-ip" description:"Use public IP for the target, if available"` }) error
func AuthProviderAddGitHub ¶ added in v0.9.0
func AuthProviderAddGitHub(ctx *Context, opts struct { Name string `position:"0" usage:"Name for this identity provider" required:"true"` ClientID string `long:"client-id" description:"GitHub OAuth app client ID" required:"true"` ClientSecret string `long:"client-secret" description:"GitHub OAuth app client secret" required:"true"` Orgs []string `` /* 169-byte string literal not displayed */ Update bool `long:"update" description:"Overwrite an existing provider with the same name (rotates client secret)"` ConfigCentric }) error
func AuthProviderAddOIDC ¶ added in v0.9.0
func AuthProviderAddOIDC(ctx *Context, opts struct { Name string `position:"0" usage:"Name for this identity provider" required:"true"` ProviderURL string `long:"provider-url" description:"OIDC provider URL (e.g., https://accounts.google.com)" required:"true"` ClientID string `long:"client-id" description:"OAuth2 client ID" required:"true"` ClientSecret string `long:"client-secret" description:"OAuth2 client secret" required:"true"` Scopes []string `long:"scope" description:"OAuth2 scopes (can be specified multiple times)"` Update bool `long:"update" description:"Overwrite an existing provider with the same name (rotates client secret)"` ConfigCentric }) error
func AuthProviderAddPassword ¶ added in v0.8.0
func AuthProviderAddPassword(ctx *Context, opts struct { Name string `position:"0" usage:"Name for this password provider" required:"true"` Password string `long:"password" description:"Password (omit to prompt interactively, use @file to read from file)"` Update bool `long:"update" description:"Overwrite an existing provider with the same name (rotates password)"` ConfigCentric }) error
func AuthProviderList ¶ added in v0.8.0
func AuthProviderList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func AuthProviderRemove ¶ added in v0.8.0
func AuthProviderRemove(ctx *Context, opts struct { Name string `position:"0" usage:"Name of the identity provider to remove" required:"true"` Force bool `long:"force" description:"Remove the provider even if it is attached to routes"` ConfigCentric }) error
func AuthProviderShow ¶ added in v0.8.0
func AuthProviderShow(ctx *Context, opts struct { Name string `position:"0" usage:"Name of the identity provider" required:"true"` FormatOptions ConfigCentric }) error
func CheckIfUpgradeNeeded ¶
func CheckIfUpgradeNeeded(ctx context.Context, targetVersion string, force bool, mgrOpts *release.ManagerOptions) (bool, error)
CheckIfUpgradeNeeded checks if target version is newer than current Returns true if upgrade is needed, false if already up to date If mgrOpts is nil, uses default manager options (for server path)
func CheckVersionStatus ¶
func CheckVersionStatus(ctx context.Context, targetVersion string, mgrOpts *release.ManagerOptions) (current, latest release.VersionInfo, err error)
CheckVersionStatus checks if an update is available for the given target version Returns the current and latest version info If mgrOpts is nil, uses default manager options (for server path)
func Cluster ¶
func Cluster(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
Cluster is the default command for the cluster group - shows the list
func ClusterAdd ¶
func ClusterAdd(ctx *Context, opts struct { Identity string `short:"i" long:"identity" description:"Name of the identity to use (optional - will use the only one if single)"` Cluster string `short:"c" long:"cluster" description:"Name of the cluster to create (optional - will list available)"` Address string `short:"a" long:"address" description:"Address/hostname of the cluster (optional - will use from selected cluster)"` Force bool `short:"f" long:"force" description:"Overwrite existing cluster configuration"` }) error
func ClusterCurrent ¶ added in v0.4.0
func ClusterCurrent(ctx *Context, opts struct { AppCentric }) error
func ClusterExportAddress ¶ added in v0.5.0
func ClusterExportAddress(ctx *Context, opts struct { ConfigCentric }) error
func ClusterList ¶
func ClusterList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
ClusterList lists all configured clusters (replaces config info)
func ClusterRemove ¶
func ClusterRemove(ctx *Context, opts struct { Cluster string `position:"0" usage:"Name of the cluster to remove"` ConfigCentric }) error
func ClusterSwitch ¶
func ClusterSwitch(ctx *Context, opts struct { ConfigCentric Cluster string `position:"0" usage:"Name of the cluster to switch to"` }) error
func ConfigInfo ¶
func ConfigInfo(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func ConfigLoad ¶
func ConfigLoad(ctx *Context, opts struct { Config string `long:"config" description:"Path to the config file to update"` Input string `short:"i" long:"input" description:"Path to the input config file to add" required:"true"` Force bool `short:"f" long:"force" description:"Force the update"` SetActive bool `short:"a" long:"set-active" description:"Set the active cluster"` }) error
func ConfigRemove ¶
func ConfigRemove(ctx *Context, opts struct { Cluster string `position:"0" usage:"Name of the cluster to remove"` Force bool `short:"f" long:"force" description:"Force removal without confirmation"` ConfigCentric }) error
func ConfigSetActive ¶
func ConfigSetActive(ctx *Context, opts struct { Cluster string `position:"0" usage:"Name of the cluster to set as active"` ConfigCentric }) error
func DebugAdvertise ¶ added in v0.8.0
func DebugAdvertise(ctx *Context, opts struct { FormatOptions CloudURL string `long:"cloud-url" description:"Cloud URL to use for netcheck (default: https://api.miren.cloud)"` SkipNetcheck bool `long:"skip-netcheck" description:"Skip the netcheck call and only report interface scan"` AdditionalIPs []string `long:"additional-ip" description:"Simulate a server-configured AdditionalIP (repeatable)"` ListenAddr string `long:"listen" description:"Simulate the server's listen address (default: 0.0.0.0:8443)"` }) error
DebugAdvertise runs the same advertise-address computation the server uses (coordinate.ComputeAdvertise) and prints a per-candidate explanation plus the final advertised list, so we can debug cases where the server advertises addresses that aren't actually reachable from clients.
func DebugBundle ¶ added in v0.3.0
func DebugBundle(ctx *Context, opts struct { OutputFile string `short:"o" long:"output" description:"Output file path" default:"miren-debug.tar.gz"` Since string `short:"s" long:"since" description:"Include logs since this time" default:"1 day ago"` Namespace string `long:"namespace" description:"containerd namespace" default:"miren"` Socket string `long:"socket" description:"path to containerd socket"` DockerContainer string `short:"d" long:"docker-container" description:"Docker container name to get logs from" default:"miren"` }) error
func DebugConnection ¶
func DebugConnection(ctx *Context, opts struct { Identity string `short:"i" long:"identity" description:"Identity name to use for authentication"` Cluster string `short:"c" long:"cluster" description:"Cluster name from config to test"` Server string `short:"s" long:"server" description:"Server hostname or IP address to test directly"` Insecure bool `long:"insecure" description:"Skip TLS certificate verification"` }) error
DebugConnection tests connectivity and authentication with a server
func DebugDiskCreate ¶
func DebugDiskCreate(ctx *Context, opts struct { ConfigCentric Name string `short:"n" long:"name" description:"Name for the disk" required:"true"` Size int `short:"s" long:"size" description:"Size of disk in GB" default:"10"` Filesystem string `short:"f" long:"filesystem" description:"Filesystem type (ext4, xfs, btrfs)" default:"ext4"` CreatedBy string `short:"c" long:"created-by" description:"Creator ID for the disk"` RemoteOnly bool `short:"r" long:"remote-only" description:"Store disk only in remote storage (no local replica)"` VolumeID string `short:"V" long:"volume-id" description:"Attach to existing volume instead of creating new one"` }) error
DebugDiskCreate creates a new disk entity for testing
func DebugDiskDelete ¶
func DebugDiskDelete(ctx *Context, opts struct { ConfigCentric ID string `short:"i" long:"id" description:"Disk ID to delete" required:"true"` }) error
DebugDiskDelete deletes a disk entity
func DebugDiskLease ¶
func DebugDiskLease(ctx *Context, opts struct { ConfigCentric DiskID string `short:"d" long:"disk" description:"Disk ID to lease" required:"true"` SandboxID string `short:"s" long:"sandbox" description:"Sandbox ID for the lease"` AppID string `short:"a" long:"app" description:"App ID for the lease"` Path string `short:"p" long:"path" description:"Mount path in sandbox" default:"/data"` ReadOnly bool `short:"r" long:"readonly" description:"Mount as read-only"` Hours int `short:"H" long:"hours" description:"Lease duration in hours" default:"2"` }) error
DebugDiskLease creates a disk lease for testing
func DebugDiskLeaseDelete ¶
func DebugDiskLeaseDelete(ctx *Context, opts struct { ConfigCentric ID string `short:"i" long:"id" description:"Lease ID to delete" required:"true"` Force bool `short:"f" long:"force" description:"Force deletion without releasing"` }) error
DebugDiskLeaseDelete deletes a disk lease entity
func DebugDiskLeaseList ¶
func DebugDiskLeaseList(ctx *Context, opts struct { ConfigCentric DiskID string `short:"d" long:"disk" description:"Filter by disk ID"` SandboxID string `short:"s" long:"sandbox" description:"Filter by sandbox ID"` Status string `long:"status" description:"Filter by status (pending, bound, released, failed)"` }) error
DebugDiskLeaseList lists all disk lease entities
func DebugDiskLeaseRelease ¶
func DebugDiskLeaseRelease(ctx *Context, opts struct { ConfigCentric ID string `short:"i" long:"id" description:"Lease ID to release" required:"true"` }) error
DebugDiskLeaseRelease releases a disk lease
func DebugDiskLeaseStatus ¶
func DebugDiskLeaseStatus(ctx *Context, opts struct { ConfigCentric ID string `short:"i" long:"id" description:"Lease ID to check" required:"true"` }) error
DebugDiskLeaseStatus shows detailed status of a specific disk lease
func DebugDiskList ¶
func DebugDiskList(ctx *Context, opts struct { ConfigCentric }) error
DebugDiskList lists all disk entities
func DebugDiskMounts ¶
DebugDiskMounts lists all mounted runtime-managed disks by reading /proc/mounts
func DebugDiskStatus ¶
func DebugDiskStatus(ctx *Context, opts struct { ConfigCentric ID string `short:"i" long:"id" description:"Disk ID to check" required:"true"` }) error
DebugDiskStatus shows the status of a specific disk
func DebugNetDBGC ¶ added in v0.2.0
func DebugNetDBGC(ctx *Context, opts struct { ConfigCentric Subnet string `short:"s" long:"subnet" description:"Only GC IPs in this subnet"` DryRun bool `short:"n" long:"dry-run" description:"Show what would be released without making changes"` Force bool `short:"f" long:"force" description:"Skip confirmation prompt"` }) error
DebugNetDBGC garbage collects IPs not associated with live sandboxes
func DebugNetDBList ¶ added in v0.2.0
func DebugNetDBList(ctx *Context, opts struct { FormatOptions ConfigCentric Subnet string `short:"s" long:"subnet" description:"Filter by subnet CIDR"` Reserved bool `short:"r" long:"reserved" description:"Show only reserved (in-use) IPs"` Released bool `short:"R" long:"released" description:"Show only released IPs"` }) error
DebugNetDBList lists all IP leases from the netdb
func DebugNetDBRelease ¶ added in v0.2.0
func DebugNetDBRelease(ctx *Context, opts struct { ConfigCentric IP string `short:"i" long:"ip" description:"Specific IP to release"` Subnet string `short:"s" long:"subnet" description:"Release all reserved IPs in subnet"` All bool `short:"a" long:"all" description:"Release all reserved IPs (use with caution)"` Force bool `short:"f" long:"force" description:"Skip confirmation prompt"` }) error
DebugNetDBRelease manually releases IP leases
func DebugNetDBStatus ¶ added in v0.2.0
func DebugNetDBStatus(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
DebugNetDBStatus shows subnet utilization stats
func DebugRBAC ¶
func DebugRBAC(ctx *Context, opts struct { OutputDir string `short:"d" long:"dir" description:"Registration directory" default:"/var/lib/miren/server"` Raw bool `short:"r" long:"raw" description:"Show raw JSON response"` }) error
DebugRBAC fetches and displays the RBAC rules from miren.cloud
func DebugRBACTest ¶
func DebugRBACTest(ctx *Context, opts struct { OutputDir string `short:"d" long:"dir" description:"Registration directory" default:"/var/lib/miren/server"` Groups []string `short:"g" long:"group" description:"Groups to test with"` Tags map[string]string `short:"t" long:"tag" description:"Tags to test with (key:value)"` Resource string `short:"r" long:"resource" description:"Resource to test" required:"true"` Action string `short:"a" long:"action" description:"Action to test" required:"true"` }) error
DebugRBACTest tests RBAC evaluation locally with fetched rules
func DebugReindex ¶
func DebugReindex(ctx *Context, opts struct { ConfigCentric DryRun bool `short:"d" long:"dry-run" description:"Show what would be done without making changes"` Confirm bool `short:"y" long:"yes" description:"Skip confirmation prompt"` }) error
DebugReindex rebuilds all entity indexes from scratch
func Deploy ¶
func Deploy(ctx *Context, opts struct { AppCentric Version string `short:"V" long:"version" description:"Deploy an existing version (skip build)"` Analyze bool `long:"analyze" description:"Analyze the app without building (show detected stack, services, etc.)"` Explain bool `short:"x" long:"explain" description:"Explain the build process"` ExplainFormat string `long:"explain-format" description:"Explain format" choice:"auto" choice:"plain" choice:"tty" choice:"rawjson" default:"auto"` //nolint Force bool `short:"f" long:"force" description:"Skip confirmation prompt"` Env []string `short:"e" long:"env" description:"Set environment variable (KEY=VALUE, KEY=@file, or KEY to prompt)"` Sensitive []string `short:"s" long:"sensitive" description:"Set sensitive environment variable (masked in output)"` Ephemeral string `long:"ephemeral" description:"Deploy as ephemeral preview with this label (e.g. feat-login)"` TTL string `long:"ttl" description:"TTL for ephemeral version (e.g. 48h)" default:"24h"` }) error
func DeployCancel ¶ added in v0.3.0
func DeployCancel(ctx *Context, opts struct { ConfigCentric DeploymentID string `short:"d" long:"deployment" description:"ID of the deployment to cancel" required:"true"` }) error
func DiskBackup ¶ added in v0.6.0
func DiskBackup(ctx *Context, opts struct { ConfigCentric Name string `short:"n" long:"name" description:"Disk name to backup" required:"true"` Output string `short:"o" long:"output" description:"Output snapshot path (default: DISK-YYYYMMDD-HHMMSS.miren.zst)"` DataPath string `long:"data-path" description:"Path to miren data directory" default:"/var/lib/miren"` }) (retErr error)
DiskBackup backs up a disk to a compressed snapshot file.
func DiskListDeleted ¶ added in v0.7.0
func DiskListDeleted(ctx *Context, opts struct { FormatOptions ConfigCentric DataPath string `long:"data-path" description:"Path to miren data directory" default:"/var/lib/miren"` }) error
DiskListDeleted lists disks that have been soft-deleted and are available for recovery via disk undelete.
func DiskMigrate ¶ added in v0.6.0
func DiskMigrate(ctx *Context, opts struct { DataPath string `long:"data-path" description:"Path to LSVD data directory" required:"true"` VolumeName string `long:"volume-name" description:"LSVD volume name" required:"true"` Output string `short:"o" long:"output" description:"Output raw disk image path" required:"true"` }) (retErr error)
DiskMigrate reads an LSVD volume and writes a raw disk image for universal mode.
func DiskRestore ¶ added in v0.6.0
func DiskRestore(ctx *Context, opts struct { ConfigCentric Snapshot string `short:"s" long:"snapshot" description:"Path to snapshot file" required:"true"` Name string `short:"n" long:"name" description:"Disk name to restore to (default: original name from snapshot)"` DataPath string `long:"data-path" description:"Path to miren data directory" default:"/var/lib/miren"` Force bool `short:"f" long:"force" description:"Overwrite existing disk image without confirmation"` }) (retErr error)
DiskRestore restores a disk from a compressed snapshot file.
func DiskUndelete ¶ added in v0.7.0
func DiskUndelete(ctx *Context, opts struct { ConfigCentric Name string `short:"n" long:"name" description:"Disk name to undelete" required:"true"` VolumeID string `short:"V" long:"volume-id" description:"Volume ID to restore (when multiple deleted disks share a name)"` DataPath string `long:"data-path" description:"Path to miren data directory" default:"/var/lib/miren"` }) error
DiskUndelete restores a recently deleted disk from the soft-delete holding area.
func Doctor ¶ added in v0.2.0
func Doctor(ctx *Context, opts struct { ConfigCentric }) error
Doctor shows a quick overview of the miren environment
func DoctorAuth ¶ added in v0.2.0
func DoctorAuth(ctx *Context, opts struct { ConfigCentric }) error
DoctorAuth shows authentication and user information
func DoctorConfig ¶ added in v0.2.0
func DoctorConfig(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
DoctorConfig shows configuration file information
func DoctorServer ¶ added in v0.2.0
func DoctorServer(ctx *Context, opts struct { ConfigCentric }) error
DoctorServer shows server health and connectivity details
func DownloadRelease ¶
func DownloadRelease(ctx *Context, opts struct { Branch string `short:"b" long:"branch" description:"Branch name to download"` Global bool `short:"g" long:"global" description:"Install globally to /var/lib/miren/release"` Force bool `short:"f" long:"force" description:"Force download even if release directory exists"` Output string `short:"o" long:"output" description:"Custom output directory"` }) error
DownloadRelease is the CLI command handler for downloading a release
func EntityCheck ¶
func EntityCreate ¶
func EntityCreate(ctx *Context, opts struct { ConfigCentric Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` Path []string `short:"p" long:"path" description:"Path to the entity file"` Id string `short:"i" long:"id" description:"ID of the entity (optional, auto-generated if not provided)"` DryRun bool `short:"d" long:"dry-run" description:"Dry run, do not actually create the entity"` }) error
func EntityDelete ¶
func EntityDelete(ctx *Context, opts struct { ConfigCentric Id string `short:"i" long:"id" description:"Entity ID" required:"true"` Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` }) error
func EntityEnsure ¶
func EntityEnsure(ctx *Context, opts struct { ConfigCentric Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` Path []string `short:"p" long:"path" description:"Path to the entity file"` Id string `short:"i" long:"id" description:"ID of the entity (required)" required:"true"` DryRun bool `short:"d" long:"dry-run" description:"Dry run, do not actually ensure the entity"` }) error
func EntityGet ¶
func EntityGet(ctx *Context, opts struct { ConfigCentric Id string `short:"i" long:"id" description:"Entity ID" required:"true"` Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` }) error
func EntityList ¶
func EntityList(ctx *Context, opts struct { ConfigCentric Attribute string `short:"a" long:"attribute" description:"Attribute to filter by"` Value string `short:"V" long:"value" description:"Value to filter by"` Kind string `short:"k" long:"kind" description:"Kind of entity to filter by"` Address string `long:"address" description:"Address to listen on" default:"localhost:8443"` }) error
func EntityPatch ¶
func EntityPatch(ctx *Context, opts struct { ConfigCentric Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` Path []string `short:"p" long:"path" description:"Path to the entity file with updates"` Id string `short:"i" long:"id" description:"ID of the entity (required)" required:"true"` Revision int64 `short:"r" long:"revision" description:"Expected revision for optimistic concurrency"` DryRun bool `short:"d" long:"dry-run" description:"Dry run, do not actually patch the entity"` }) error
func EntityPut ¶
func EntityPut(ctx *Context, opts struct { ConfigCentric Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` Path []string `short:"p" long:"path" description:"Path to the entity"` Id string `short:"i" long:"id" description:"ID of the entity"` DryRun bool `short:"d" long:"dry-run" description:"Dry run, do not actually put the entity"` Update bool `short:"u" long:"update" description:"Update the entity if it exists"` }) error
func EntityReplace ¶
func EntityReplace(ctx *Context, opts struct { ConfigCentric Address string `short:"a" long:"address" description:"Address to listen on" default:"localhost:8443"` Path []string `short:"p" long:"path" description:"Path to the entity file"` Id string `short:"i" long:"id" description:"ID of the entity (required)" required:"true"` Revision int64 `short:"r" long:"revision" description:"Expected revision for optimistic concurrency"` DryRun bool `short:"d" long:"dry-run" description:"Dry run, do not actually replace the entity"` }) error
func EnvDelete ¶
func EnvDelete(ctx *Context, opts struct { Keys []string `rest:"true" usage:"Environment variable keys to delete" required:"true"` Service string `short:"S" long:"service" description:"Delete env var from specific service only (if not specified, deletes global env var)"` Force bool `short:"f" long:"force" description:"Skip confirmation prompt"` AppCentric }) error
func EnvGet ¶
func EnvGet(ctx *Context, opts struct { Key string `position:"0" usage:"Environment variable key to get" required:"true"` Service string `short:"S" long:"service" description:"Get env var for specific service (if not specified, gets global env var)"` Unmask bool `short:"u" long:"unmask" description:"Show actual value of sensitive variables instead of masking them"` AppCentric }) error
func EnvList ¶
func EnvList(ctx *Context, opts struct { FormatOptions AppCentric }) error
func EnvSet ¶
func EnvSet(ctx *Context, opts struct { AppCentric Service string `short:"S" long:"service" description:"Set env var for specific service only (if not specified, sets for all services)"` Env []string `` /* 136-byte string literal not displayed */ Sensitive []string `` /* 165-byte string literal not displayed */ }) error
func ExpandPath ¶
func FindReleasePath ¶
func FindReleasePath() string
FindReleasePath looks for an existing miren release directory. It checks the user's home directory first (~/.miren/release), then falls back to the system path (/var/lib/miren/release). Returns empty string if no release directory is found.
func HandleVersionDrift ¶ added in v0.8.0
func HandleVersionDrift(ctx context.Context, mgr *release.Manager, serviceName string) (bool, error)
HandleVersionDrift checks whether the running daemon for the given systemd service differs from the binary on disk. If they differ, the service is restarted via mgr (no download, no install) and the function returns true.
This exists because `CheckIfUpgradeNeeded` only compares on-disk binary vs target version. If a previous `miren upgrade` already replaced the on-disk binary, the running daemon is stale even though "current == target". Drift detection catches that case and triggers just the restart.
If the running version can't be determined (service inaccessible, /proc not readable, etc.), we log a note and return (false, nil) rather than forcing a surprise restart.
func Init ¶
func Init(ctx *Context, opts struct { Name string `short:"n" long:"name" description:"Application name (defaults to directory name)"` Dir string `short:"d" long:"dir" description:"Application directory (defaults to current directory)"` ConfigCentric }) error
func Login ¶
func Login(ctx *Context, opts struct { CloudURL string `short:"u" long:"url" description:"Cloud URL" default:"https://miren.cloud"` IdentityName string `short:"i" long:"identity" description:"Name for this identity in config" default:"cloud"` KeyName string `short:"k" long:"key-name" description:"Name for the authentication key" default:"miren-cli"` NoSave bool `long:"no-save" description:"Don't save credentials to config file"` Force bool `short:"f" long:"force" description:"Overwrite existing identity without prompting"` }) error
Login authenticates with miren.cloud using device flow
func LoginWithDefaults ¶ added in v0.2.1
LoginWithDefaults runs the login flow with default settings
func Logout ¶
func Logout(ctx *Context, opts struct { ConfigCentric IdentityName string `short:"i" long:"identity" description:"Name of the identity to remove"` }) error
Logout removes the local identity and key files
func LogsApp ¶ added in v0.5.0
func LogsApp(ctx *Context, opts struct { AppCentric FormatOptions Last *time.Duration `short:"l" long:"last" description:"Show logs from the last duration"` Follow bool `short:"f" long:"follow" description:"Follow log output (live tail)"` Filter string `short:"g" long:"grep" description:"Filter logs (e.g., 'error', '\"exact phrase\"', 'error -debug', '/regex/')"` Service string `long:"service" description:"Filter logs by service name (e.g., 'web', 'worker')"` }) error
LogsApp shows application logs. This is the default subcommand for `miren logs`.
func LogsBuild ¶ added in v0.5.0
func LogsBuild(ctx *Context, opts struct { AppCentric FormatOptions Version string `position:"0" usage:"Build version (e.g., v3)" required:"true"` Last *time.Duration `short:"l" long:"last" description:"Show logs from the last duration"` Follow bool `short:"f" long:"follow" description:"Follow log output (live tail)"` Filter string `short:"g" long:"grep" description:"Filter logs (e.g., 'error', '\"exact phrase\"', 'error -debug', '/regex/')"` }) error
LogsBuild shows build logs for a specific version.
func LogsSandbox ¶ added in v0.5.0
func LogsSandbox(ctx *Context, opts struct { ConfigCentric FormatOptions SandboxID string `position:"0" usage:"Sandbox ID" required:"true"` Last *time.Duration `short:"l" long:"last" description:"Show logs from the last duration"` Follow bool `short:"f" long:"follow" description:"Follow log output (live tail)"` Filter string `short:"g" long:"grep" description:"Filter logs (e.g., 'error', '\"exact phrase\"', 'error -debug', '/regex/')"` }) error
LogsSandbox shows logs for a specific sandbox.
func LogsSystem ¶ added in v0.5.0
func LogsSystem(ctx *Context, opts struct { ConfigCentric FormatOptions Component string `position:"0" usage:"System component to filter by (e.g., 'etcd', 'scheduler')"` Last *time.Duration `short:"l" long:"last" description:"Show logs from the last duration"` Follow bool `short:"f" long:"follow" description:"Follow log output (live tail)"` Filter string `short:"g" long:"grep" description:"Filter logs (e.g., 'error', '\"exact phrase\"', 'error -debug', '/regex/')"` }) error
LogsSystem shows system/server logs, optionally filtered by component.
func MaskValue ¶ added in v0.8.0
MaskValue masks a sensitive value for display, escaping any control or ANSI-escape sequences so they cannot corrupt or spoof terminal/CI output.
func MinuteLabeler ¶
func PerformDownloadRelease ¶
func PerformDownloadRelease(ctx *Context, opts DownloadReleaseOptions) error
PerformDownloadRelease performs the actual download with the given options
func PrintJSONTo ¶
PrintJSONTo prints JSON to the given writer with pretty formatting.
func PrintRunningVersionDrift ¶ added in v0.8.0
func PrintRunningVersionDrift(serviceName string, onDisk release.VersionInfo) bool
PrintRunningVersionDrift prints an additional line about the running daemon when its version differs from the on-disk binary. Used by --check paths to surface drift without trying to upgrade. Returns true when drift was reported, so callers can adjust their conclusion text.
func PrintUpgradeSuccess ¶
func PrintUpgradeSuccess(ctx context.Context, oldVersion release.VersionInfo, commandType string, mgrOpts *release.ManagerOptions)
PrintUpgradeSuccess prints a formatted success message after upgrade If mgrOpts is nil, uses default manager options (for server path)
func PrintVersionComparison ¶
func PrintVersionComparison(current, latest release.VersionInfo)
PrintVersionComparison prints a formatted comparison of current vs latest versions
func Register ¶
func Register(ctx *Context, opts RegisterOptions) error
Register handles cluster registration with miren.cloud
func RegisterAll ¶ added in v0.3.0
func RegisterAll(d *mflags.Dispatcher)
func RegisterStandalone ¶ added in v0.9.0
func RegisterStandalone(ctx *Context, opts RegisterOptions) error
RegisterStandalone is the CLI entrypoint for `miren server register`. It runs Register and then bounces the local miren.service if one is active, so the user doesn't have to restart manually. The install paths call Register directly because they own the service lifecycle themselves.
func RegisterStatus ¶
func RegisterStatus(ctx *Context, opts struct { Dir string `short:"d" long:"dir" description:"Registration directory" default:"/var/lib/miren/server"` }) error
RegisterStatus displays the current registration status
func RenderTopLevelHelp ¶ added in v0.8.0
func RenderTopLevelHelp(d *mflags.Dispatcher)
RenderTopLevelHelp renders grouped help output for the top-level command list. Commands are rendered in the order defined by HelpGroupOrder. Commands in GroupHidden are filtered out.
func Rollback ¶ added in v0.4.0
func Rollback(ctx *Context, opts struct { AppCentric }) error
func Route ¶
func Route(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
Route is the default command for the route group - shows the list
func RouteList ¶
func RouteList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func RouteProtect ¶ added in v0.8.0
func RouteProtect(ctx *Context, opts struct { Host string `position:"0" usage:"Hostname for the route (e.g., example.com); omit and pass --default for the default route"` Default bool `long:"default" description:"Protect the default route (instead of a hostname)"` Provider string `long:"provider" description:"Name of the identity provider" required:"true"` ClaimHeader []string `long:"claim-header" description:"Claim to header mapping in format 'claim:header' (e.g., 'email:X-User-Email')"` FormatOptions ConfigCentric }) error
func RouteRemove ¶
func RouteRemove(ctx *Context, opts struct { Host string `position:"0" usage:"Hostname of the route to remove"` ConfigCentric }) error
func RouteSet ¶
func RouteSet(ctx *Context, opts struct { Host string `position:"0" usage:"Hostname for the route (e.g., example.com or *.example.com)" required:"true"` AppName string `position:"1" usage:"Application name to route to"` ConfigCentric }) error
func RouteSetDefault ¶
func RouteSetDefault(ctx *Context, opts struct { AppName string `position:"0" usage:"Application name to set as default route"` ConfigCentric }) error
func RouteShow ¶
func RouteShow(ctx *Context, opts struct { Host string `position:"0" usage:"Hostname of the route to show; omit and pass --default for the default route"` Default bool `long:"default" description:"Show the default route (instead of a hostname)"` FormatOptions ConfigCentric }) error
func RouteUnprotect ¶ added in v0.8.0
func RouteUnprotect(ctx *Context, opts struct { Host string `position:"0" usage:"Hostname for the route (e.g., example.com); omit and pass --default for the default route"` Default bool `long:"default" description:"Remove protection from the default route (instead of a hostname)"` ConfigCentric }) error
func RouteUnsetDefault ¶
func RouteUnsetDefault(ctx *Context, opts struct { ConfigCentric }) error
func RouteWaf ¶ added in v0.8.0
func RouteWaf(ctx *Context, opts struct { Host string `position:"0" usage:"Hostname for the route (e.g., example.com); omit and pass --default for the default route"` Default bool `long:"default" description:"Apply to the default route (instead of a hostname)"` Level int `long:"level" description:"OWASP CRS paranoia level (1-4)" default:"1"` Disable bool `long:"disable" description:"Disable WAF on the route"` FormatOptions ConfigCentric }) error
func RunnerInstall ¶ added in v0.7.0
func RunnerInstall(ctx *Context, opts struct { Token string `short:"t" long:"token" description:"Enrollment token from 'miren runner token create'"` Coordinator string `short:"c" long:"coordinator" description:"Override coordinator address from the token"` Name string `long:"name" description:"Human-readable name for this runner (defaults to hostname)"` ListenAddr string `short:"l" long:"listen" description:"Address this runner will listen on"` Labels []string `long:"labels" description:"Runner labels (key=value)"` Branch string `short:"b" long:"branch" description:"Branch to download"` Force bool `short:"f" long:"force" description:"Overwrite existing service file"` NoStart bool `long:"no-start" description:"Do not start the service after installation"` SkipSystemCheck bool `long:"skip-system-check" description:"Skip minimum system requirements check"` ConfigPath string `long:"config" description:"Path to runner config" default:"/var/lib/miren/runner/config.yaml"` DataPath string `long:"data-path" description:"Path to store runner data" default:"/var/lib/miren/runner"` }) error
RunnerInstall sets up a systemd unit to run a miren distributed runner. It handles the full provisioning flow: downloading the release bundle, joining a coordinator (interactively or via flags), creating the systemd service, and enabling it.
func RunnerJoin ¶ added in v0.3.1
func RunnerJoin(ctx *Context, opts struct { Coordinator string `short:"c" long:"coordinator" description:"Override coordinator address from the token"` Token string `long:"token" description:"Enrollment token (or pass as positional arg / via stdin)"` ListenAddr string `short:"l" long:"listen" description:"Address this runner will listen on"` Name string `long:"name" description:"Human-readable name for this runner (defaults to hostname)"` Labels []string `long:"labels" description:"Additional labels for the runner (key=value)"` ConfigPath string `long:"config" description:"Path to save runner config" default:"/var/lib/miren/runner/config.yaml"` RunnerID string `long:"runner-id" description:"Specific runner ID to use (for reconnecting)"` TokenArg string `position:"0" usage:"Join token from 'miren runner token create'"` }) error
func RunnerList ¶ added in v0.3.1
func RunnerList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func RunnerRemove ¶ added in v0.7.0
func RunnerRemove(ctx *Context, opts struct { ConfigCentric Force bool `long:"force" short:"f" description:"Force removal even if the runner has active sandboxes"` Node string `position:"0" usage:"Runner to remove (name, ID, or short ID)" required:"true"` }) error
func RunnerServiceStatus ¶ added in v0.7.0
func RunnerServiceStatus(ctx *Context, opts struct { Follow bool `short:"f" long:"follow" description:"Follow logs in real-time"` }) error
RunnerServiceStatus shows the status of the miren-runner systemd service. This is separate from RunnerStatus which shows runner health via RPC.
func RunnerStart ¶ added in v0.4.0
func RunnerStart(ctx *Context, opts struct { ConfigPath string `long:"config" description:"Path to runner config" default:"/var/lib/miren/runner/config.yaml"` DataPath string `long:"data-path" description:"Path to store runner data" default:"/var/lib/miren/runner"` ContainerdSocket string `long:"containerd-socket" description:"Path to containerd socket"` ListenAddr string `short:"l" long:"listen" description:"Address this runner will listen on (overrides config)"` }) error
func RunnerStatus ¶ added in v0.7.0
func RunnerTokenCreate ¶ added in v0.7.0
func RunnerTokenCreate(ctx *Context, opts struct { ConfigCentric Labels []string `short:"l" long:"labels" description:"Labels to apply to the runner (key=value format)"` Expires int `short:"e" long:"expires" default:"1" description:"Hours until the invite expires"` Reusable bool `short:"r" long:"reusable" description:"Create a reusable invite (not consumed on use)"` Name string `short:"n" long:"name" description:"Human-readable name for this invite"` TTL string `long:"ttl" description:"Time-to-live (e.g. 24h, 7d, 2w). Overrides --expires"` Addr string `short:"a" long:"addr" description:"Override coordinator address baked into the token"` }) error
func RunnerTokenList ¶ added in v0.7.0
func RunnerTokenList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func RunnerTokenRevoke ¶ added in v0.7.0
func RunnerTokenRevoke(ctx *Context, opts struct { ConfigCentric TokenID string `position:"0" usage:"ID of the token to revoke" required:"true"` }) error
func RunnerUninstall ¶ added in v0.7.0
func RunnerUninstall(ctx *Context, opts struct { RemoveData bool `long:"remove-data" description:"Remove runner data directory"` DataPath string `long:"data-path" description:"Path to runner data" default:"/var/lib/miren/runner"` }) error
RunnerUninstall removes the miren-runner systemd service.
func RunnerUpgrade ¶ added in v0.7.0
func RunnerUpgrade(ctx *Context, opts struct { Version string `short:"V" long:"version" description:"Specific version to upgrade to (e.g., v0.2.0)"` Channel string `long:"channel" description:"Channel to use: 'latest' (stable releases, default) or 'main' (bleeding edge)"` Check bool `short:"c" long:"check" description:"Check for available updates only"` Force bool `short:"f" long:"force" description:"Force upgrade even if already up to date"` SkipHealth bool `long:"skip-health" description:"Skip health check after upgrade"` NoAutoRollback bool `long:"no-auto-rollback" description:"Disable automatic rollback on failure"` HealthTimeout int `long:"health-timeout" default:"60" description:"Health check timeout in seconds"` }) error
RunnerUpgrade upgrades the miren runner to the latest or specified version
func RunnerUpgradeRollback ¶ added in v0.7.0
func RunnerUpgradeRollback(ctx *Context, opts struct { SkipHealth bool `long:"skip-health" description:"Skip health check after rollback"` }) error
RunnerUpgradeRollback rolls back the runner to the previous version
func SandboxCreate ¶
func SandboxDelete ¶
func SandboxDelete(ctx *Context, opts struct { Force bool `short:"f" long:"force" description:"Force delete without confirmation"` SandboxID string `position:"0" usage:"ID of the sandbox to delete" required:"true"` ConfigCentric }) error
func SandboxExec ¶
func SandboxExec(ctx *Context, opts struct { ConfigCentric Id string `short:"i" long:"id" description:"Sandbox ID"` Args []string `rest:"true"` }) error
func SandboxList ¶
func SandboxList(ctx *Context, opts struct { All bool `short:"a" long:"all" description:"Include dead sandboxes (excluded by default)"` Status string `short:"s" long:"status" description:"Filter by status (pending, not_ready, running, stopped, dead)"` FormatOptions ConfigCentric }) error
func SandboxMetrics ¶
func SandboxPoolList ¶
func SandboxPoolList(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
func SandboxPoolSetDesired ¶
func SandboxPoolSetDesired(ctx *Context, opts struct { RawID bool `long:"raw-id" description:"Use the provided ID as-is without adding the pool/ prefix"` PoolID string `position:"0" usage:"Pool ID (e.g., pool-CUSkT8J58BmgkDeGyPP2e or pool/pool-CUSkT8J58BmgkDeGyPP2e)" required:"true"` Desired string `position:"1" usage:"Desired instance count (absolute number, +N to increase, or -N to decrease)" required:"true"` ConfigCentric }) error
func SandboxStop ¶
func SandboxStop(ctx *Context, opts struct { SandboxID string `position:"0" usage:"ID of the sandbox to stop" required:"true"` ConfigCentric }) error
func SelectCluster ¶
func SelectCluster(ctx *Context, title string, clusters []string, activeCluster string, dimActive bool) (string, error)
Helper function to run cluster selection
func ServerConfigGenerate ¶
func ServerConfigGenerate(ctx *Context, opts struct { Output string `short:"o" long:"output" description:"Output file path (defaults to stdout)"` Mode string `short:"m" long:"mode" description:"Server mode: standalone (default), distributed (experimental)" default:"standalone"` Defaults bool `short:"d" long:"defaults" description:"Generate config with default values"` }) error
ServerConfigGenerate generates a server configuration file
func ServerConfigValidate ¶
func ServerConfigValidate(ctx *Context, opts struct { ConfigFile string `short:"f" long:"file" description:"Configuration file to validate" required:"true"` }) error
ServerConfigValidate validates a server configuration file
func ServerInstall ¶
func ServerInstall(ctx *Context, opts struct { Address string `short:"a" long:"address" description:"Server address to bind to" default:"0.0.0.0:8443"` Verbosity string `long:"verbosity" description:"Verbosity level" default:"-vv"` Branch string `short:"b" long:"branch" description:"Branch to download if release not found"` Force bool `short:"f" long:"force" description:"Overwrite existing service file"` NoStart bool `long:"no-start" description:"Do not start the service after installation"` WithoutCloud bool `long:"without-cloud" description:"Skip cloud registration setup"` ClusterName string `short:"n" long:"name" description:"Cluster name for cloud registration"` CloudURL string `short:"u" long:"url" description:"Cloud URL for registration" default:"https://miren.cloud"` Tags map[string]string `short:"t" long:"tag" description:"Tags for the cluster (key:value)"` SkipSystemCheck bool `long:"skip-system-check" description:"Skip minimum system requirements check"` }) error
ServerInstall sets up systemd units to run the miren server
func ServerInstallDocker ¶
func ServerInstallDocker(ctx *Context, opts struct { Image string `short:"i" long:"image" description:"Docker image to use" default:"oci.miren.cloud/miren:latest"` Name string `short:"n" long:"name" description:"Container name"` Force bool `short:"f" long:"force" description:"Remove existing container if present"` HTTPPort int `long:"http-port" description:"HTTP port mapping" default:"80"` HostNetwork bool `long:"host-network" description:"Use host networking (ignores port mappings)"` WithoutCloud bool `long:"without-cloud" description:"Skip cloud registration setup"` ClusterName string `long:"cluster-name" description:"Cluster name for cloud registration"` CloudURL string `short:"u" long:"url" description:"Cloud URL for registration" default:"https://miren.cloud"` Tags map[string]string `short:"t" long:"tag" description:"Tags for the cluster (key:value)"` Labs []string `short:"l" long:"labs" description:"Miren Labs features to enable (e.g. adminapi). Prefix with - to disable."` }) error
ServerInstallDocker sets up a Docker container to run the miren server
func ServerStatus ¶
func ServerStatus(ctx *Context, opts struct { Follow bool `short:"f" long:"follow" description:"Follow logs in real-time"` }) error
ServerStatus shows the status of the miren systemd service
func ServerStatusDocker ¶
func ServerStatusDocker(ctx *Context, opts struct { Name string `short:"n" long:"name" description:"Container name" default:"miren"` Follow bool `short:"f" long:"follow" description:"Follow logs in real-time"` }) error
ServerStatusDocker shows the status of the miren Docker container
func ServerUninstall ¶
func ServerUninstall(ctx *Context, opts struct { RemoveData bool `long:"remove-data" description:"Remove /var/lib/miren directory after backing it up"` BackupDir string `long:"backup-dir" description:"Directory to save backup tarball" default:"."` SkipBackup bool `long:"skip-backup" description:"Skip backup when removing data (dangerous)"` }) error
ServerUninstall removes the systemd service and optionally removes /var/lib/miren
func ServerUninstallDocker ¶
func ServerUninstallDocker(ctx *Context, opts struct { Name string `short:"n" long:"name" description:"Container name" default:"miren"` RemoveVolume bool `long:"remove-volume" description:"Remove the data volume"` Force bool `short:"f" long:"force" description:"Force removal even if container is running"` }) error
ServerUninstallDocker removes the miren Docker container and optionally the volume
func ServerUpgrade ¶
func ServerUpgrade(ctx *Context, opts struct { Version string `short:"V" long:"version" description:"Specific version to upgrade to (e.g., v0.2.0)"` Channel string `long:"channel" description:"Channel to use: 'latest' (stable releases, default) or 'main' (bleeding edge)"` Check bool `short:"c" long:"check" description:"Check for available updates only"` Force bool `short:"f" long:"force" description:"Force upgrade even if already up to date"` Release bool `short:"r" long:"release" description:"Upgrade full release package (not just base)"` SkipHealth bool `long:"skip-health" description:"Skip health check after upgrade"` NoAutoRollback bool `long:"no-auto-rollback" description:"Disable automatic rollback on failure"` HealthTimeout int `long:"health-timeout" default:"60" description:"Health check timeout in seconds"` }) error
ServerUpgrade upgrades the miren server to the latest or specified version
func ServerUpgradeRollback ¶
func ServerUpgradeRollback(ctx *Context, opts struct { SkipHealth bool `long:"skip-health" description:"Skip health check after rollback"` }) error
ServerUpgradeRollback rolls back the server to the previous version
func Set ¶
func Set(ctx *Context, opts struct { AppCentric Concurrency int `short:"c" long:"concurrency" description:"Set maximum concurrency of application instances" required:"true"` }) error
func TestLoad ¶
func TestLoad(ctx *Context, opts struct { Requests int `short:"n" long:"requests" description:"Number of requests to make" default:"200"` Concurrency int `short:"c" long:"concurrency" description:"Number of concurrent requests to make" default:"50"` RateLimit float64 `short:"q" long:"rate-limit" description:"Rate limit in requests per second" default:"0"` Duration time.Duration `short:"z" long:"duration" description:"Duration of the test"` Method string `short:"m" long:"method" description:"HTTP method to use" default:"GET"` Header []string `short:"H" long:"header" description:"HTTP header to use"` Timeout int `short:"t" long:"timeout" description:"Timeout for each request in seconds" default:"20"` HTTP2 bool `long:"h2" description:"Use HTTP/2"` Host string `long:"host" description:"Host header to use"` ContentType string `short:"T" long:"content-type" description:"Content-Type header to use" default:"text/html"` AuthHeader string `short:"a" long:"auth" description:"Basic auth header to use"` Accept string `short:"A" long:"accept" description:"Accept header to use"` Body string `short:"d" long:"data" description:"HTTP request body"` BodyFile string `short:"D" long:"data-file" description:"File to use as request body"` ProxyAddr string `short:"x" long:"proxy" description:"Proxy URL to use"` UserAgent string `short:"U" long:"user-agent" description:"User-Agent header to use"` CPUS *int `long:"cpus" description:"Number of CPUs to use"` Output string `short:"o" long:"output" description:"Output type, the only supported value is 'csv'"` DisableCompression bool `long:"disable-compression" description:"Disable compression"` DisableKeepAlives bool `long:"disable-keepalives" description:"Disable keep-alives"` DisableRedirects bool `long:"disable-redirects" description:"Disable redirects"` URL string `position:"0" usage:"URL to load test" required:"true"` }) error
func Upgrade ¶
func Upgrade(ctx *Context, opts struct { Version string `short:"V" long:"version" description:"Specific version to upgrade to (e.g., v0.2.0)"` Channel string `long:"channel" description:"Channel to use: 'latest' (stable releases, default) or 'main' (bleeding edge)"` Check bool `short:"c" long:"check" description:"Check for available updates only"` Force bool `short:"f" long:"force" description:"Force upgrade even if already up to date or server running"` User bool `short:"u" long:"user" description:"Install to user directory (~/.miren/release/miren) instead of system location"` }) error
Upgrade upgrades the miren CLI to the latest or specified version
func Version ¶
func Version(ctx *Context, opts VersionOptions) error
func Whoami ¶
func Whoami(ctx *Context, opts struct { FormatOptions ConfigCentric }) error
Whoami displays information about the current authenticated user
Types ¶
type AppCentric ¶
type AppCentric struct {
ConfigCentric `group:"Config Options"`
App string `short:"a" long:"app" env:"MIREN_APP" description:"Application name"`
Dir string `short:"d" long:"dir" description:"Directory to run from" default:"."`
// contains filtered or unexported fields
}
func (*AppCentric) LoadCluster ¶ added in v0.4.0
func (a *AppCentric) LoadCluster() (*clientconfig.ClusterConfig, string, error)
LoadCluster implements per-app cluster pinning. Resolution priority:
- -C flag (explicit override) — also saves to state
- MIREN_CLUSTER env var
- Per-app cluster from ~/.config/miren/app-state.toml (handled by ConfigCentric)
- Global active_cluster from clientconfig (fallback)
func (*AppCentric) ResolvedDir ¶ added in v0.7.0
func (a *AppCentric) ResolvedDir() string
ResolvedDir returns the directory that should be used as the app source. When a config is found in a parent directory, this returns that parent directory instead of the original Dir value.
func (*AppCentric) Validate ¶
func (a *AppCentric) Validate(glbl *GlobalFlags) error
type BeginKeyRegistrationRequest ¶
type BeginKeyRegistrationRequest struct {
Name string `json:"name"`
KeyType string `json:"key_type"`
PublicKey string `json:"public_key"`
}
BeginKeyRegistrationRequest represents the request to begin key registration
type BeginKeyRegistrationResponse ¶
type BeginKeyRegistrationResponse struct {
Envelope string `json:"envelope"`
Challenge string `json:"challenge"`
}
BeginKeyRegistrationResponse represents the response from begin key registration
type ClusterResponse ¶
type ClusterResponse struct {
XID string `json:"xid"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Tags map[string]interface{} `json:"tags"`
APIAddresses []string `json:"api_addresses,omitempty"`
CACertFingerprint string `json:"ca_cert_fingerprint,omitempty"`
OrganizationXID string `json:"organization_xid"`
OrganizationName string `json:"organization_name"`
}
ClusterResponse represents a cluster returned from the API
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd wraps a command function with mflags parsing
func Infer ¶
func Infer(name, syn string, f interface{}, opts ...CommandOption) *Cmd
Infer creates a command from a function with the signature: func(ctx *Context, opts StructType) error
func NewHelpCommand ¶ added in v0.6.0
func NewHelpCommand(d *mflags.Dispatcher) *Cmd
NewHelpCommand returns an Infer-based help command bound to the given dispatcher.
func (*Cmd) CommandGroup ¶ added in v0.8.0
CommandGroup implements mflags.CommandGroupProvider.
func (*Cmd) Description ¶ added in v0.5.0
Description implements mflags.DescriptionProvider.
func (*Cmd) ReadOptions ¶
func (*Cmd) RequiredFeature ¶ added in v0.5.0
RequiredFeature implements mflags.RequiredFeatureProvider.
type CommandOption ¶ added in v0.5.0
type CommandOption func(*Cmd)
func WithDescription ¶ added in v0.5.0
func WithDescription(desc string) CommandOption
WithDescription sets an extended markdown description for the command.
func WithExample ¶ added in v0.5.0
func WithExample(example mflags.Example) CommandOption
func WithGroup ¶ added in v0.8.0
func WithGroup(group string) CommandOption
WithGroup assigns this command to a named group for help rendering.
func WithLabsFeature ¶ added in v0.5.0
func WithLabsFeature(feature string) CommandOption
WithLabsFeature marks this command as requiring the given labs feature flag.
type CommandOutput ¶
func RunCommand ¶
func RunCommand(f any, args ...string) (*CommandOutput, error)
type CompleteKeyRegistrationRequest ¶
type CompleteKeyRegistrationRequest struct {
Envelope string `json:"envelope"`
Signature string `json:"signature"`
}
CompleteKeyRegistrationRequest represents the request to complete key registration
type ConfigCentric ¶
type ConfigCentric struct {
Config string `long:"config" description:"Path to the config file"`
Cluster string `short:"C" long:"cluster" description:"Cluster name" env:"MIREN_CLUSTER"`
// contains filtered or unexported fields
}
func (*ConfigCentric) LoadCluster ¶
func (c *ConfigCentric) LoadCluster() (*clientconfig.ClusterConfig, string, error)
func (*ConfigCentric) LoadConfig ¶
func (c *ConfigCentric) LoadConfig() (*clientconfig.Config, error)
func (*ConfigCentric) SaveConfig ¶
func (c *ConfigCentric) SaveConfig() error
type Context ¶
type Context struct {
context.Context
Log *slog.Logger
// A separate logger for UI output, which is always at least debug level
UILog *slog.Logger
Stdout io.Writer
Stderr io.Writer
// ServerState holds explicit server dependencies
ServerState *ServerState
ClientConfig *clientconfig.Config
ClusterConfig *clientconfig.ClusterConfig
ClusterName string
Config struct {
ServerAddress string
}
// contains filtered or unexported fields
}
func (*Context) DisplayTable ¶
DisplayTable renders a formatted table with headers and rows
func (*Context) DisplayTableTemplate ¶
DisplayTableTemplate renders a table using a template string to infer headers and data Template format: "HEADER1:field1,HEADER2:method2,HEADER3:field3"
func (*Context) SetExitCode ¶
type DebugAuthResponse ¶
type DebugAuthResponse struct {
Success bool `json:"success"`
ServerVersion string `json:"server_version,omitempty"`
AuthMethod string `json:"auth_method,omitempty"`
Identity string `json:"identity,omitempty"`
UserInfo map[string]string `json:"user_info,omitempty"`
Message string `json:"message,omitempty"`
}
DebugAuthResponse represents the response from the debug-auth endpoint
type DeviceFlowExchangeResponse ¶
type DeviceFlowExchangeResponse struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
ErrorDescription string `json:"error_description,omitempty"`
AccessToken string `json:"access_token,omitempty"`
TokenType string `json:"token_type,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
}
DeviceFlowExchangeResponse represents the response from /api/v1/device/token
type DeviceFlowInitResponse ¶
type DeviceFlowInitResponse struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURL string `json:"verification_uri"`
VerificationURLComplete string `json:"verification_uri_complete,omitempty"`
ExpiresIn int `json:"expires_in"`
PollingInterval int `json:"polling_interval"`
}
DeviceFlowInitResponse represents the response from /api/v1/device/code
type DownloadReleaseOptions ¶
DownloadReleaseOptions contains options for downloading a release
type EnvVarSpec ¶ added in v0.3.0
type EnvVarSpec struct {
Key string
Value string
Sensitive bool
FromFile bool // true if value was read from a file
FromFile_ string // original filename if FromFile is true
}
EnvVarSpec represents a parsed environment variable specification
func ParseEnvVarSpecs ¶ added in v0.3.0
func ParseEnvVarSpecs(envSpecs, sensitiveSpecs []string) ([]EnvVarSpec, error)
ParseEnvVarSpecs parses environment variable specifications from -e and -s flags. Each spec can be: KEY=VALUE, KEY=@file, or KEY (to prompt interactively).
type ErrExitCode ¶
type ErrExitCode int
func (ErrExitCode) Error ¶
func (e ErrExitCode) Error() string
type FormatOptions ¶
type FormatOptions struct {
Format string `long:"format" description:"Output format (text, json)" default:"text"`
JSON bool `long:"json" description:"Shorthand for --format json"`
}
FormatOptions provides common output formatting options
func (*FormatOptions) IsJSON ¶
func (f *FormatOptions) IsJSON() bool
IsJSON returns true if JSON format is selected (case-insensitive)
type GlobalFlags ¶
type GlobalFlags struct {
Verbose []bool `short:"v" long:"verbose" description:"Enable verbose output"`
ServerAddress string `long:"server-address" description:"Server address to connect to" default:"127.0.0.1:8443"`
// We actually process this manually, but we include it here so that it validates.
Options string `long:"options" description:"Path to file containing options"`
}
type KeyRegistrationResponse ¶
type KeyRegistrationResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Fingerprint string `json:"fingerprint"`
CreatedAt string `json:"created_at"`
}
KeyRegistrationResponse represents a successfully registered key
type LocalEnvDetection ¶ added in v0.8.0
type LocalEnvDetection struct {
// Available are env vars that are both detected and available locally
Available []LocalEnvVar
// Missing are env vars that were detected but not found locally
Missing []LocalEnvVar
// Additional are env vars found locally that look app-related but weren't detected
Additional []LocalEnvVar
}
LocalEnvDetection contains the results of scanning the local environment
func DetectLocalEnvVars ¶ added in v0.8.0
func DetectLocalEnvVars(detectedKeys []string) LocalEnvDetection
DetectLocalEnvVars scans the local environment and cross-references with detected env vars
type LocalEnvVar ¶ added in v0.8.0
type LocalEnvVar struct {
Key string
Value string
HasValue bool // true if the env var is set (even if empty)
Source string // "detected" (from stackbuild), "local" (found in env), "both"
Sensitive bool // heuristic: looks like a secret/key/token
}
LocalEnvVar represents an environment variable found in the local environment
type OptsValidate ¶
type OptsValidate interface {
Validate(glbl *GlobalFlags) error
}
type RegisterOptions ¶
type RegisterOptions struct {
ClusterName string `short:"n" long:"name" description:"Cluster name" required:"true"`
CloudURL string `short:"u" long:"url" description:"Cloud URL" default:"https://miren.cloud"`
Tags map[string]string `short:"t" long:"tag" description:"Tags for the cluster (key:value)"`
OutputDir string `short:"o" long:"output" description:"Output directory for registration" default:"/var/lib/miren/server"`
}
RegisterOptions contains options for cluster registration
type SectionOption ¶ added in v0.5.0
type SectionOption func(*section)
func WithSectionDescription ¶ added in v0.5.0
func WithSectionDescription(desc string) SectionOption
WithSectionDescription sets an extended markdown description for the section.
func WithSectionGroup ¶ added in v0.8.0
func WithSectionGroup(group string) SectionOption
WithSectionGroup assigns this section to a named group for help rendering.
type SelectionModel ¶
type SelectionModel struct {
Title string
Items []string
Selected string
Cancelled bool
// Optional styling/marking functions
ItemMarker func(item string) string // Returns marker like " *" for special items
ItemStyle func(item string) lipgloss.Style // Returns style for special items
// contains filtered or unexported fields
}
SelectionModel is a generic model for selecting from a list of items
func (*SelectionModel) Init ¶
func (m *SelectionModel) Init() tea.Cmd
func (*SelectionModel) SetCursor ¶
func (m *SelectionModel) SetCursor(index int)
SetCursor sets the cursor to the specified index
func (*SelectionModel) View ¶
func (m *SelectionModel) View() string
type ServerState ¶ added in v0.3.0
type ServerState struct {
// Containerd
ContainerdSocket string
CC *containerd.Client
Namespace string
// Network
Bridge string
Subnet *netdb.Subnet
ServicePrefixes []netip.Prefix
NetServ *network.ServiceManager
IPv4Routable netip.Prefix
// Paths
DataPath string
Tempdir string
// VictoriaLogs
VictorialogsAddress string
VictorialogsTimeout time.Duration
// VictoriaMetrics
VictoriametricsAddress string
VictoriametricsTimeout time.Duration
// Metrics
Writer *metrics.VictoriaMetricsWriter
Reader *metrics.VictoriaMetricsReader
CPU *metrics.CPUUsage
Mem *metrics.MemoryUsage
HTTPMetrics *metrics.HTTPMetrics
// Observability
LogsMaintainer *observability.LogsMaintainer
LogWriter observability.LogWriter
Logs *observability.LogReader
StatusMon *observability.StatusMonitor
// Sandbox
SandboxMetrics *sandbox.Metrics
}
ServerState holds all server dependencies explicitly, replacing the asm.Registry.
func NewServerState ¶ added in v0.3.0
func NewServerState() *ServerState
NewServerState creates a new ServerState with default values.
func (*ServerState) InitContainerd ¶ added in v0.3.0
func (s *ServerState) InitContainerd() error
InitContainerd creates the containerd client if not already set.
func (*ServerState) InitLogsMaintainer ¶ added in v0.3.0
func (s *ServerState) InitLogsMaintainer()
InitLogsMaintainer creates the logs maintainer if not already set.
func (*ServerState) InitMetricsReader ¶ added in v0.3.0
func (s *ServerState) InitMetricsReader(log *slog.Logger)
InitMetricsReader creates the VictoriaMetrics reader if not already set.
func (*ServerState) InitMetricsWriter ¶ added in v0.3.0
func (s *ServerState) InitMetricsWriter(log *slog.Logger)
InitMetricsWriter creates the VictoriaMetrics writer if not already set.
func (*ServerState) InitNetServ ¶ added in v0.3.0
func (s *ServerState) InitNetServ(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient)
InitNetServ creates the network service manager if not already set.
func (*ServerState) InitSandboxMetrics ¶ added in v0.3.0
func (s *ServerState) InitSandboxMetrics(log *slog.Logger)
InitSandboxMetrics creates the sandbox metrics if not already set. Note: CPU and Mem should be initialized before calling this method.
func (*ServerState) InitStatusMonitor ¶ added in v0.3.0
func (s *ServerState) InitStatusMonitor(log *slog.Logger)
InitStatusMonitor creates the status monitor if not already set.
type VersionOptions ¶
Source Files
¶
- activation_poller.go
- addon.go
- admin.go
- admin_doc.go
- alias_list.go
- app.go
- app_config.go
- app_delete.go
- app_history.go
- app_list.go
- app_restart.go
- app_rollback.go
- app_run.go
- app_run_doc.go
- app_status.go
- app_versions.go
- apps.go
- auth_ci.go
- auth_generate.go
- auth_provider.go
- auth_provider_github.go
- auth_provider_helpers.go
- auth_provider_oidc.go
- auth_provider_password.go
- cluster.go
- cluster_add.go
- cluster_current.go
- cluster_export.go
- cluster_remove.go
- cluster_switch.go
- color.go
- commands.go
- commands_linux.go
- config.go
- config_bind_helpers.go
- config_load.go
- config_remove.go
- config_set_active.go
- ctr_nuke.go
- debug_advertise.go
- debug_bundle.go
- debug_bundle_linux.go
- debug_connection.go
- debug_ctr.go
- debug_disk.go
- debug_disk_lease.go
- debug_netdb.go
- debug_rbac.go
- debug_reindex.go
- deploy.go
- deploy_cancel.go
- deploy_poller.go
- deploy_ui.go
- dial_stdio.go
- discover_ip.go
- disk_backup.go
- disk_doc.go
- disk_list_deleted.go
- disk_migrate.go
- disk_resolver.go
- disk_restore.go
- disk_undelete.go
- doctor.go
- doctor_auth.go
- doctor_config.go
- doctor_server.go
- download_release.go
- entity_check.go
- entity_create.go
- entity_delete.go
- entity_doc.go
- entity_ensure.go
- entity_get.go
- entity_list.go
- entity_patch.go
- entity_put.go
- entity_replace.go
- env.go
- envdetect.go
- exec_io.go
- format.go
- generate.go
- global.go
- help.go
- help_commands.go
- help_groups.go
- help_render.go
- infer.go
- init.go
- login.go
- logout.go
- logs.go
- logs_doc.go
- release_path.go
- route.go
- route_list.go
- route_protect.go
- route_remove.go
- route_set.go
- route_set_default.go
- route_show.go
- route_unprotect.go
- route_unset_default.go
- route_waf.go
- runner_install.go
- runner_invite.go
- runner_join.go
- runner_list.go
- runner_remove.go
- runner_revoke.go
- runner_start.go
- runner_status.go
- runner_upgrade.go
- sandbox_create.go
- sandbox_delete.go
- sandbox_doc.go
- sandbox_exec.go
- sandbox_list.go
- sandbox_metrics.go
- sandbox_pool_list.go
- sandbox_pool_set_desired.go
- sandbox_stop.go
- server.go
- server_config_cmds.go
- server_install.go
- server_install_docker.go
- server_register.go
- server_state.go
- server_upgrade.go
- set.go
- tea_utils.go
- test_load.go
- upgrade.go
- upgrade_helpers.go
- upgrade_permissions.go
- version.go
- whoami.go