lima-vm/lima · error
option --list-fields conflicts with option --filter
Error message
option --list-fields conflicts with option --filter
What it means
--filter selects which instances to display, which presupposes instance output — but --list-fields only prints the schema (field names). listAction rejects the pair because there is nothing for the filter to apply to.
Source
Thrown at cmd/limactl/list.go:177
// 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'")
}
if listFields {
names := fieldNames()
slices.Sort(names)
fmt.Fprintln(cmd.OutOrStdout(), strings.Join(names, "\n"))
return nil
}
if err := store.Validate(); err != nil {
logrus.Warnf("The directory %#q does not look like a valid Lima directory: %v", store.Directory(), err)
}
View on GitHub (pinned to dd909d0973)
Solutions
- Drop --filter when listing fields: `limactl list --list-fields`
- If filtering is needed, remove --list-fields and use `limactl list --filter 'name=default' --format json`
Example fix
// before limactl list --list-fields --filter 'name=default' // after limactl list --filter 'name=default' --format json
Defensive patterns
Strategy: validation
Validate before calling
args := os.Args[1:]
if slices.Contains(args, "--list-fields") && slices.Contains(args, "--filter") {
args = slices.DeleteFunc(args, func(a string) bool { return strings.HasPrefix(a, "--filter") })
} Try / catch
if err := runList(); err != nil {
if strings.Contains(err.Error(), "--list-fields conflicts with --filter") { /* retry without --filter */ }
return err
} Prevention
- Field discovery does not need filtering — call --list-fields plain
- Filter only real instance listings
When it happens
Trigger: Running `limactl list --list-fields --filter 'name=default'` — len(filter) != 0 with listFields true.
Common situations: Attempting to discover which fields exist for a filtered subset; scripts that grew both a discovery flag and a filter flag.
Related errors
- option --json conflicts with option --format
- option --list-fields conflicts with option --format
- option --yq only works with --format json or yaml
- option --list-fields conflicts with option --yq
- 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/2484e4e9927c3576.
Report an issue: GitHub.