configs

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoGitHubToken error message when token is not found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoGitHubToken = errors.New("Could not find a valid github token. GHORG_GITHUB_TOKEN or (--token, -t) flag must be set. Create a personal access token, then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'GitHub Setup' in README.md")

	// ErrNoGitLabToken error message when token is not found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoGitLabToken = errors.New("Could not find a valid gitlab token. GHORG_GITLAB_TOKEN or (--token, -t) flag must be set. Create a token from gitlab then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'GitLab Setup' in README.md")

	// ErrNoGiteaToken error message when token is not found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoGiteaToken = errors.New("Could not find a valid gitea token. GHORG_GITEA_TOKEN or (--token, -t) flag must be set. Create a token from gitea then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'Gitea Setup' in README.md")

	// ErrNoSourcehutToken error message when token is not found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoSourcehutToken = errors.New("Could not find a valid sourcehut token. GHORG_SOURCEHUT_TOKEN or (--token, -t) flag must be set. Create a token from sourcehut then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'Sourcehut Setup' in README.md")

	// ErrNoBitbucketUsername error message when no username found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoBitbucketUsername = errors.New("Could not find bitbucket username. GHORG_BITBUCKET_USERNAME or (--bitbucket-username) must be set to clone repos from bitbucket, see 'BitBucket Setup' in README.md")

	// ErrNoBitbucketAppPassword error message when no app password found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoBitbucketAppPassword = errors.New("Could not find a valid bitbucket app password. GHORG_BITBUCKET_APP_PASSWORD or (--token, -t) must be set to clone repos from bitbucket, see 'BitBucket Setup' in README.md")

	// ErrNoBitbucketCredentials error message when no valid bitbucket credentials are found
	//nolint:staticcheck // ST1005: User-facing error message, capitalization is intentional
	ErrNoBitbucketCredentials = errors.New("Could not find valid bitbucket credentials. Set one of: GHORG_BITBUCKET_API_TOKEN (with GHORG_BITBUCKET_API_EMAIL), GHORG_BITBUCKET_APP_PASSWORD (with GHORG_BITBUCKET_USERNAME), or GHORG_BITBUCKET_OAUTH_TOKEN")

	// ErrIncorrectScmType indicates an unsupported scm type being used
	ErrIncorrectScmType = errors.New("GHORG_SCM_TYPE or --scm must be one of " + strings.Join(scm.SupportedClients(), ", "))

	// ErrIncorrectCloneType indicates an unsupported clone type being used
	ErrIncorrectCloneType = errors.New("GHORG_CLONE_TYPE or --clone-type must be one of org or user")

	// ErrIncorrectProtocolType indicates an unsupported protocol type being used
	ErrIncorrectProtocolType = errors.New("GHORG_CLONE_PROTOCOL or --protocol must be one of https or ssh")

	// ErrIncorrectGithubUserOptionValue indicates an incorrectly set GHORG_GITHUB_USER_OPTION value
	ErrIncorrectGithubUserOptionValue = errors.New("GHORG_GITHUB_USER_OPTION or --github-user-option must be one of 'owner', 'member', or 'all' and is only available to be used when GHORG_CLONE_TYPE: user or --clone-type=user is set")
)
View Source
var AllKeys = []ConfigKey{

	{
		DotNotation:  "core.path",
		EnvVar:       "GHORG_ABSOLUTE_PATH_TO_CLONE_TO",
		DefaultValue: "",
		Description:  "Absolute path to clone repositories into",
	},
	{
		DotNotation:  "core.output-dir",
		EnvVar:       "GHORG_OUTPUT_DIR",
		DefaultValue: "",
		Description:  "Override the output directory name (defaults to org/user name)",
	},
	{
		DotNotation:  "core.concurrency",
		EnvVar:       "GHORG_CONCURRENCY",
		DefaultValue: "25",
		Description:  "Maximum number of concurrent clone operations",
	},
	{
		DotNotation:  "core.color",
		EnvVar:       "GHORG_COLOR",
		DefaultValue: "disabled",
		Description:  "Enable colored output (enabled/disabled)",
	},
	{
		DotNotation:  "core.quiet",
		EnvVar:       "GHORG_QUIET",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Emit only critical output",
	},
	{
		DotNotation:  "core.dry-run",
		EnvVar:       "GHORG_DRY_RUN",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Show what would be cloned without actually cloning",
	},
	{
		DotNotation:  "core.no-dir-size",
		EnvVar:       "GHORG_NO_DIR_SIZE",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip directory size calculation after cloning",
	},

	{
		DotNotation:  "scm.type",
		EnvVar:       "GHORG_SCM_TYPE",
		DefaultValue: "github",
		Description:  "Source code management provider (github, gitlab, gitea, bitbucket, sourcehut)",
	},
	{
		DotNotation:  "scm.base-url",
		EnvVar:       "GHORG_SCM_BASE_URL",
		DefaultValue: "",
		Description:  "Base URL for self-hosted SCM instances",
	},

	{
		DotNotation:  "clone.protocol",
		EnvVar:       "GHORG_CLONE_PROTOCOL",
		DefaultValue: "https",
		Description:  "Clone protocol (https or ssh)",
	},
	{
		DotNotation:  "clone.type",
		EnvVar:       "GHORG_CLONE_TYPE",
		DefaultValue: "org",
		Description:  "Clone target type (org or user)",
	},
	{
		DotNotation:  "clone.branch",
		EnvVar:       "GHORG_BRANCH",
		DefaultValue: "",
		Description:  "Branch to checkout after cloning",
	},
	{
		DotNotation:  "clone.depth",
		EnvVar:       "GHORG_CLONE_DEPTH",
		DefaultValue: "",
		Description:  "Shallow clone depth (empty for full clone)",
	},
	{
		DotNotation:  "clone.delay-seconds",
		EnvVar:       "GHORG_CLONE_DELAY_SECONDS",
		DefaultValue: "0",
		Description:  "Delay in seconds between clone operations (forces concurrency to 1)",
	},
	{
		DotNotation:  "clone.wiki",
		EnvVar:       "GHORG_CLONE_WIKI",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Clone wiki repositories",
	},
	{
		DotNotation:  "clone.snippets",
		EnvVar:       "GHORG_CLONE_SNIPPETS",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Clone GitLab snippets",
	},
	{
		DotNotation:  "clone.backup",
		EnvVar:       "GHORG_BACKUP",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Mirror clone for backup purposes",
	},
	{
		DotNotation:  "clone.no-clean",
		EnvVar:       "GHORG_NO_CLEAN",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip git clean on existing repositories",
	},
	{
		DotNotation:  "clone.include-submodules",
		EnvVar:       "GHORG_INCLUDE_SUBMODULES",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Initialize and update submodules after cloning",
	},
	{
		DotNotation:  "clone.sync-default-branch",
		EnvVar:       "GHORG_SYNC_DEFAULT_BRANCH",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Sync local default branch with remote on existing repos",
	},
	{
		DotNotation:  "clone.preserve-dir",
		EnvVar:       "GHORG_PRESERVE_DIRECTORY_STRUCTURE",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Preserve GitLab namespace directory structure",
	},
	{
		DotNotation:  "clone.preserve-scm-hostname",
		EnvVar:       "GHORG_PRESERVE_SCM_HOSTNAME",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Append SCM hostname to clone path",
	},
	{
		DotNotation:  "clone.protect-local",
		EnvVar:       "GHORG_PROTECT_LOCAL",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip repos with uncommitted changes or unpushed commits",
	},

	{
		DotNotation:  "auth.no-token",
		EnvVar:       "GHORG_NO_TOKEN",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Clone without authentication",
	},

	{
		DotNotation:  "git.filter",
		EnvVar:       "GHORG_GIT_FILTER",
		DefaultValue: "",
		Description:  "Git filter options (e.g., blob:none for partial clones)",
	},
	{
		DotNotation:  "git.backend",
		EnvVar:       "GHORG_GIT_BACKEND",
		DefaultValue: "golang",
		Description:  "Git backend: golang (pure Go) or exec (system git)",
	},

	{
		DotNotation:  "filter.skip-archived",
		EnvVar:       "GHORG_SKIP_ARCHIVED",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip archived repositories",
	},
	{
		DotNotation:  "filter.skip-forks",
		EnvVar:       "GHORG_SKIP_FORKS",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip forked repositories",
	},
	{
		DotNotation:  "filter.topics",
		EnvVar:       "GHORG_TOPICS",
		DefaultValue: "",
		Description:  "Comma-separated topic filter",
	},
	{
		DotNotation:  "filter.match-prefix",
		EnvVar:       "GHORG_MATCH_PREFIX",
		DefaultValue: "",
		Description:  "Include repos matching prefix (comma-separated, case-insensitive)",
	},
	{
		DotNotation:  "filter.exclude-match-prefix",
		EnvVar:       "GHORG_EXCLUDE_MATCH_PREFIX",
		DefaultValue: "",
		Description:  "Exclude repos matching prefix (comma-separated, case-insensitive)",
	},
	{
		DotNotation:  "filter.match-regex",
		EnvVar:       "GHORG_MATCH_REGEX",
		DefaultValue: "",
		Description:  "Include repos matching regex pattern",
	},
	{
		DotNotation:  "filter.exclude-match-regex",
		EnvVar:       "GHORG_EXCLUDE_MATCH_REGEX",
		DefaultValue: "",
		Description:  "Exclude repos matching regex pattern",
	},
	{
		DotNotation:  "filter.ignore-path",
		EnvVar:       "GHORG_IGNORE_PATH",
		DefaultValue: "",
		Description:  "Path to ghorgignore file",
	},
	{
		DotNotation:  "filter.only-path",
		EnvVar:       "GHORG_ONLY_PATH",
		DefaultValue: "",
		Description:  "Path to ghorgonly file",
	},
	{
		DotNotation:  "filter.target-repos-path",
		EnvVar:       "GHORG_TARGET_REPOS_PATH",
		DefaultValue: "",
		Description:  "Path to file listing specific repos to clone",
	},

	{
		DotNotation:  "prune.enabled",
		EnvVar:       "GHORG_PRUNE",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Delete local repos not found on remote",
	},
	{
		DotNotation:  "prune.no-confirm",
		EnvVar:       "GHORG_PRUNE_NO_CONFIRM",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip confirmation when pruning",
	},
	{
		DotNotation:  "prune.untouched",
		EnvVar:       "GHORG_PRUNE_UNTOUCHED",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Prune repos that were not cloned or updated",
	},
	{
		DotNotation:  "prune.untouched-no-confirm",
		EnvVar:       "GHORG_PRUNE_UNTOUCHED_NO_CONFIRM",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip confirmation when pruning untouched repos",
	},

	{
		DotNotation:  "fetch.all",
		EnvVar:       "GHORG_FETCH_ALL",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Fetch all remote branches",
	},
	{
		DotNotation:  "fetch.prune",
		EnvVar:       "GHORG_FETCH_PRUNE",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Append --prune to fetch (requires fetch.all)",
	},

	{
		DotNotation:  "exit-code.clone-infos",
		EnvVar:       "GHORG_EXIT_CODE_ON_CLONE_INFOS",
		DefaultValue: "0",
		Description:  "Exit code when clone info messages are present",
	},
	{
		DotNotation:  "exit-code.clone-issues",
		EnvVar:       "GHORG_EXIT_CODE_ON_CLONE_ISSUES",
		DefaultValue: "1",
		Description:  "Exit code when clone errors occur",
	},

	{
		DotNotation:  "stats.enabled",
		EnvVar:       "GHORG_STATS_ENABLED",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Generate a stats CSV file after cloning",
	},

	{
		DotNotation:  "ssh.hostname",
		EnvVar:       "GHORG_SSH_HOSTNAME",
		DefaultValue: "",
		Description:  "Custom SSH hostname alias for clone URLs",
	},

	{
		DotNotation:  "github.token",
		EnvVar:       "GHORG_GITHUB_TOKEN",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "GitHub personal access token",
	},
	{
		DotNotation:  "github.token-from-app",
		EnvVar:       "GHORG_GITHUB_TOKEN_FROM_GITHUB_APP",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Treat token as a GitHub App token",
	},
	{
		DotNotation:  "github.app-pem-path",
		EnvVar:       "GHORG_GITHUB_APP_PEM_PATH",
		DefaultValue: "",
		Description:  "Path to GitHub App PEM private key file",
	},
	{
		DotNotation:  "github.app-installation-id",
		EnvVar:       "GHORG_GITHUB_APP_INSTALLATION_ID",
		DefaultValue: "",
		Description:  "GitHub App installation ID",
	},
	{
		DotNotation:  "github.app-id",
		EnvVar:       "GHORG_GITHUB_APP_ID",
		DefaultValue: "",
		Description:  "GitHub App application ID",
	},
	{
		DotNotation:  "github.user-option",
		EnvVar:       "GHORG_GITHUB_USER_OPTION",
		DefaultValue: "owner",
		Description:  "GitHub user repo filter: owner, member, or all",
	},
	{
		DotNotation:  "github.filter-language",
		EnvVar:       "GHORG_GITHUB_FILTER_LANGUAGE",
		DefaultValue: "",
		Description:  "Filter GitHub repos by language (comma-separated)",
	},
	{
		DotNotation:  "github.user-gists",
		EnvVar:       "GHORG_GITHUB_USER_GISTS",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Clone GitHub user gists",
	},

	{
		DotNotation:  "gitlab.token",
		EnvVar:       "GHORG_GITLAB_TOKEN",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "GitLab personal access token",
	},
	{
		DotNotation:  "gitlab.insecure",
		EnvVar:       "GHORG_INSECURE_GITLAB_CLIENT",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Skip TLS verification for GitLab",
	},
	{
		DotNotation:  "gitlab.group-exclude-match-regex",
		EnvVar:       "GHORG_GITLAB_GROUP_EXCLUDE_MATCH_REGEX",
		DefaultValue: "",
		Description:  "Exclude GitLab groups matching regex",
	},
	{
		DotNotation:  "gitlab.group-match-regex",
		EnvVar:       "GHORG_GITLAB_GROUP_MATCH_REGEX",
		DefaultValue: "",
		Description:  "Include only GitLab groups matching regex",
	},

	{
		DotNotation:  "bitbucket.app-password",
		EnvVar:       "GHORG_BITBUCKET_APP_PASSWORD",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "Bitbucket app password",
	},
	{
		DotNotation:  "bitbucket.username",
		EnvVar:       "GHORG_BITBUCKET_USERNAME",
		DefaultValue: "",
		Description:  "Bitbucket username for app password auth",
	},
	{
		DotNotation:  "bitbucket.oauth-token",
		EnvVar:       "GHORG_BITBUCKET_OAUTH_TOKEN",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "Bitbucket OAuth token",
	},
	{
		DotNotation:  "bitbucket.api-token",
		EnvVar:       "GHORG_BITBUCKET_API_TOKEN",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "Bitbucket Cloud API token",
	},
	{
		DotNotation:  "bitbucket.api-email",
		EnvVar:       "GHORG_BITBUCKET_API_EMAIL",
		DefaultValue: "",
		Description:  "Email associated with Bitbucket API token",
	},
	{
		DotNotation:  "bitbucket.insecure",
		EnvVar:       "GHORG_INSECURE_BITBUCKET_CLIENT",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Allow HTTP for Bitbucket Server",
	},

	{
		DotNotation:  "gitea.token",
		EnvVar:       "GHORG_GITEA_TOKEN",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "Gitea personal access token",
	},
	{
		DotNotation:  "gitea.insecure",
		EnvVar:       "GHORG_INSECURE_GITEA_CLIENT",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Allow HTTP for Gitea",
	},

	{
		DotNotation:  "sourcehut.token",
		EnvVar:       "GHORG_SOURCEHUT_TOKEN",
		DefaultValue: "",
		IsSecret:     true,
		Description:  "Sourcehut personal access token",
	},
	{
		DotNotation:  "sourcehut.insecure",
		EnvVar:       "GHORG_INSECURE_SOURCEHUT_CLIENT",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Allow HTTP for Sourcehut",
	},

	{
		DotNotation:  "reclone.path",
		EnvVar:       "GHORG_RECLONE_PATH",
		DefaultValue: "",
		Description:  "Path to reclone.yaml configuration file",
	},
	{
		DotNotation:  "reclone.quiet",
		EnvVar:       "GHORG_RECLONE_QUIET",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Suppress reclone output",
	},
	{
		DotNotation:  "reclone.env-config-only",
		EnvVar:       "GHORG_RECLONE_ENV_CONFIG_ONLY",
		DefaultValue: "false",
		IsBool:       true,
		Description:  "Use only environment variables for reclone config",
	},
	{
		DotNotation:  "reclone.server-port",
		EnvVar:       "GHORG_RECLONE_SERVER_PORT",
		DefaultValue: ":8080",
		Description:  "Port for the reclone HTTP server",
	},
	{
		DotNotation:  "reclone.cron-timer-minutes",
		EnvVar:       "GHORG_CRON_TIMER_MINUTES",
		DefaultValue: "60",
		Description:  "Interval in minutes for cron-based recloning",
	},
}

