Documentation
¶
Overview ¶
Package dotdrift implements the dotdrift CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CurrentLogFormat string
CurrentLogFormat records the active log format set at runtime.
Functions ¶
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.
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.
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.
type ExitError ¶
ExitError carries a process exit code for a CLI failure. Usage/parse errors use code 2; runtime errors use code 1.
type InitCmd ¶
type InitCmd struct {
Path string `arg:"" help:"Local path or git URL for the profile" default:"."`
}
InitCmd creates or clones a profile.
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.
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.
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.
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.