dotdrift

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package dotdrift implements the dotdrift CLI.

Index

Constants

This section is empty.

Variables

View Source
var CurrentLogFormat string

CurrentLogFormat records the active log format set at runtime.

Functions

func Run

func Run(version string, args []string) error

Run executes the CLI with the given version.

Types

type ApplyCmd

type ApplyCmd struct {
	Profile string `help:"Path to profile directory" type:"existingdir" default:"."`
	State   string `help:"Path to state file" type:"path" default:""`
	Yes     bool   `help:"Answer yes to mise prompts" default:"false"`
}

ApplyCmd runs the full pipeline and always resumes.

func (*ApplyCmd) Run

func (c *ApplyCmd) Run() error

Run executes the apply pipeline with resume semantics.

type CLI

type CLI struct {
	RootFlags `kong:"embed"`

	Init    InitCmd    `cmd:"" help:"Create or clone a profile"`
	Detect  DetectCmd  `cmd:"" help:"Detect system facts"`
	Modules ModulesCmd `cmd:"" help:"List selected and skipped modules"`
	Plan    PlanCmd    `cmd:"" help:"Print the effective plan"`
	Apply   ApplyCmd   `cmd:"" help:"Apply the profile"`
	Status  StatusCmd  `cmd:"" help:"Show status"`
	Onboard OnboardCmd `cmd:"" help:"Onboard paths into a module"`
	Version VersionCmd `cmd:"" help:"Show version information"`
	// contains filtered or unexported fields
}

CLI represents the main CLI structure.

func (*CLI) AfterApply

func (cli *CLI) AfterApply(kctx *kong.Context) error

AfterApply is called after Kong parses the CLI but before the command runs.

type DetectCmd

type DetectCmd struct {
	Out io.Writer `kong:"-"`
	// OSReader and GPUReader allow tests to inject fakes. When nil, real system
	// readers are used.
	OSReader  detect.OSReleaseReader `kong:"-"`
	GPUReader detect.GPUReader       `kong:"-"`
}

DetectCmd prints system facts.

func (*DetectCmd) Run

func (c *DetectCmd) Run() error

Run gathers and prints system facts in a stable line-oriented format.

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError carries a process exit code for a CLI failure. Usage/parse errors use code 2; runtime errors use code 1.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

type InitCmd

type InitCmd struct {
	Path string `arg:"" help:"Local path or git URL for the profile" default:"."`
}

InitCmd creates or clones a profile.

func (*InitCmd) Run

func (c *InitCmd) Run() error

Run creates a new profile directory or clones a git URL.

type ModulesCmd

type ModulesCmd struct {
	Profile string    `help:"Path to profile directory" type:"existingdir" default:"."`
	Out     io.Writer `kong:"-"`
}

ModulesCmd lists selected and skipped modules for a profile.

func (*ModulesCmd) Run

func (c *ModulesCmd) Run() error

Run loads the profile and prints selection status.

type OnboardCmd

type OnboardCmd struct {
	Paths []string `arg:"" optional:"" help:"Paths to onboard into the module"`

	Profile  string   `help:"Path to profile directory" type:"existingdir" default:"."`
	App      string   `help:"Module app id"`
	Mode     string   `help:"Dotfile mode" enum:"link,copy,template" default:"link"`
	Packages []string `help:"Distro packages to declare"`
	Tools    []string `help:"Mise tools to declare"`
	Host     bool     `help:"Host overlay only"`
	DryRun   bool     `help:"Preview only"`
}

OnboardCmd copies live paths into a module and applies them.

func (*OnboardCmd) Run

func (c *OnboardCmd) Run() error

Run implements the onboard command.

type PlanCmd

type PlanCmd struct {
	Profile string       `help:"Path to profile directory" type:"existingdir" default:"."`
	Facts   *facts.Facts `kong:"-"`
	Out     io.Writer    `kong:"-"`
}

PlanCmd prints the resolved plan without side effects.

func (*PlanCmd) Run

func (c *PlanCmd) Run() error

Run loads the profile and prints the resolved plan.

type RootFlags

type RootFlags struct {
	LogLevel          string `help:"Log level (trace,debug,info,warn,error)" enum:"trace,debug,info,warn,error" default:"info" env:"LOG_LEVEL"`
	LogFormat         string `help:"Log format (console,json)" enum:"console,json" default:"console" env:"LOG_FORMAT"`
	Profiling         bool   `help:"Enable pprof profiling server" default:"false"`
	ProfilingListenOn string `help:"Listen address for pprof profiling server" default:"0.0.0.0:6060"`
}

RootFlags holds global CLI flags.

type StatusCmd

type StatusCmd struct {
	Profile string `help:"Path to profile directory" type:"existingdir" default:"."`
	State   string `help:"Path to state file" type:"path" default:""`
	// contains filtered or unexported fields
}

StatusCmd shows the resume cursor and last error.

func (*StatusCmd) Run

func (c *StatusCmd) Run() error

Run loads state and prints the resume cursor.

type VersionCmd

type VersionCmd struct{}

VersionCmd shows version information

func (*VersionCmd) Run

func (v *VersionCmd) Run(version string) error

Run prints the application name and version.

Jump to

Keyboard shortcuts

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