AllKeys is the complete registry of configuration keys.

Functions

func DefaultConfFile

func DefaultConfFile() string

func DotToEnvVar added in v0.1.0

func DotToEnvVar(dot string) string

DotToEnvVar converts a dot-notation key to its environment variable name. Returns empty string if the key is not in the registry.

func EnsureTrailingSlashOnFilePath

func EnsureTrailingSlashOnFilePath(s string) string

EnsureTrailingSlashOnFilePath takes a filepath and ensures a single / is appened

func EnsureTrailingSlashOnURL

func EnsureTrailingSlashOnURL(s string) string

EnsureTrailingSlashOnURL takes a url and ensures a single / is appened

func EnvVarToDot added in v0.1.0

func EnvVarToDot(env string) string

EnvVarToDot converts an environment variable name to its dot-notation key. Returns empty string if the env var is not in the registry.

func FormatConfigList added in v0.1.0

func FormatConfigList(values map[string]string, showSecrets bool) string

FormatConfigList formats config key-value pairs for display, sorted by key. Secret values are redacted unless showSecrets is true.

func GetAbsolutePathToCloneTo

func GetAbsolutePathToCloneTo() string

func GetCloudScmTypeHostnames

func GetCloudScmTypeHostnames() string

func GetOrSetToken

func GetOrSetToken()

