Documentation ¶
Overview ¶
Package cmd contains chezmoi's commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
func Main(versionInfo VersionInfo, args []string) int
Main runs chezmoi and returns an exit code.
func StringOrBoolToAutoBoolHookFunc ¶
func StringOrBoolToAutoBoolHookFunc() mapstructure.DecodeHookFunc
StringOrBoolToAutoBoolHookFunc is a github.com/mitchellh/mapstructure.DecodeHookFunc that parses an autoBool from a bool or string.
func StringToChoiceFlagHookFunc ¶ added in v2.54.0
func StringToChoiceFlagHookFunc() mapstructure.DecodeHookFunc
StringToChoiceFlagHookFunc is a github.com/mitchellh/mapstructure.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 ¶ added in v2.36.1
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"` Mode chezmoi.Mode `json:"mode" mapstructure:"mode" yaml:"mode"` Pager string `json:"pager" mapstructure:"pager" yaml:"pager"` 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"` HCPVaultSecrets hcpVaultSecretConfig `json:"hcpVaultSecrets" mapstructure:"hcpVaultSecrets" yaml:"hcpVaultSecrets"` 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"` OnepasswordSDK onepasswordSDKConfig `json:"onepasswordSDK" mapstructure:"onepasswordSDK" yaml:"onepasswordSDK"` //nolint:tagliatelle Pass passConfig `json:"pass" mapstructure:"pass" yaml:"pass"` Passhole passholeConfig `json:"passhole" mapstructure:"passhole" yaml:"passhole"` 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"` 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 ¶ added in v2.39.0
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
- 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
- doctorcmd.go
- doctorcmd_unix.go
- dopplertemplatefuncs.go
- dumpcmd.go
- dumpconfigcmd.go
- editcmd.go
- editconfigcmd.go
- editconfigtemplatecmd.go
- ejsontemplatefuncs.go
- encryptcmd.go
- encryptiontemplatefuncs.go
- errors.go
- executetemplatecmd.go
- forgetcmd.go
- generatecmd.go
- gitcmd.go
- githubtemplatefuncs.go
- gopasstemplatefuncs.go
- hcpvaultsecretsttemplatefuncs.go
- helpcmd.go
- ignoredcmd.go
- importcmd.go
- initcmd.go
- inittemplatefuncs.go
- interactivetemplatefuncs.go
- internaltestcmd.go
- keepassxctemplatefuncs.go
- keepertemplatefuncs.go
- keyringtemplatefuncs.go
- lastpasstemplatefuncs.go
- lazyscryptidentity.go
- lazywriter.go
- licensecmd.go
- mackupcmd_nodarwin.go
- managedcmd.go
- mergeallcmd.go
- mergecmd.go
- nozerolog.go
- onepasswordsdktemplatefuncs.go
- onepasswordtemplatefuncs.go
- passholetemplatefuncs.go
- passtemplatefuncs.go
- pathlist.go
- pathstyle.go
- pinentry.go
- prompt.go
- purgecmd.go
- rbwtemplatefuncs.go
- readdcmd.go
- readhttpresponse.go
- removecmd.go
- secretcmd.go
- secretkeyringcmd.go
- secrettemplatefuncs.go
- shellquote.go
- sourcepathcmd.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