lima-vm/lima · error
option --list-fields conflicts with option --format
Error message
option --list-fields conflicts with option --format
What it means
--list-fields prints only the available field names, which is incompatible with an explicit --format that controls instance output rendering. listAction rejects the combination since output can only serve one purpose.
Source
Thrown at cmd/limactl/list.go:165
yq, err := cmd.Flags().GetStringArray("yq")
if err != nil {
return err
}
filter, err := cmd.Flags().GetStringArray("filter")
if err != nil {
return err
}
if jsonFormat {
format = "json"
}
// conflicts
if jsonFormat && cmd.Flags().Changed("format") {
return errors.New("option --json conflicts with option --format")
}
if listFields && cmd.Flags().Changed("format") {
return errors.New("option --list-fields conflicts with option --format")
}
if len(yq) != 0 {
if cmd.Flags().Changed("format") && format != "json" && format != "yaml" {
return errors.New("option --yq only works with --format json or yaml")
}
if listFields {
return errors.New("option --list-fields conflicts with option --yq")
}
}
if len(filter) != 0 {
if listFields {
return errors.New("option --list-fields conflicts with option --filter")
}
}
if quiet && format != "table" {
return errors.New("option --quiet can only be used with '--format table'")
}View on GitHub (pinned to dd909d0973)
Solutions
- Run `limactl list --list-fields` alone to enumerate fields
- Use `--format json` in a separate call when you need formatted instance data
Example fix
// before limactl list --list-fields --format json // after limactl list --list-fields limactl list --format json
Defensive patterns
Strategy: validation
Validate before calling
if slices.Contains(os.Args, "--list-fields") && slices.Contains(os.Args, "--format") {
os.Args = slices.DeleteFunc(os.Args, func(a string) bool { return strings.HasPrefix(a, "--format") })
} Try / catch
if err := runList(); err != nil {
if strings.Contains(err.Error(), "--list-fields conflicts with --format") { /* run two separate commands */ }
return err
} Prevention
- Treat --list-fields as a standalone discovery command
- Never add format flags to discovery calls
When it happens
Trigger: Running `limactl list --list-fields --format json` (or any --format) — listFields is true and the format flag was explicitly set.
Common situations: Trying to get field names in a machine-readable format for scripting; combining a discovery step with a formatting step in one call.
Related errors
- option --json conflicts with option --format
- option --yq only works with --format json or yaml
- option --list-fields conflicts with option --yq
- option --list-fields conflicts with option --filter
- option --quiet can only be used with '--format table'
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/9b9eb49e4c16f380.
Report an issue: GitHub.