cmd

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Core version info
	Version   = "dev"
	GitCommit = "unknown"
	BuildDate = "unknown"

	// Manifest info
	Name        = "vers-cli"
	Description = "A CLI tool for version management"
	Author      = "the VERS team"
	Repository  = "https://github.com/hdresearch/vers-cli"
	License     = "MIT"
)

These variables are set at build time using ldflags

Functions

func BuildRootfs

func BuildRootfs(config *Config) error

BuildRootfs builds a rootfs image according to the provided configuration

func DebugPrint

func DebugPrint(format string, args ...interface{})

DebugPrint prints debug information only when verbose mode is enabled

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func StartCluster

func StartCluster(config *Config, args []string) error

StartCluster starts a development environment according to the provided configuration

func StartClusterFromCommit

func StartClusterFromCommit(config *Config, commitKey string) error

StartClusterFromCommit starts a development environment from an existing commit

Types

type BuilderConfig

type BuilderConfig struct {
	Name       string `toml:"name"`
	Dockerfile string `toml:"dockerfile"`
}

type Config

type Config struct {
	Machine MachineConfig `toml:"machine"`
	Rootfs  RootfsConfig  `toml:"rootfs"`
	Builder BuilderConfig `toml:"builder"`
	Kernel  KernelConfig  `toml:"kernel"`
}

Config represents the structure of vers.toml

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with default values

type GitHubRelease

type GitHubRelease struct {
	TagName    string `json:"tag_name"`
	Name       string `json:"name"`
	Body       string `json:"body"`
	Draft      bool   `json:"draft"`
	Prerelease bool   `json:"prerelease"`
	Assets     []struct {
		Name               string `json:"name"`
		BrowserDownloadURL string `json:"browser_download_url"`
		Size               int64  `json:"size"`
	} `json:"assets"`
	PublishedAt time.Time `json:"published_at"`
}

GitHubRelease represents a GitHub release

type KernelConfig

type KernelConfig struct {
	Name string `toml:"name"`
}

type LogStyles

type LogStyles struct {
	Container lipgloss.Style
	Header    lipgloss.Style
	CommitID  lipgloss.Style
	CommitMsg lipgloss.Style
	Author    lipgloss.Style
	Date      lipgloss.Style
	Tag       lipgloss.Style
	VMID      lipgloss.Style
	NoData    lipgloss.Style
	Divider   lipgloss.Style
	Alias     lipgloss.Style
}

LogStyles contains all styles used in the log command

func NewLogStyles

func NewLogStyles() LogStyles

NewLogStyles initializes and returns all styles used in the log command

type MachineConfig

type MachineConfig struct {
	MemSizeMib       int64 `toml:"mem_size_mib"`
	VcpuCount        int64 `toml:"vcpu_count"`
	FsSizeClusterMib int64 `toml:"fs_size_cluster_mib"`
	FsSizeVmMib      int64 `toml:"fs_size_vm_mib"`
}

type MetadataInfo

type MetadataInfo struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description"`
	GitCommit   string `json:"gitCommit"`
	BuildDate   string `json:"buildDate"`
	Author      string `json:"author"`
	Repository  string `json:"repository"`
	License     string `json:"license"`
	GoVersion   string `json:"goVersion"`
	Platform    string `json:"platform"`
	Arch        string `json:"arch"`
	Timestamp   string `json:"timestamp"`
}

MetadataInfo represents the complete version information

type RootfsConfig

type RootfsConfig struct {
	Name string `toml:"name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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