helmfile init checks for helm and the plugins helmfile depends on, installing any that are missing.
Before helmfile apply works, the runner needs helm plus the helm-diff plugin. init bootstraps those dependencies in one step.
What it does
helmfile init verifies that helm is installed and that the plugins helmfile uses (notably helm-diff, and helm-secrets when you use secrets) are present, prompting to install the missing ones. With --force it installs without prompting, which is what CI needs.
Run helmfile init --force as a setup step so the helm-diff plugin is present before helmfile diff or helmfile apply, both of which rely on it. On an image that already ships the plugins, init is a fast no-op.
Common errors in CI
"helm: command not found" means helm itself is not on PATH; install it first. If a later helmfile diff prints "Error: unknown command \"diff\" for \"helm\"", the helm-diff plugin is missing because init was skipped or failed. A prompt that hangs the job means --force was omitted.
Using this in CI
A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.
Terminal
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods
# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info
# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodes
Frequently asked questions
helmfile init: Install Required Plugins?
Before helmfile apply works, the runner needs helm plus the helm-diff plugin. init bootstraps those dependencies in one step.
What it does?
helmfile init verifies that helm is installed and that the plugins helmfile uses (notably helm-diff, and helm-secrets when you use secrets) are present, prompting to install the missing ones. With --force it installs without prompting, which is what CI needs.
In CI?
Run helmfile init --force as a setup step so the helm-diff plugin is present before helmfile diff or helmfile apply, both of which rely on it. On an image that already ships the plugins, init is a fast no-op.
Common errors in CI?
"helm: command not found" means helm itself is not on PATH; install it first. If a later helmfile diff prints "Error: unknown command \"diff\" for \"helm\"", the helm-diff plugin is missing because init was skipped or failed. A prompt that hangs the job means --force was omitted.