GetOrSetToken will set token based on scm

func GetRequiredString

func GetRequiredString(key string) string

GetRequiredString verifies env is set

func GetTokenFromFile

func GetTokenFromFile(path string) string

func GhorgConfDir

func GhorgConfDir() string

GhorgConfDir returns the ghorg directory path

func GhorgIgnoreDetected

func GhorgIgnoreDetected() bool

GhorgIgnoreDetected returns true if a ghorgignore file exists.

func GhorgIgnoreLocation

func GhorgIgnoreLocation() string

GhorgIgnoreLocation returns the path of users ghorgignore

func GhorgOnlyDetected

func GhorgOnlyDetected() bool

GhorgOnlyDetected returns true if a ghorgonly file exists.

func GhorgOnlyLocation

func GhorgOnlyLocation() string

GhorgOnlyLocation returns the path of users ghorgonly

func GhorgQuiet

func GhorgQuiet() bool

func GhorgReCloneDetected

func GhorgReCloneDetected() bool

GhorgReCloneDetected returns true if a reclone.yaml file exists.

func GhorgReCloneLocation

func GhorgReCloneLocation() string

GhorgReCloneLocation returns the path of users ghorgignore

func HomeDir

func HomeDir() string

HomeDir finds the users home directory

func IsFilePath

