cmd/root.go:54,107 skips config loading only when os.Args[1] is literally version. Cobra's help and completion subcommands therefore try to read the config, and on a fresh install without /etc/osapi/osapi.yaml both exit 1 with failed to read config. Bare --help works because Cobra handles it before initialization. Reproduced by running the built binary.
Fix: decide on the resolved Cobra command rather than raw os.Args, and include help and completion in the skip set.
Found in the September 2026 codebase review. Tracked in the review tracking issue.
cmd/root.go:54,107skips config loading only whenos.Args[1]is literallyversion. Cobra'shelpandcompletionsubcommands therefore try to read the config, and on a fresh install without/etc/osapi/osapi.yamlboth exit 1 withfailed to read config. Bare--helpworks because Cobra handles it before initialization. Reproduced by running the built binary.Fix: decide on the resolved Cobra command rather than raw
os.Args, and includehelpandcompletionin the skip set.Found in the September 2026 codebase review. Tracked in the review tracking issue.