{"modulePath":"github.com/windsorcli/cli","version":"v0.10.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tools\n\n## Types\n\n```go\ntype BaseToolsManager struct {\n\t// contains filtered or unexported fields\n}\n```\nBaseToolsManager is the base implementation of the ToolsManager interface.\n\n```go\nfunc NewToolsManager(configHandler config.ConfigHandler, shell shell.Shell) *BaseToolsManager\n```\nNewToolsManager creates a new ToolsManager instance with the given config handler and shell.\n\n```go\nfunc (t *BaseToolsManager) Check() error\n```\nCheck verifies every tool that may be required for any windsor codepath. Equivalent to CheckRequirements(AllRequirements()) and exists for backward compatibility with the explicit \"check everything\" command (\\`windsor check\\`) and any caller that has not been migrated to declare per-command requirements.\n\n```go\nfunc (t *BaseToolsManager) CheckAuth() error\n```\nCheckAuth verifies the operator has the cloud CLIs for in-use platforms and that their credentials resolve. Called from terraform-touching command paths (bootstrap/up/apply/ plan/destroy) and \\`windsor check\\` — never from \\`init\\` or \\`env\\`.\n\n```go\nfunc (t *BaseToolsManager) CheckRequirements(reqs Requirements) error\n```\nCheckRequirements runs each check that reqs requests and that the config also enables. A request that is too broad is harmless, because the config gate skips the binary check. A request that is too narrow is the risk, because an outdated tool can then reach the run. CheckAuth, not this method, checks the AWS CLI and the credentials. Commands such as windsor init and windsor env do not need the AWS CLI.\n\n```go\nfunc (t *BaseToolsManager) CheckTerraform() error\n```\nCheckTerraform checks that the configured Terraform or OpenTofu command is on PATH. It also checks that the version meets the minimum. It is exported for callers that need Terraform when terraform.enabled is false, such as the module resolver of the composer, which runs terraform init.\n\n```go\nfunc (t *BaseToolsManager) GetTerraformCommand() string\n```\nGetTerraformCommand returns the terraform command to use (terraform or tofu) based on configuration. Defaults to \"terraform\" if terraform.driver is not set in the context config. Accepts case-insensitive driver values and \"tofu\" as an alias for \"opentofu\".\n\n```go\nfunc (t *BaseToolsManager) Install() error\n```\nInstall is a placeholder for the tool installation. It does nothing and returns nil.\n\n```go\ntype MockToolsManager struct {\n\tInstallFunc             func() error\n\tCheckFunc               func() error\n\tCheckRequirementsFunc   func(reqs Requirements) error\n\tCheckAuthFunc           func() error\n\tCheckTerraformFunc      func() error\n\tGetTerraformCommandFunc func() string\n}\n```\nMockToolsManager is a mock implementation of the ToolsManager interface for testing purposes.\n\n```go\nfunc NewMockToolsManager() *MockToolsManager\n```\nNewMockToolsManager creates a new instance of MockToolsManager.\n\n```go\nfunc (m *MockToolsManager) Check() error\n```\nCheck calls the mock CheckFunc if set, otherwise returns nil.\n\n```go\nfunc (m *MockToolsManager) CheckAuth() error\n```\nCheckAuth calls the mock CheckAuthFunc if set, otherwise returns nil.\n\n```go\nfunc (m *MockToolsManager) CheckRequirements(reqs Requirements) error\n```\nCheckRequirements calls the mock CheckRequirementsFunc when set, falls back to CheckFunc when only the legacy hook is configured (so existing tests keep working without rewrites), and otherwise returns nil. This mirrors the production aliasing where Check() routes through CheckRequirements(AllRequirements()).\n\n```go\nfunc (m *MockToolsManager) CheckTerraform() error\n```\nCheckTerraform calls the mock CheckTerraformFunc if set, otherwise returns nil.\n\n```go\nfunc (m *MockToolsManager) GetTerraformCommand() string\n```\nGetTerraformCommand calls the mock GetTerraformCommandFunc if set, otherwise returns \"terraform\"\n\n```go\nfunc (m *MockToolsManager) Install() error\n```\nInstallTools calls the mock InstallToolsFunc if set, otherwise returns nil.\n\n```go\ntype Requirements struct {\n\tDocker    bool\n\tColima    bool\n\tTerraform bool\n\tSecrets   bool\n\tKubelogin bool\n}\n```\nRequirements is the set of tool families a single command's codepath will actually exercise. Each field is opt-in: a command requests only what it will run, and the corresponding check still respects the configHandler gates (e.g. Docker=true only triggers a docker check when docker.enabled is set or workstation.runtime is a docker-family driver). Over-requesting is safe — checks no-op when the underlying config gate is off; under-requesting is the bug to avoid because it lets a stale tool slip through to the actual command.\n\n```go\nfunc AllRequirements() Requirements\n```\nAllRequirements returns a Requirements with every field true. Used by \\`windsor check\\` (the explicit \"verify my whole setup\" command) and as the default for code paths that must preserve historical Check() behavior.\n\n```go\ntype Shims struct {\n\tshims.Shims\n\tLookPath func(file string) (string, error)\n}\n```\nShims holds the shared system call primitives and the tools-specific shims.\n\n```go\nfunc NewShims() *Shims\n```\nNewShims returns a Shims with every field set to its real implementation.\n\n```go\ntype ToolsManager interface {\n\tInstall() error\n\tCheck() error\n\tCheckRequirements(reqs Requirements) error\n\tCheckAuth() error\n\tCheckTerraform() error\n\tGetTerraformCommand() string\n}\n```\nToolsManager checks that the tools and the cloud credentials of a Windsor command are ready.\n\n","path":"github.com/windsorcli/cli/pkg/runtime/tools","name":"tools","synopsis":"","isRedistributable":true}