func IsFilePath(path string) bool

func ListConfigValues added in v0.1.0

func ListConfigValues(path string) (map[string]string, error)

ListConfigValues reads a config file and returns all values mapped to their dot-notation keys. Legacy GHORG_* keys are translated.

func Load

func Load()

Load triggers the configs to load first, not sure if this is actually needed

func ReadConfigFile added in v0.1.0

func ReadConfigFile(path string) (map[string]string, error)

ReadConfigFile reads a YAML config file and returns all key-value pairs as dot-notation keys. Supports both the new nested format and legacy flat format.

func ReadConfigValue added in v0.1.0

func ReadConfigValue(path, dotKey string) (string, bool, error)

ReadConfigValue reads a single dot-notation key from a config file. It checks both nested YAML and legacy GHORG_* flat keys.

func Sections added in v0.1.0

func Sections() []string

Sections returns a deduplicated, ordered list of all section names.

func UnsetConfigValue added in v0.1.0

func UnsetConfigValue(path, dotKey string) error

UnsetConfigValue removes a dot-notation key from a YAML config file.

func VerifyConfigsSetCorrectly

func VerifyConfigsSetCorrectly() error

VerifyConfigsSetCorrectly makes sure flags are set to appropriate values

func VerifyTokenSet

func VerifyTokenSet() error

