Documentation
¶
Index ¶
- Constants
- Variables
- func AllCommands() map[string]cli.CommandFactory
- 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 AppStatus(ctx *Context, opts struct{ ... }) error
- func Apps(ctx *Context, opts struct{ ... }) error
- func AuthGenerate(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 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 ConfigBind(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 Console(ctx *Context, opts struct{ ... }) error
- func CtrNuke(c *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 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 DialStdio(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 HiddenCommands() []string
- func Init(ctx *Context, opts struct{ ... }) error
- func Login(ctx *Context, opts struct{ ... }) error
- func Logout(ctx *Context, opts struct{ ... }) error
- func Logs(ctx *Context, opts struct{ ... }) error
- 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 PrintUpgradeSuccess(ctx context.Context, oldVersion release.VersionInfo, commandType string, ...)
- func PrintVersionComparison(current, latest release.VersionInfo)
- func Register(ctx *Context, opts RegisterOptions) error
- func RegisterStatus(ctx *Context, opts struct{ ... }) error
- func Route(ctx *Context, opts struct{ ... }) error
- func RouteList(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 RouteUnsetDefault(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) cli.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
- 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) Warn(format string, args ...interface{})
- type DebugAuthResponse
- type DeviceFlowExchangeResponse
- type DeviceFlowInitResponse
- type DownloadReleaseOptions
- type ErrExitCode
- type FormatOptions
- type GlobalFlags
- type KeyRegistrationResponse
- type Model
- type OptsValidate
- type RegisterOptions
- type SelectionModel
- type TickMsg
- type VersionOptions
Constants ¶
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 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 AllCommands ¶
func AllCommands() map[string]cli.CommandFactory
func AppDelete ¶
func AppDelete(ctx *Context, opts struct { Force bool `short:"f" long:"force" description:"Force delete without confirmation"` ConfigCentric Args struct { AppName string `positional-arg-name:"app-name" description:"Name of the app to delete"` } `positional-args:"yes" required:"yes"` }) error
func AppHistory ¶
func AppHistory(ctx *Context, opts struct { AppCentric Limit int32 `short:"n" long:"limit" description:"Maximum number of deployments to show" default:"20"` Status string `short:"s" long:"status" description:"Filter by status (active, failed, rolled_back)"` All bool `long:"all" description:"Show deployments from all clusters"` ShowFailed bool `long:"show-failed" description:"Include failed deployments (shown by default)"` 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 AppStatus ¶
func AppStatus(ctx *Context, opts struct { AppCentric }) error
func Apps ¶
func Apps(ctx *Context, opts struct { 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 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 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 { ConfigCentric Args struct { Cluster string `positional-arg-name:"cluster" description:"Name of the cluster to remove"` } `positional-args:"yes"` }) error
func ClusterSwitch ¶
func ClusterSwitch(ctx *Context, opts struct { ConfigCentric Args struct { Cluster string `positional-arg-name:"cluster" description:"Name of the cluster to switch to"` } `positional-args:"yes"` }) error
func ConfigBind ¶
func ConfigBind(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 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 { ConfigCentric Force bool `short:"f" long:"force" description:"Force removal without confirmation"` Args struct { Cluster string `positional-arg-name:"cluster" description:"Name of the cluster to remove"` } `positional-args:"yes"` }) error
func ConfigSetActive ¶
func ConfigSetActive(ctx *Context, opts struct { ConfigCentric Args struct { Cluster string `positional-arg-name:"cluster" description:"Name of the cluster to set as active"` } `positional-args:"yes"` }) error
func Console ¶
func Console(ctx *Context, opts struct { AppCentric Pool string `long:"pool" default:"shell" description:"Pool to use"` Rest struct { Args []string } `positional-args:"yes"` }) 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"` Verbose bool `short:"v" long:"verbose" description:"Show detailed connection information"` }) 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 int64 `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 LSVD 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 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 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"` Force bool `short:"f" long:"force" description:"Skip confirmation prompt"` }) error
func DownloadRelease ¶
func DownloadRelease(ctx *Context, opts struct { Branch string `short:"b" long:"branch" description:"Branch name to download" default:"main"` 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 { AppCentric 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"` Args struct { Keys []string `positional-arg-name:"KEY" description:"Environment variable key to delete" required:"1"` } `positional-args:"yes"` }) error
func EnvGet ¶
func EnvGet(ctx *Context, opts struct { AppCentric 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"` Args struct { Key string `positional-arg-name:"KEY" description:"Environment variable key to get" required:"1"` } `positional-args:"yes" required:"true"` }) 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 HiddenCommands ¶
func HiddenCommands() []string
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"` }) error
Login authenticates with miren.cloud using device flow
func Logout ¶
func Logout(ctx *Context, opts struct { ConfigCentric IdentityName string `short:"i" long:"identity" description:"Name of the identity to remove" default:"cloud"` }) error
Logout removes the local identity and key files
func Logs ¶
func Logs(ctx *Context, opts struct { ConfigCentric App string `short:"a" long:"app" description:"Application get logs for" env:"MIREN_APP"` Dir string `short:"d" long:"dir" description:"Directory to run from" default:"."` Last *time.Duration `short:"l" long:"last" description:"Show logs from the last duration"` Sandbox string `short:"s" long:"sandbox" description:"Show logs for a specific sandbox ID"` Follow bool `short:"f" long:"follow" description:"Follow log output (live tail)"` }) error
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 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 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 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 RouteRemove ¶
func RouteRemove(ctx *Context, opts struct { ConfigCentric Args struct { Host string `positional-arg-name:"host" description:"Hostname of the route to remove"` } `positional-args:"yes"` }) error
func RouteSet ¶
func RouteSet(ctx *Context, opts struct { ConfigCentric Args struct { Host string `positional-arg-name:"host" description:"Hostname for the route (e.g., example.com)" required:"true"` App string `positional-arg-name:"app" description:"Application name to route to" required:"true"` } `positional-args:"yes"` }) error
func RouteSetDefault ¶
func RouteSetDefault(ctx *Context, opts struct { ConfigCentric Args struct { App string `positional-arg-name:"app" description:"Application name to set as default route" required:"true"` } `positional-args:"yes"` }) error
func RouteShow ¶
func RouteShow(ctx *Context, opts struct { FormatOptions ConfigCentric Args struct { Host string `positional-arg-name:"host" description:"Hostname of the route to show" required:"true"` } `positional-args:"yes"` }) error
func RouteUnsetDefault ¶
func RouteUnsetDefault(ctx *Context, opts struct { ConfigCentric }) error
func SandboxCreate ¶
func SandboxDelete ¶
func SandboxDelete(ctx *Context, opts struct { Force bool `short:"f" long:"force" description:"Force delete without confirmation"` ConfigCentric Args struct { SandboxID string `positional-arg-name:"sandbox-id" description:"ID of the sandbox to delete"` } `positional-args:"yes" required:"yes"` }) error
func SandboxExec ¶
func SandboxList ¶
func SandboxList(ctx *Context, opts struct { 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 { ConfigCentric RawID bool `long:"raw-id" description:"Use the provided ID as-is without adding the pool/ prefix"` Args struct { PoolID string `` /* 137-byte string literal not displayed */ Desired string `` /* 135-byte string literal not displayed */ } `positional-args:"yes"` }) error
func SandboxStop ¶
func SandboxStop(ctx *Context, opts struct { ConfigCentric Args struct { SandboxID string `positional-arg-name:"sandbox-id" description:"ID of the sandbox to stop"` } `positional-args:"yes" required:"yes"` }) 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"` Verbose bool `short:"v" long:"verbose" description:"Show detailed configuration"` }) 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 `short:"v" long:"verbosity" description:"Verbosity level" default:"-vv"` Branch string `short:"b" long:"branch" description:"Branch to download if release not found" default:"main"` 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)"` }) 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" default:"miren"` 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)"` }) 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" description:"Health check timeout in seconds (default: 60)"` }) 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 support 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"` Rest struct { URL string `positional-arg-name:"URL" required:"yes"` } `positional-args:"yes"` }) 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"` }) error
Upgrade upgrades the miren CLI to the latest or specified version
func Version ¶
func Version(ctx *Context, opts VersionOptions) error
Types ¶
type AppCentric ¶
type AppCentric struct {
ConfigCentric
App string `short:"a" long:"app" env:"MIREN_APP" description:"Application get info about"`
Dir string `short:"d" long:"dir" description:"Directory to run from" default:"."`
// contains filtered or unexported fields
}
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 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"`
// 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
Client *asm.Registry
Server *asm.Registry
ClientConfig *clientconfig.Config
ClusterConfig *clientconfig.ClusterConfig
ClusterName string
Config struct {
ServerAddress string `asm:"server-addr"`
}
// 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 ErrExitCode ¶
type ErrExitCode int
func (ErrExitCode) Error ¶
func (e ErrExitCode) Error() string
type FormatOptions ¶
type FormatOptions struct {
Format string `long:"format" description:"Output format (table, json)" default:"table"`
}
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" asm:"server-addr"`
// 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 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 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 VersionOptions ¶
Source Files
¶
- app.go
- app_config.go
- app_delete.go
- app_history.go
- app_list.go
- app_status.go
- apps.go
- auth_generate.go
- cluster.go
- cluster_add.go
- cluster_remove.go
- cluster_switch.go
- color.go
- commands.go
- commands_linux.go
- config.go
- config_bind.go
- config_bind_helpers.go
- config_load.go
- config_remove.go
- config_set_active.go
- console.go
- ctr_nuke.go
- debug_connection.go
- debug_ctr.go
- debug_disk.go
- debug_disk_lease.go
- debug_rbac.go
- debug_reindex.go
- deploy.go
- deploy_ui.go
- dial_stdio.go
- download_release.go
- entity_check.go
- entity_create.go
- entity_delete.go
- entity_ensure.go
- entity_get.go
- entity_list.go
- entity_patch.go
- entity_put.go
- entity_replace.go
- env.go
- format.go
- global.go
- help.go
- infer.go
- init.go
- login.go
- logout.go
- logs.go
- register.go
- release_path.go
- route.go
- route_list.go
- route_remove.go
- route_set.go
- route_set_default.go
- route_show.go
- route_unset_default.go
- sandbox_create.go
- sandbox_delete.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_upgrade.go
- set.go
- tea_utils.go
- test_load.go
- upgrade.go
- upgrade_helpers.go
- version.go
- whoami.go