argoproj/argo-workflows · error
unknown output mode: %s
Error message
unknown output mode: %s
What it means
`argo cluster-template list` validates its `--output`/`-o` flag against the EnumFlagValue whitelist {wide, name} after listing ClusterWorkflowTemplates from the argo server. If the resolved output string is not an accepted value, the switch falls to default and returns this error. The flag is an EnumFlagValue, so this normally means the value bypassed flag validation (e.g. set programmatically) or the empty/generic default branch was hit with an unexpected string.
Source
Thrown at cmd/argo/commands/clustertemplate/list.go:54
}
serviceClient, err := apiClient.NewClusterWorkflowTemplateServiceClient()
if err != nil {
return err
}
cwftmplList, err := serviceClient.ListClusterWorkflowTemplates(ctx, &clusterworkflowtemplate.ClusterWorkflowTemplateListRequest{})
if err != nil {
return err
}
switch output.String() {
case "", "wide":
printTable(cwftmplList.Items)
case "name":
for _, cwftmp := range cwftmplList.Items {
fmt.Println(cwftmp.Name)
}
default:
return fmt.Errorf("unknown output mode: %s", output.String())
}
return nil
},
}
command.Flags().VarP(&output, "output", "o", "Output format. "+output.Usage())
return command
}
func printTable(wfList []wfv1.ClusterWorkflowTemplate) {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0)
_, _ = fmt.Fprint(w, "NAME")
_, _ = fmt.Fprint(w, "\n")
for _, wf := range wfList {
_, _ = fmt.Fprintf(w, "%s\t", wf.Name)
_, _ = fmt.Fprintf(w, "\n")
}
_ = w.Flush()
}View on GitHub (pinned to 35bff19146)
Solutions
- Use an allowed output value: omit `-o` (default/wide table) or pass `-o wide` or `-o name
- Get machine-readable output via the API/CLI alternatives (e.g. `argo cluster-template list -o name` plus per-template gets, or use the gRPC/HTTP API directly) since json/yaml output is not supported by this command
- Run `argo cluster-template list --help` to see the documented values in the -o flag usage
Example fix
// before argo cluster-template list -o json // after argo cluster-template list -o name # or: argo cluster-template list -o wide
Defensive patterns
Strategy: validation
Validate before calling
case "", "wide", "name": // ok default: echo "invalid -o '$o'; allowed: wide, name" >&2; exit 1
Prevention
- Only pass -o wide or -o name to cluster-template list; reserve -o json/yaml for commands that support them
- Check `argo cluster-template list --help` before scripting the flag
- Wrap argo CLI calls in CI with a flag whitelist lint script
When it happens
Trigger: Running `argo cluster-template list -o <value>` where <value> is anything other than "", "wide", or "name" — e.g. `-o json`, `-o yaml`, `-o table`, which are valid for other argo commands but not this one.
Common situations: Scripts or shell aliases copying the `-o json`/`-o yaml` idiom from `argo list`, `argo template list`, or kubectl; muscle-memory reuse of kubectl output formats against the cluster-template command.
Understand the failure class
Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.
Related errors
- failed to get existing cluster workflow template %q to updat
- failed to update cluster workflow template: %s, %w
- invalid shell %q: supported shells are bash, zsh, and fish
- error converting %s: %w
- failed to parse TypeMeta: %w
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/3eae06fb214eb63b.
Report an issue: GitHub.