VerifyTokenSet checks to make sure env is set for the correct scm provider

func WriteConfigValue added in v0.1.0

func WriteConfigValue(path, dotKey, value string) error

WriteConfigValue sets a dot-notation key in a YAML config file. Creates the file if it doesn't exist. Uses nested YAML structure.

func XConfigHomeSet

func XConfigHomeSet() bool

XConfigHomeSet checks for XDG_CONFIG_HOME env set

Types

type ConfigKey added in v0.1.0

type ConfigKey struct {
	// DotNotation is the canonical key name (e.g., "scm.type").
	DotNotation string

	// EnvVar is the legacy environment variable name (e.g., "GHORG_SCM_TYPE").
	EnvVar string

	// DefaultValue is the hard-coded default, empty string means no default.
	DefaultValue string

	// IsBool indicates this key stores a boolean value ("true"/"false").
	IsBool bool

	// IsSecret indicates this key stores sensitive data (tokens, passwords).
	// Secret values are redacted in `ghorg config --list` output.
	IsSecret bool

	// Description is a short human-readable description of the key.
	Description string
}

ConfigKey represents a single configuration key with all its representations.

func LookupByDot added in v0.1.0

func LookupByDot(dot string) *ConfigKey

LookupByDot returns the ConfigKey for a dot-notation key, or nil if not found.

func LookupByEnvVar added in v0.1.0

func LookupByEnvVar(env string) *ConfigKey

LookupByEnvVar returns the ConfigKey for an environment variable name, or nil if not found.

func (ConfigKey) Section added in v0.1.0

func (c ConfigKey) Section() string

Section returns the top-level section name (everything before the first dot).

func (ConfigKey) YAMLPath added in v0.1.0

func (c ConfigKey) YAMLPath() []string

YAMLPath returns the nested YAML key path (e.g., ["scm", "type"]).

Jump to

Keyboard shortcuts

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