Documentation
¶
Index ¶
- Variables
- func Run(version string, args []string) error
- type ApplyCmd
- type CLI
- type DetectCmd
- type GenerateCmd
- type GenerateMountsCmd
- type GenerateSmbCmd
- type InitCmd
- type ModulesCmd
- type OnboardCmd
- type ParuCmd
- type ParuInstallCmd
- type ParuInstalledCmd
- type PlanCmd
- type RootFlags
- type StatusCmd
- type VersionCmd
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"`
NoHooks bool `help:"Skip pre/post hook commands (also DOTDRIFT_NO_HOOKS=1)" default:"false"`
Verbose bool `` /* 139-byte string literal not displayed */
Modules []string `arg:"" optional:"" name:"modules" help:"Limit scope to these modules (space or comma separated)"`
Out io.Writer `kong:"-"`
}
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" aliases:"add"`
Generate GenerateCmd `cmd:"" help:"Generate mounts/smb modules"`
Paru ParuCmd `cmd:"" help:"paru mise plugin backend (internal)"`
Version VersionCmd `cmd:"" help:"Show version information"`
// contains filtered or unexported fields
}
root 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 GenerateCmd ¶ added in v0.2.0
type GenerateCmd struct {
Mounts GenerateMountsCmd `cmd:"" help:"Generate a mounts module (systemd units)"`
Smb GenerateSmbCmd `cmd:"" help:"Generate an smb module (samba shares)"`
}
GenerateCmd groups the module generators.
type GenerateMountsCmd ¶ added in v0.2.0
type GenerateMountsCmd struct {
Profile string `help:"Path to profile directory" type:"existingdir" default:"."`
Layer string `help:"Target layer" enum:"base,host,user" default:"base"`
Module string `help:"Module id" default:"mounts"`
Hostname string `help:"Hostname for --layer host (default: detected)"`
Username string `help:"Username for --layer user (default: detected)"`
Name string `help:"Mount name (input flag)"`
Source string `help:"Mount source, e.g. UUID=<uuid> or server:/export (input flag)"`
Destination string `help:"Mount destination path (input flag)"`
Type string `help:"Filesystem type; the registry preset applies when --option is omitted (input flag)"`
Option []string `help:"Mount option (repeatable; overrides the registry preset for --type)"`
StartAt string `name:"startat" help:"OnCalendar expression; adds a .timer/.service pair (input flag)"`
State string `help:"Mount state: enabled or disabled (default enabled)"`
ListVolumes bool `name:"list-volumes" help:"Print detected volumes and exit"`
TUI *bool `negatable:"" help:"Force the interactive wizard (--no-tui forces CLI mode)"`
Out io.Writer `kong:"-"`
}
GenerateMountsCmd generates a mounts module: systemd .mount units (plus .service/.timer pairs for --startat) and the module.toml scope, [mounts] section, packages, and dotfile entries that place them.
func (*GenerateMountsCmd) Run ¶ added in v0.2.0
func (c *GenerateMountsCmd) Run() error
Run implements the mounts generator: mode selection, then either the volume table, the wizard, or CLI-mode assembly + WriteModule.
type GenerateSmbCmd ¶ added in v0.2.0
type GenerateSmbCmd struct {
Profile string `help:"Path to profile directory" type:"existingdir" default:"."`
Layer string `help:"Target layer" enum:"base,host,user" default:"base"`
Module string `help:"Module id" default:"smb"`
Hostname string `help:"Hostname for --layer host (default: detected)"`
Username string `help:"Username for --layer user (default: detected)"`
Group string `help:"Samba group (default \"smb\"; input flag)"`
Users []string `name:"user" help:"Samba user (repeatable; default: the invoking user)"`
Avahi *bool `negatable:"" help:"Avahi service discovery (default on; --no-avahi records an explicit off)"`
Writable *bool `negatable:"" help:"Shares writable (default on; input flag)"`
Readonly bool `help:"Shares read-only: sets writable=false"`
Public bool `help:"Shares public (guest access; input flag)"`
TUI *bool `negatable:"" help:"Force the interactive wizard (--no-tui forces CLI mode)"`
Out io.Writer `kong:"-"`
}
GenerateSmbCmd generates an smb module: shares.conf, a one-time smb.conf seed, and the module.toml scope, smb section, packages, and dotfile entries that place them.
func (*GenerateSmbCmd) Run ¶ added in v0.2.0
func (c *GenerateSmbCmd) Run() error
Run implements the smb generator.
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:"."`
Modules []string `arg:"" optional:"" name:"modules" help:"Limit scope to these modules (space or comma separated)"`
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 directory name (inferred from the first path when omitted)"`
Mode string `help:"Dotfile mode" enum:"symlink,symlink-each,copy,template" default:"symlink"`
Packages []string `help:"Distro packages to declare; each entry is a bare name or name=\"description\" (the description becomes a TOML comment)"`
Tools []string `help:"Mise tools to declare"`
Host bool `help:"Host overlay only"`
DryRun bool `help:"Preview only"`
Yes bool `help:"Answer yes to mise prompts" default:"false"`
Verbose bool `` /* 139-byte string literal not displayed */
// Mise injects a runner for tests; nil uses the real mise bootstrap.
Mise mise.Runner `kong:"-"`
}
OnboardCmd copies live paths into a module and applies them.
type ParuCmd ¶ added in v0.10.0
type ParuCmd struct {
Installed ParuInstalledCmd `cmd:"" help:"Check package install status (plugin backend)"`
Install ParuInstallCmd `cmd:"" help:"Install packages via paru (plugin backend)"`
}
ParuCmd is the dotdrift mise package-plugin backend for the `paru` manager. These subcommands are invoked by the Lua plugin shim, not by end users directly. They are thin wrappers over internal/paru.
type ParuInstallCmd ¶ added in v0.10.0
type ParuInstallCmd struct {
Names []string `arg:"" optional:"" help:"Package names to install"`
DryRun bool `name:"dry-run" help:"Print what would happen without running"`
Update bool `help:"Refresh package manager metadata first"`
}
ParuInstallCmd installs packages via paru -S --needed --noconfirm.
func (*ParuInstallCmd) Run ¶ added in v0.10.0
func (c *ParuInstallCmd) Run() error
type ParuInstalledCmd ¶ added in v0.10.0
type ParuInstalledCmd struct {
Names []string `arg:"" optional:"" help:"Package names to check"`
}
ParuInstalledCmd checks package status via pacman -Q and emits the line protocol consumed by the Lua plugin shim.
func (*ParuInstalledCmd) Run ¶ added in v0.10.0
func (c *ParuInstalledCmd) Run() error
type PlanCmd ¶
type PlanCmd struct {
Profile string `help:"Path to profile directory" type:"existingdir" default:"."`
JSON bool `help:"Print the plan as a single JSON object (suppresses the text rendering and warnings)"`
Deps bool `help:"Show dependency tree for packages in the install list"`
DepsDepth int `default:"1" help:"Dependency recursion depth (requires --deps)"`
Modules []string `arg:"" optional:"" name:"modules" help:"Limit scope to these modules (space or comma separated)"`
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"`
PProf bool `help:"Enable pprof profiling server" default:"false"`
PProfListenOn string `help:"Listen address for pprof profiling server" default:"127.0.0.1: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.