Documentation
¶
Overview ¶
Package cmd contains chezmoi's commands.
Index ¶
- Variables
- func Main(versionInfo VersionInfo, args []string) int
- func NewDefaultInterpreters(findExecutable func([]string, []string) (string, error)) map[string]chezmoi.Interpreter
- func StringOrBoolToAutoBoolHookFunc() mapstructure.DecodeHookFunc
- func StringToChoiceFlagHookFunc() mapstructure.DecodeHookFunc
- type Config
- type ConfigFile
- type LazyScryptIdentity
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
var DefaultInterpreters = NewDefaultInterpreters(chezmoi.FindExecutable)
DefaultInterpreters is the default interpreters map for the current platform.
Functions ¶
func Main ¶
func Main(versionInfo VersionInfo, args []string) int
Main runs chezmoi and returns an exit code.
func NewDefaultInterpreters ¶
func NewDefaultInterpreters(findExecutable func([]string, []string) (string, error)) map[string]chezmoi.Interpreter
NewDefaultInterpreters returns the default interpreters map, using the provided findExecutable function.
func StringOrBoolToAutoBoolHookFunc ¶
func StringOrBoolToAutoBoolHookFunc() mapstructure.DecodeHookFunc
StringOrBoolToAutoBoolHookFunc is a github.com/go-viper/mapstructure/v2.DecodeHookFunc that parses an autoBool from a bool or string.
func StringToChoiceFlagHookFunc ¶
func StringToChoiceFlagHookFunc() mapstructure.DecodeHookFunc
StringToChoiceFlagHookFunc is a github.com/go-viper/mapstructure/v2.DecodeHookFunc that parses a choiceFlag from a string.
Unfortunately, we only receive the type of the value that we're decoding into, not its value, so we do not have access to the set of allowed values. So, we have to return a choiceFlag that allows all values.
Types ¶
type Config ¶
type Config struct {
ConfigFile
// contains filtered or unexported fields
}
A Config represents a configuration.
type ConfigFile ¶
type ConfigFile struct {
// Global configuration.
CacheDirAbsPath chezmoi.AbsPath `json:"cacheDir" mapstructure:"cacheDir" yaml:"cacheDir"`
Color autoBool `json:"color" mapstructure:"color" yaml:"color"`
Data map[string]any `json:"data" mapstructure:"data" yaml:"data"`
Env map[string]string `json:"env" mapstructure:"env" yaml:"env"`
Format *choiceFlag `json:"format" mapstructure:"format" yaml:"format"`
DestDirAbsPath chezmoi.AbsPath `json:"destDir" mapstructure:"destDir" yaml:"destDir"`
GitHub gitHubConfig `json:"gitHub" mapstructure:"gitHub" yaml:"gitHub"`
Hooks map[string]hookConfig `json:"hooks" mapstructure:"hooks" yaml:"hooks"`
Interactive bool `json:"interactive" mapstructure:"interactive" yaml:"interactive"`
Interpreters map[string]chezmoi.Interpreter `json:"interpreters" mapstructure:"interpreters" yaml:"interpreters"`
LessInteractive bool `json:"lessInteractive" mapstructure:"lessInteractive" yaml:"lessInteractive"`
Mode chezmoi.Mode `json:"mode" mapstructure:"mode" yaml:"mode"`
Pager string `json:"pager" mapstructure:"pager" yaml:"pager"`
PagerArgs []string `json:"pagerArgs" mapstructure:"pagerArgs" yaml:"pagerArgs"`
PersistentStateAbsPath chezmoi.AbsPath `json:"persistentState" mapstructure:"persistentState" yaml:"persistentState"`
PINEntry pinEntryConfig `json:"pinentry" mapstructure:"pinentry" yaml:"pinentry"`
Progress autoBool `json:"progress" mapstructure:"progress" yaml:"progress"`
Safe bool `json:"safe" mapstructure:"safe" yaml:"safe"`
ScriptEnv map[string]string `json:"scriptEnv" mapstructure:"scriptEnv" yaml:"scriptEnv"`
ScriptTempDir chezmoi.AbsPath `json:"scriptTempDir" mapstructure:"scriptTempDir" yaml:"scriptTempDir"`
SourceDirAbsPath chezmoi.AbsPath `json:"sourceDir" mapstructure:"sourceDir" yaml:"sourceDir"`
TempDir chezmoi.AbsPath `json:"tempDir" mapstructure:"tempDir" yaml:"tempDir"`
Template templateConfig `json:"template" mapstructure:"template" yaml:"template"`
TextConv textConv `json:"textConv" mapstructure:"textConv" yaml:"textConv"`
Umask fs.FileMode `json:"umask" mapstructure:"umask" yaml:"umask"`
UseBuiltinAge autoBool `json:"useBuiltinAge" mapstructure:"useBuiltinAge" yaml:"useBuiltinAge"`
UseBuiltinGit autoBool `json:"useBuiltinGit" mapstructure:"useBuiltinGit" yaml:"useBuiltinGit"`
Verbose bool `json:"verbose" mapstructure:"verbose" yaml:"verbose"`
Warnings warningsConfig `json:"warnings" mapstructure:"warnings" yaml:"warnings"`
WorkingTreeAbsPath chezmoi.AbsPath `json:"workingTree" mapstructure:"workingTree" yaml:"workingTree"`
// Password manager configurations.
AWSSecretsManager awsSecretsManagerConfig `json:"awsSecretsManager" mapstructure:"awsSecretsManager" yaml:"awsSecretsManager"`
AzureKeyVault azureKeyVaultConfig `json:"azureKeyVault" mapstructure:"azureKeyVault" yaml:"azureKeyVault"`
Bitwarden bitwardenConfig `json:"bitwarden" mapstructure:"bitwarden" yaml:"bitwarden"`
BitwardenSecrets bitwardenSecretsConfig `json:"bitwardenSecrets" mapstructure:"bitwardenSecrets" yaml:"bitwardenSecrets"`
Dashlane dashlaneConfig `json:"dashlane" mapstructure:"dashlane" yaml:"dashlane"`
Doppler dopplerConfig `json:"doppler" mapstructure:"doppler" yaml:"doppler"`
Ejson ejsonConfig `json:"ejson" mapstructure:"ejson" yaml:"ejson"`
Gopass gopassConfig `json:"gopass" mapstructure:"gopass" yaml:"gopass"`
Keepassxc keepassxcConfig `json:"keepassxc" mapstructure:"keepassxc" yaml:"keepassxc"`
Keeper keeperConfig `json:"keeper" mapstructure:"keeper" yaml:"keeper"`
Lastpass lastpassConfig `json:"lastpass" mapstructure:"lastpass" yaml:"lastpass"`
Onepassword onepasswordConfig `json:"onepassword" mapstructure:"onepassword" yaml:"onepassword"`
Pass passConfig `json:"pass" mapstructure:"pass" yaml:"pass"`
Passhole passholeConfig `json:"passhole" mapstructure:"passhole" yaml:"passhole"`
ProtonPass protonPassConfig `json:"protonPass" mapstructure:"protonPass" yaml:"protonPass"`
RBW rbwConfig `json:"rbw" mapstructure:"rbw" yaml:"rbw"`
Secret secretConfig `json:"secret" mapstructure:"secret" yaml:"secret"`
Vault vaultConfig `json:"vault" mapstructure:"vault" yaml:"vault"`
// Encryption configurations.
Encryption string `json:"encryption" mapstructure:"encryption" yaml:"encryption"`
Age chezmoi.AgeEncryption `json:"age" mapstructure:"age" yaml:"age"`
GPG chezmoi.GPGEncryption `json:"gpg" mapstructure:"gpg" yaml:"gpg"`
// Command configurations.
Add addCmdConfig `json:"add" mapstructure:"add" yaml:"add"`
CD cdCmdConfig `json:"cd" mapstructure:"cd" yaml:"cd"`
Completion completionCmdConfig `json:"completion" mapstructure:"completion" yaml:"completion"`
Docker dockerCmdConfig `json:"docker" mapstructure:"docker" yaml:"docker"`
Diff diffCmdConfig `json:"diff" mapstructure:"diff" yaml:"diff"`
Edit editCmdConfig `json:"edit" mapstructure:"edit" yaml:"edit"`
Git gitCmdConfig `json:"git" mapstructure:"git" yaml:"git"`
Merge mergeCmdConfig `json:"merge" mapstructure:"merge" yaml:"merge"`
Status statusCmdConfig `json:"status" mapstructure:"status" yaml:"status"`
Update updateCmdConfig `json:"update" mapstructure:"update" yaml:"update"`
Verify verifyCmdConfig `json:"verify" mapstructure:"verify" yaml:"verify"`
}
ConfigFile contains all data settable in the config file.
type LazyScryptIdentity ¶
LazyScryptIdentity is an age.Identity that requests a passphrase only if it encounters an scrypt stanza. After obtaining a passphrase, it delegates to ScryptIdentity.
Source Files
¶
- addcmd.go
- agecmd.go
- agekeygencmd.go
- annotation.go
- applycmd.go
- archivecmd.go
- autobool.go
- awssecretsmanagertemplatefuncs.go
- azurekeyvaulttemplatefuncs.go
- bitwardensecretstemplatefuncs.go
- bitwardentemplatefuncs.go
- catcmd.go
- catconfigcmd.go
- cdcmd.go
- chattrcmd.go
- choiceflag.go
- cmd.go
- completioncmd.go
- config.go
- dashlanetemplatefuncs.go
- datacmd.go
- dataformat.go
- decryptcmd.go
- destroycmd.go
- diffcmd.go
- dockercmd.go
- doctorcmd.go
- doctorcmd_unix.go
- dopplertemplatefuncs.go
- dumpcmd.go
- dumpconfigcmd.go
- editcmd.go
- editconfigcmd.go
- editconfigtemplatecmd.go
- editencryptedcmd.go
- ejsontemplatefuncs.go
- encryptcmd.go
- encryptiontemplatefuncs.go
- errors.go
- executetemplatecmd.go
- forgetcmd.go
- generatecmd.go
- gitcmd.go
- githubtemplatefuncs.go
- gopasstemplatefuncs.go
- helpcmd.go
- helps.gen.go
- httpcache.go
- ignoredcmd.go
- importcmd.go
- initcmd.go
- inittemplatefuncs.go
- interactivetemplatefuncs.go
- internaltestcmd.go
- interpreters.go
- keepassxctemplatefuncs.go
- keepertemplatefuncs.go
- keyringtemplatefuncs.go
- lastpasstemplatefuncs.go
- lazyscryptidentity.go
- lazywriter.go
- license.gen.go
- licensecmd.go
- mackupcmd_nodarwin.go
- managedcmd.go
- mergeallcmd.go
- mergecmd.go
- onepasswordtemplatefuncs.go
- passholetemplatefuncs.go
- passtemplatefuncs.go
- pathlist.go
- pathstyle.go
- pinentry.go
- prompt.go
- protonpasstemplatefuncs.go
- purgecmd.go
- pushcmd.go
- rbwtemplatefuncs.go
- readdcmd.go
- readhttpresponse.go
- removecmd.go
- secretcmd.go
- secretkeyringcmd.go
- secrettemplatefuncs.go
- shellquote.go
- sourcepathcmd.go
- sshcmd.go
- statecmd.go
- statuscmd.go
- targetpathcmd.go
- templatefuncs.go
- textconv.go
- unmanagedcmd.go
- updatecmd.go
- upgradecmd.go
- upgradecmd_unix.go
- util.go
- util_unix.go
- vaulttemplatefuncs.go
- verifycmd.go